Repository navigation
fix(ui): slash menu hides /loop and /goal when a command is typed in front of a pasted prompt - #196123
Conversation
A slash token at the start of the draft was classified as an inline shortcut whenever text followed it, so typing /loop or /goal in front of a pasted prompt only offered skills (native commands were hidden behind the inline dispatch gate), and selecting a command swallowed the word after the caret or ran the bare command. The leading token is now the draft's own command: its menu offers every command, selection completes the token in place and keeps the prose as arguments, and /goal opens Goal mode with that prose as the objective. Co-authored-by: vincentkoc <[email protected]>
…front of a pasted prompt Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 67efa12f-1549-4267-97e9-1946d7390fed
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Before / after (mocked Control UI, Chromium 1280×900)Scenario: paste a prompt, press Ctrl+Home, type Before (origin/main): after Enter the completion consumed the word under the caret and armed inline-argument mode; while the dispatch gate was closed the menu showed skills only. After: the menu lists Before ( After: Goal mode opens with the pasted prompt as the objective. |
The caret-bounded token check reuses getSlashCommandRelevance instead of a second prefix matcher, keeping the chat boot bundle inside its gzip budget. Co-authored-by: vincentkoc <[email protected]>
Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 592dd829-b521-49cb-aed9-6da6ecb64622
|
Codex review: needs changes before merge. What this changesThis PR completes leading slash commands without consuming pasted text and passes that text into Goal mode. Example: Paste “Apply the design notes”, move to the start, type /loo, and press Enter.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it repairs a current composer bug, but its new token-boundary check introduces a skill-completion regression. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherChat and New Session share the slash-menu parser and selection owner, which transform draft text and caret position into completions, draft edits, or command actions. flowchart LR
A[Draft and caret] --> B[Slash token parser]
B --> C[Shared slash menu]
D[Command catalog] --> C
C --> E[Draft replacement]
C --> F[Goal composer]
C --> G[Existing command dispatch]
Technical reviewBest possible solution: Keep the existing parser and composer owners, preserving colon-terminated skill tokens while bounding genuinely appended prose at the caret. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the reported classification failure, and inspected before/after browser screenshots corroborate it; no target code was executed during this review. Is this the best way to solve the issue? Repairing the existing token parser and selection owner is appropriate, but the suffix check must recognize the existing colon syntax before treating a suffix as pasted prose. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6edcaa28edb7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +23, Tests +187, Docs +1. Total +211 across 8 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 9, 2026, 12:16 PM ET / 17:16 UTC. |
Strip the optional terminal colon for the caret-boundary name check. Browser regression is red on the prior published head and green after the repair. Allocate exactly 200 net regression-test LF lines for dispatch admission, leading-command and Goal draft preservation, and colon-token completion; leave the shared ceiling unchanged. Co-authored-by: vincentkoc <[email protected]>
Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: b1029831-092e-4f7e-908f-92a9101947a6
Co-authored-by: vincentkoc <[email protected]>
Read the host-owned draft once instead of a second helper lookup and combine the shared token replacement path. Identical-base performance check passes at +16 B chat boot gzip without changing any budget. Co-authored-by: vincentkoc <[email protected]>
Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 03cc5e29-7ce6-4e2d-895e-5bfb62330c9f





What Problem This Solves
Fixes: typing
/loop,/goal, or another command in front of a pasted prompt can hide built-in completions or consume the first word of the prompt when completing.Reported by @vincentkoc.
Work sessions
Linked for team reference; these sessions aren’t public.
User Impact
The leading command remains discoverable and completes in place without sending or losing the pasted text. Selecting
/goalopens Goal mode with that text as its objective. Commands inside prose retain their inline behavior, including completing a colon-terminated skill name with the caret inside its name. No migration or user action is required.Why This Change Was Made
A leading slash token was misclassified as inline whenever text followed it. The existing parser now distinguishes leading commands from inline invocations by their preceding text. Selection replaces only the token; the existing Goal owner receives the objective. The caret-boundary check reuses command relevance ranking and ignores the optional terminal colon when recognizing a complete token.
The simplify pass retained the existing owners and removed a duplicate prefix matcher. Small production growth is needed for token-boundary and draft-preservation behavior; no state store or dispatch authority was added.
Evidence
Original regressions were red on base
0ef603bec0c5cc585170378524bd5be30b86b9dfand green with the fix: leading command discovery with dispatch admission open/closed, first-word preservation, and Goal objective preservation.Built Control UI / Chromium browser flow with mocked Gateway transport: paste → Ctrl+Home →
/loo→ Enter preserves/loop Apply…withoutchat.send;/goaopens Goal mode with the objective. Existing inspected before/after screenshots remain applicable.Addressed the hosted P2 finding: edit
Please use /wether:intoPlease use /wea|ther:, then complete/weather. The added browser regression producedPlease use $weather ther:on the prior published source andPlease use $weatherafter repair. Both browser scenarios now pass: 1.525 seconds test time / 13.58 seconds wall time including the production UI build.Repaired candidate: 61 focused unit tests pass across
commands.test.ts,chat-composer-suggestions.test.ts, andchat-composer-menu.test.tsx(5.60 seconds wall time). UI typecheck, targeted oxlint/oxfmt, andgit diff --checkpass.The failing
checks-fast-baseline-ratchetsjob was the test-line budget, not a product test. A separate allocation grants exactly 200 net test LF lines for the dispatch-admission, leading-command/Goal draft-preservation, and colon-token browser regressions. Shared scalar unchanged; the local ratchet passes with zero spare allowance. These tests cover distinct parser/admission and real browser-editing boundaries.Fresh local autoreview (Codex, local snapshot against base
0ef603bec0c5cc585170378524bd5be30b86b9df, P0/P1): scoped-clean. The hosted P2 finding was separately reproduced and fixed, not waived.Prior published head
266f24e5101513fa03762a32c83d7f46940f2a57passed the UI, browser, type/lint, security, and performance checks; current-head CI must complete before landing. Prior CI is not current-head evidence.Follow-up gate repair: integrated exact CI base
568d89f3a4e82d13ecca4ed602c46a04bda322f0to reproduce the failing bundle gate, removed the redundant draft-tail helper/read and combined the common replacement branch. The same-base performance check passes: chat boot 1,298,743 → 1,298,759 gzip bytes (+16); New Session 802,745 → 802,756 (+11); startup/CSS unchanged. No performance ceiling raised.After simplification: 192 unit tests pass (9.01 seconds wall), both built-browser scenarios pass (14.06 seconds wall), UI typecheck and targeted lint/format pass. Fresh local autoreview of the simplification through P2 is scoped-clean.
Current baseline debt: run 42757339319 reports 6,616,039 test LF lines against a 6,616,028 ceiling, with exactly +200 PR test lines and +200 allocation. The remaining 11-line deficit is inherited from its base. No shared scalar or extra debt grant was changed.
Gap: the mock did not identify which runtime admission gate hid native commands in the reported Team sessions. The leading-token fix removes that dependency; the closed-gate case has unit coverage. Browser proof mocks Gateway transport and is not live-model proof.
Worked on by