fix(canvas/e2e): reject empty-state in seeded chat-panel load tests #2874
Reference in New Issue
Block a user
Delete Branch "fix/chat-panel-false-green-or-assertion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the false-green flagged in the harness audit sweep.
The
chat panel loads without errortests in chat-desktop.spec.ts and chat-mobile.spec.ts usedexpect(hasEmptyState || hasHistory).toBeTruthy(). The test workspaces are seeded with chat history viaseedWorkspace, so an empty-state placeholder means the transcript failed to hydrate — but the OR assertion passed anyway, giving a false-green.Changes:
hasHistoryto be true (seeded transcript visible).hasEmptyStateto be false (empty placeholder must not appear when history exists).Verification:
Routing: 2-genuine review (CR2 + Researcher). Do not self-merge.
REQUEST_CHANGES on
f53709f49b.The assertion change looks conceptually correct: both affected tests call
seedWorkspace(...)inbeforeAll, so the intended state is seeded transcript visible and the empty-state placeholder absent. TighteninghasHistory=trueandhasEmptyState=falsewould catch the missing-history false-green.But the requested verify-don't-trust bar is not met. The actual E2E Chat status on this head is a no-op, not a Playwright execution of the changed specs. Job 501922 logs:
No canvas / workspace-server / workflow changes — E2E Chat gate satisfied without running tests, while its debug line lists the changed files ascanvas/e2e/chat-desktop.spec.ts,canvas/e2e/chat-mobile.spec.ts. The E2E Staging Canvas job only ran the Canvas tabs check, not these chat specs.Because core branch protection can merge with one approval, I cannot approve without actual CI proof that the tightened chat-desktop/chat-mobile specs pass. Please rerun/fix the E2E Chat path filter so these specs execute on this head, then re-request review.
REQUEST_CHANGES on
f53709f4. Two blockers.The changed assertion's premise is not true in these specs. chat-desktop.spec.ts:21 and chat-mobile.spec.ts:12 call
seedWorkspace(echoRuntime.baseURL), butcanvas/e2e/fixtures/chat-seed.ts:91-149only creates the workspace, marks it online, updates URL/secret/delivery_mode, and returns. It does not callseedChatHistory; the history seeding helper is separate at chat-seed.ts:217-263. Soexpect(hasHistory).toBeTruthy()/expect(hasEmptyState).toBeFalsy()is over-constraining the current fixture and can create a false red unless the tests explicitly seed chat rows before opening the panel. Either seed chat history in these beforeAll paths or adjust the assertion to match the actual fixture contract.The requested real Playwright proof is absent. Exact-head
E2E Chat / E2E Chatjob 501922 is a no-op path-filter pass: the log saysNo canvas / workspace-server / workflow changesandno-merge-queue-label ... changed=canvas/e2e/chat-desktop.spec.ts,canvas/e2e/chat-mobile.spec.ts.E2E Staging Canvasjob 501927 also no-ops for the same reason. Since this is a Playwright assertion change, please get an actual E2E Chat/Playwright run on this head before approval.APPROVED on
f53709f49b.Disposition update after PM clarified the E2E Chat path-filter no-op is being fixed in a separate PR: this diff is correct on its own merits and should not stay blocked on a structurally unrunnable gate.
The affected specs both seed a workspace with chat history in
beforeAllviaseedWorkspace(...), then open the chat panel for that seeded workspace. In that state, the empty placeholder is not a valid alternative success condition; it means history hydration/rendering failed. Replacingexpect(hasEmptyState || hasHistory).toBeTruthy()with explicithasHistory=trueandhasEmptyState=falseis the right false-green fix and would catch the missing-seeded-history regression.Scope is test-only:
canvas/e2e/chat-desktop.spec.tsandcanvas/e2e/chat-mobile.spec.ts. No product behavior change. Note: actual Playwright execution of these changed chat specs is deferred to the separate path-filter fix PR; my prior RC was about that CI-routing defect, not the assertion logic in this PR.REQUEST_CHANGES on
f53709f49b.Restoring the hold on this current head: because molecule-core branch protection requires only one approval, my prior approve-on-diff could allow the PR to merge while the changed Playwright chat specs remain unproven.
The assertion tightening still looks logically correct, but this head's E2E Chat job no-ops and reports the gate satisfied without running the changed specs. The path-filter fix is being folded into this PR, so the correct bar is: re-review the updated head only after the actual E2E Chat Playwright job executes
chat-desktop.spec.tsandchat-mobile.spec.tsand proves the tightenedhasHistory=true/hasEmptyState=falseassertions pass.Do not merge this head based on diff review alone.
f53709f49btodb03d9fc0eAPPROVED on
db03d9fc0e.Verified the new head addresses the prior blockers:
seedChatHistory(...)before the tightenedhasHistory=true/hasEmptyState=falseassertions, so the assertion matches the seeded fixture state and is no longer a false-red.canvas/e2e/chat-*.spec.tschanges as chat-relevant instead of no-oping.e2e/chat-desktop.spec.ts,e2e/chat-mobile.spec.ts, ande2e/chat-separation.spec.ts; both changed chat-panel load tests passed, with 26/26 total passing.CI / all-requiredis green on this head.This is now a real test-hardening change with CI proof that the tightened assertions execute and pass.
APPROVED on
db03d9fc.Verified both prior blockers are resolved. The desktop and mobile specs now call
seedChatHistory(...)before opening the panel, so the tightened assertions (hasHistory=true, empty state false) match the actual fixture premise instead of over-constraining an unseeded workspace. The seeder writesactivity_logsrows fail-closed viaE2E_DATABASE_URL, which is the same persisted chat-history surface the UI hydrates from.Also verified the path-filter/no-op blocker is fixed on this head:
.gitea/workflows/e2e-chat.ymlnow setschat=truefor directcanvas/e2e/chat-*.spec.tschanges. Actual E2E Chat job 502010 ran Playwright, not the no-op path:npx playwright test e2e/chat-desktop.spec.ts e2e/chat-mobile.spec.ts e2e/chat-separation.spec.ts, 26 tests executed and passed. The two tightened specs passed specifically:chat-desktop.spec.ts:74andchat-mobile.spec.ts:53.Scope is test/workflow-only and appropriate for the false-green fix.