Skip to content

fix(ui): refresh open command menus when their chat catalog changes - #164863

Open
ooiuuii wants to merge 2 commits into
openclaw:mainfrom
ooiuuii:fix/scoped-open-command-menus
Open

ooiuuii wants to merge 2 commits into
openclaw:mainfrom
ooiuuii:fix/scoped-open-command-menus

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #164862

What Problem This Solves

Fixes: an open slash or skill menu keeps old choices when its chat's command catalog refreshes.

User Impact

Open menus reflect the accepted commands for their own chat, including in split panes, without requiring another keystroke. Drafts, caret position, dismissals and argument collection retain their existing behavior.

Why This Change Was Made

Carry the existing metadata owner's accepted command snapshot into the composer and reconcile only already-open menus when it changes. Deferred renders read their own pane's snapshot instead of whichever pane last updated the shared registry. Existing normalization, refresh admission and default non-pane consumers remain the owners of their contracts; no new cache, TTL or dispatch policy is introduced.

Evidence

  • Exact base 6f556a72ba112c8602bafa5494babe71ba2a7f87. Identical 185 cases: original 164 passed / 21 assertion failures → candidate 185 passed → reconciliation-only mutation 164 passed / 21 assertion failures. Real metadata publication, accepted subscriber, full composer and Lit menu DOM execute.
  • New repository-native regression: 2 pass / 9 RED → 11 pass → 2 pass / 9 RED. Companion owner-boundary cases: 27/12 → 39/0 → 27/12. All 135 unchanged command cases pass throughout.
  • Covers settled slash/$ menus, removal of all matches, active-descendant cleanup, selected identity after reordering, Escape dismissal, and both delayed/coalesced split-pane publication orders. Companion controls cover stale owners, pending hydration and argument modes. Mutation removes reconciliation only, retaining the producer/caller prerequisites.
  • Ten production files and one native regression; no test configuration, module mocks, dependency, permission or dispatch-policy change. Current-main preflight verifies the affected owners have not drifted.
  • Current project formatting, targeted non-type-aware lint and clean patch application pass. Independent review verifies the exact patch and source receipts and independently replays the full matrix with no P0–P2 finding. The canonical autoreview helper is unavailable, not declared clean.
  • Isolated candidate: native test bodies 275 ms, companion 568 ms, unchanged command tests 70 ms, Vitest total 1.99 s. Independent candidate replay 1.91 s. Canonical pnpm test ui/src/pages/chat/chat-composer-catalog-publication.test.ts --maxWorkers=1 wall time and hosted CI seconds are not yet measured.

Validation limits: Local tests, including the unchanged native-file bytes, run under an external bounded adapter isolating unrelated UI/import paths and synthetic transport. The critical metadata/publication/composer/menu owners are real, but this is not a canonical complete-graph run. The unseamed attempt collected zero tests because a sparse-source normalizer dependency was absent. Actual TS7 strict/noUnchecked checks still fail overall (756 baseline / 755 candidate diagnostics; no additions or new-test diagnostics); no full typecheck/build pass is claimed. Full ChatPane/LitElement shell, browser screenshots and live Gateway proof remain unperformed. Applicable hosted CI and further UI proof must be checked on the published head before merge; this PR is for review, not declared merge-ready.

Separate from #164839's caret/keyboard precedence.

Current CI repair (2026-10-04 10:38 UTC)

Head fb791e167362a6b02344374a9b4adea3b41c7c1f removes only a redundant === true comparison in the test's names filter (+1/-1). Production, assertions, payloads and case definitions are unchanged. The actual DOM type gives a non-null string, so the predicate already returns boolean. Independent review verifies the exact one-line delta.

The prior-head CI run 37195167356 completed with 37 successful jobs, 24 skipped, and the introduced type-aware lint failure plus its aggregate gate. All five test-type lanes passed. The new test ran natively with 11/11 passing, 417.30 ms test duration in job 111415596554; this is native hosted evidence for 67f4224…, not the new head or a standalone canonical command wall time.

Exact project oxlint/tsgolint with real DOM declarations reproduces the reported rule before and passes after in a bounded fixture. The repaired full file passes project formatting and non-type-aware lint. Identical tests: published and repaired candidates each 185/185, original and reconciliation mutation each 164 pass / 21 assertion RED. Local full UI type-aware lint remains sparse-graph blocked; TS7 diagnostics are identical before/after (755, none in the native regression). Current-head CI run 37196113303 passed: 39 successful jobs, 24 skipped. The repaired type-aware lint lane passed (job 111418663391). The repository-native regression passed 11/11, 414.45 ms test duration, in UI shard job 111418426908. These are current-head hosted results; a standalone canonical command wall time remains unmeasured.

Upstream review found no introduced blocking production defect and still requires real-browser ChatPane-to-composer proof, including split panes, before merge. That proof remains unperformed; native jsdom CI does not replace it.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The PR gives each chat composer its accepted command catalog and refreshes already-open slash and skill menus when that catalog changes.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch and native regression provide useful confidence, but required after-fix browser evidence remains absent.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Merge readiness

⛔ Blocked before merge - 2 items remain

The fix remains necessary: current main still lacks publication-driven menu reconciliation, and the adjacent caret-completion PR addresses a different problem. No blocking introduced code defect was found.

Priority: P2
Reviewed head: fb791e167362a6b02344374a9b4adea3b41c7c1f

Before merge

  • Add real behavior proof - The metadata binding and composer reconciliation are exercised under jsdom with mocked transport, but the captured body explicitly leaves real-browser ChatPane-to-composer refresh and split-pane behavior unperformed. Native CI is supplemental; no stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Complete next step - Add real-browser ChatPane proof with inspected before/after screenshots for catalog refresh and split-pane isolation, and record the standalone regression-command wall time. Redact private information from screenshots, recordings, logs, or transcripts. Update the PR body to trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review.

Findings

None.

Agent review details

How this fits together

The Control UI receives command catalogs through chat metadata and presents them in the message composer. This change carries each pane’s accepted catalog into its completion menus while retaining existing command dispatch.

flowchart TD
  A[Gateway chat metadata] --> B[Scoped metadata store]
  B --> C[Current chat binding]
  C --> D[Chat pane composer]
  D --> E{Menu already open}
  E -->|Yes| F[Reconcile visible choices]
  E -->|No| G[Preserve dismissal]
  F --> H[Existing selection and dispatch]
Loading

Technical review

Best possible solution:

Each pane should present its own accepted catalog immediately while preserving draft, caret, dismissal, argument collection, and existing dispatch checks.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: publish a changed accepted catalog after an open menu’s hydration settles, then render without typing. Current main updates the shared registry but has no render-time menu reconciliation; this reviewer did not execute the reproduction.

Is this the best way to solve the issue?

Yes, the direction reuses the metadata owner and existing completion builders rather than introducing competing refresh policy. The integrated browser result still needs confirmation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 979466250d54.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current-main necessity: Inspected the merge-base-to-head introduced patch. A separate comparison showed no changes between the merge base and fetched main across all ten affected production files; current main therefore still lacks this reconciliation. The supplied test merge is stale and was not used to infer merge-result regressions. (ui/src/pages/chat/components/chat-composer.ts:188, fb791e167362)
  • Production ownership and reconciliation: The existing metadata binding supplies accepted command snapshots and checks connection, session, agent, and binding currency. ChatPane passes its getter to the composer, which reconciles open command menus without another hydration request and resets menu state when the owner changes. (ui/src/pages/chat/chat-state-refresh.ts:96, fb791e167362)
  • Focused regression coverage: Read the complete new regression: eleven jsdom cases exercise real metadata publication and composer rendering with mocked Gateway transport, covering updated rows, removal, active-descendant cleanup, dismissal, selected identity, and both split-pane publication orders. This is useful supplemental coverage, but it does not mount the full ChatPane browser flow. (ui/src/pages/chat/chat-composer-catalog-publication.test.ts:88, fb791e167362)
  • Captured proof and re-review continuity: The supplied complete PR body, sourceRevision cbdca524daef660a1020dea0815e4be498983949faf38c7b0ba7c6a387091de5, explicitly says browser screenshots and full ChatPane execution remain unperformed. The previous exact-head review had no findings and requested browser evidence plus test-cost measurements; the browser gap remains. (fb791e167362)
  • Exact-head CI and measured hosted cost: GitHub confirms run 37196113303 succeeded for the pinned head. UI job 111418426908 succeeded; its Test Control UI step ran from 10:42:39 to 10:45:39 UTC, or 180 seconds. The captured body reports eleven native regression cases passing in 414.45 ms; that test duration does not establish standalone command wall time. (fb791e167362)
  • Existing user contract and scoped policy: Control UI documentation defines scoped metadata refreshes, and slash-command documentation preserves surrounding drafts and existing dispatch checks. Root and UI AGENTS.md were read fully and applied, including scoped async ownership, visual proof, and test-cost reporting. No maintainer-notes directory was present. Public docs: docs/web/control-ui.md. (docs/web/control-ui.md:57, fb791e167362)

PR surface

Source +99, Tests +332. Total +431 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 10 116 17 +99
Tests 1 332 0 +332
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 448 17 +431

Review metrics

Metric Value Why it matters
Production versus regression growth production net +99 lines; tests +332 lines Production growth has a stated purpose: carrying scoped accepted snapshots and reconciling their existing menu consumers; the regression targets observable publication behavior.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Stale completion choices are a bounded Control UI interaction defect, with no demonstrated outage, dispatch failure, or data loss.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add inspected, redacted browser before/after evidence showing open slash and skill menus refreshing without typing, including split-pane isolation and retained draft/caret.
  • Record the standalone pnpm test ui/src/pages/chat/chat-composer-catalog-publication.test.ts --maxWorkers=1 wall time; distinguish it from test-body duration and the verified 180-second hosted UI test step.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-04T10:26:42.288Z sha 67f4224 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T10:44:55.491Z sha fb791e1 :: needs real behavior proof before merge. :: none

Reviewed October 4, 2026, 6:56 AM ET / 10:56 UTC (Revision 3).

This branch has not been deployed

No deployments
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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Open command menus retain stale choices after chat catalog refresh

1 participant