Repository navigation
test(ui): close the Discussion no-URL gap in the cold-open invariant - #125498
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 11:57 PM ET / August 18, 2026, 03:57 UTC. ClawSweeper reviewWhat this changesThe PR makes the Control UI cold-open test exercise Discussion without an external URL, explicitly records that valid actionless empty state, and preserves the populated URL-path assertion. Merge readinessKeep open. This is a focused, correct test-contract update: current main permits an open Discussion response without URLs and renders it actionless, while the existing cold-open scenario never covered that case. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI asks the Gateway whether a session has a Discussion, then offers a sidebar panel. The panel renders an embed, an external-link empty state, or an intentionally actionless unavailable state based on the response URLs. flowchart LR
A[Gateway discussion response] --> B[Chat sidebar offers Discussion]
B --> C[Discussion panel]
C --> D{Embed or external URL?}
D -->|Yes| E[Content or open link]
D -->|No| F[Unavailable empty state]
F --> G[Cold-open contract test]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the conditional no-URL behavior and land this focused contract coverage after the exact-head required checks finish successfully. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the path: a valid open response without optional URLs offers Discussion, whose renderer produces the actionless unavailable state. Local execution was not performed in this read-only review. Is this the best way to solve the issue? Yes—the change covers the omitted protocol-valid state without inventing a nonfunctional action, while the populated scenario continues to prove the external-link branch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c75d4dc91142. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
b71699e to
c8222e9
Compare
|
Land-ready verification for
Known proof gap: the unrelated attachment-lifecycle flake appeared once and passed on rerun; no code in that file was changed. Production LOC is +0/-0; test LOC is +3/-2. |
|
Merged via squash.
|
What Problem This Solves
PR #125174 landed the sidebar cold-open invariant: every offered slot with backing data must render content,
and any slot showing the generic empty state must name an action or sit in a small commented allowlist,
checked bidirectionally so stale entries fail too.
A live audit against merged
main— mocked Control UI dev server, every tab opened cold in a fresh browsercontext — found a state the invariant did not cover. Both of its scenarios always supplied a discussion
openUrl, so the Discussion panel's no-URL state was never exercised. In that state the panel rendersthe generic empty state with no action, because
session-discussion-panel.tsonly offers "Open discussion ina new tab" when a URL exists. Discussion is offered whenever a discussion exists at all, not only when it has
a URL, so the state is genuinely reachable in the product.
Why This Change Was Made
An invariant with an unexercised hole is weaker than it looks: the audit found this by running the product,
not by running the suite, which is exactly the kind of gap the invariant exists to prevent.
The sparse scenario now returns a discussion without
openUrlwhile keeping Discussion offered, and theresulting actionless empty state joins the allowlist with its reason. The populated scenario keeps the
external-link assertion, so the with-URL path is still covered.
Deliberately not done: inventing an action for the no-URL case. With no URL there is nothing to open, and a
button that opens nothing would satisfy the letter of the invariant's second part while destroying its
meaning. The allowlist exists precisely so honestly-actionless states are declared rather than faked.
User Impact
None — test-only, zero production lines.
Evidence
The state was proven reachable and the invariant proven to catch it: before adding the allowlist entry, the
new scenario failed with
which is the invariant's own message naming the slot. Adding the commented entry turns it green, and the
unchanged exact-equality assertion still rejects the entry if Discussion ever gains an action.
Final allowlist:
Review(no git checkout, nothing to diff),Tasks(no background tasks, nothing toinspect),
Discussion(no external URL, nothing to open).pnpm check:changedgreen; Codex autoreview clean.reviewMetrics — production vs test LOC: production
0, tests+3 / −2.No
CHANGELOG.mdedit — release-only per repo policy; test-only change.