Skip to content

test(ui): close the Discussion no-URL gap in the cold-open invariant - #125498

Merged
steipete merged 1 commit into
mainfrom
steipete/discussion-cold-open-allowlist
Aug 18, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/discussion-cold-open-allowlist

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 browser
context — 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 renders
the generic empty state with no action, because session-discussion-panel.ts only offers "Open discussion in
a 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 openUrl while keeping Discussion offered, and the
resulting 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

Discussion renders the generic empty state without an action

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 to
inspect), Discussion (no external URL, nothing to open).

 Test Files  1 passed (1)      Tests  15 passed (15)
 Test Files  3 passed (3)      Tests  14 passed (14)

pnpm check:changed green; Codex autoreview clean.

reviewMetrics — production vs test LOC: production 0, tests +3 / −2.

No CHANGELOG.md edit — release-only per repo policy; test-only change.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 18, 2026 01:35
@steipete steipete self-assigned this Aug 18, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 11:57 PM ET / August 18, 2026, 03:57 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: c8222e936203bdb45512f2d79786f22f43bf7316

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, source-aligned test update with no correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR is not subject to the external contributor real-behavior-proof gate; its body also records the focused mocked Control UI result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR is not subject to the external contributor real-behavior-proof gate; its body also records the focused mocked Control UI result.
Evidence reviewed 5 items Current runtime behavior: Current main accepts an open discussion without either optional URL and renders the generic empty state with no action when both the embed and external URL are absent.
Protocol contract: The Gateway protocol makes both embedUrl and openUrl optional for every discussion state, so the no-URL response used by the test is a valid contract shape.
PR coverage change: The PR removes openUrl only from the sparse scenario, adds the documented Discussion allowlist entry, and switches the URL-header assertion to the populated scenario, preserving both branches of the behavior.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: the patch is focused and has no actionable finding; it awaits normal exact-head PR validation and maintainer handling.
Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 2 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 2 +1

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +3/-2 The change only strengthens the browser contract around an already-shipped UI branch and adds no runtime behavior.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a narrowly scoped test-only Control UI contract improvement with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR is not subject to the external contributor real-behavior-proof gate; its body also records the focused mocked Control UI result.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged invariant commit and recent related Control UI sidebar work, in addition to this narrow follow-up. (role: introduced the cold-open invariant and recent area contributor; confidence: high; commits: 65d1fa418980, 93f7492570ef; files: ui/src/e2e/chat-sidebar-panel-contract.e2e.test.ts, ui/src/pages/chat/components/session-discussion-panel.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-18T01:40:37.180Z sha b71699e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T02:12:49.019Z sha b71699e :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/discussion-cold-open-allowlist branch from b71699e to c8222e9 Compare August 18, 2026 03:50
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for c8222e936203bdb45512f2d79786f22f43bf7316:

  • Rebased cleanly onto Phase 1 merge aa2d3df8e639663a01ac6e2a30ff801619564c1a; no conflicts. This includes the durable-draft race fix and the 600-line chat-pane-render.ts split.
  • Exact-head CI: node scripts/watch-pr-ci.mjs 125498 c8222e936203bdb45512f2d79786f22f43bf7316 → run https://github.com/openclaw/openclaw/actions/runs/32096938867. Attempt 1 had one unrelated failure in chat-attachment-read-lifecycle.e2e.test.ts; the isolated failed-job rerun passed unchanged on attempt 2. All 12 UI E2E shards, check-lint-core-5, and openclaw/ci-gate are green.
  • Fresh review: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-output → clean, no accepted/actionable findings.
  • Native landing flow: scripts/pr review-init 125498, scripts/pr review-artifacts-init 125498, and scripts/pr review-validate-artifacts 125498 → READY FOR /prepare-pr, zero findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125498 → passed with gates_mode=hosted_exact_or_recent_parent; the exact hosted gate was reused, so no separate Testbox lease or run ID was allocated.
  • Latest ClawSweeper review has no Rank-up moves: section; its remaining exact-head-validation item is satisfied.

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.

@steipete
steipete merged commit 6611e40 into main Aug 18, 2026
158 of 160 checks passed
@steipete
steipete deleted the steipete/discussion-cold-open-allowlist branch August 18, 2026 04:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant