Skip to content

fix(ui): slash menu hides /loop and /goal when a command is typed in front of a pasted prompt - #196123

Merged
roboclaw-bot merged 10 commits into
mainfrom
openclaw/crisp-prawn
Nov 10, 2026
Merged

roboclaw-bot merged 10 commits into
mainfrom
openclaw/crisp-prawn

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

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 /goal opens 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 0ef603bec0c5cc585170378524bd5be30b86b9df and 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… without chat.send; /goa opens Goal mode with the objective. Existing inspected before/after screenshots remain applicable.

  • Addressed the hosted P2 finding: edit Please use /wether: into Please use /wea|ther:, then complete /weather. The added browser regression produced Please use $weather ther: on the prior published source and Please use $weather after 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, and chat-composer-menu.test.tsx (5.60 seconds wall time). UI typecheck, targeted oxlint/oxfmt, and git diff --check pass.

  • The failing checks-fast-baseline-ratchets job 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 266f24e5101513fa03762a32c83d7f46940f2a57 passed 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 568d89f3a4e82d13ecca4ed602c46a04bda322f0 to 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

roboclaw-bot and others added 2 commits November 9, 2026 16:38
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
@clawsweeper

clawsweeper Bot commented Nov 9, 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.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Before / after (mocked Control UI, Chromium 1280×900)

Scenario: paste a prompt, press Ctrl+Home, type /loo, press Enter.

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.

Before: /loop completion swallowed "Apply", draft reads "/loop  the design notes…"

After: the menu lists /loop [spec] under Tools above the skills, and Enter completes the token in place.

After: slash menu shows /loop under Tools plus skills for "/loo|Apply the design notes…"

After: Enter yields "/loop Apply the design notes…" with the prose preserved

Before (/goa → Enter on origin/main): the /goal argument picker opened over /goaApply…; Goal mode never started.

Before: /goal argument list over the draft "/goaApply the design notes…"

After: Goal mode opens with the pasted prompt as the objective.

After: Goal mode active with the pasted prompt as objective

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 9, 2026
roboclaw-bot and others added 2 commits November 9, 2026 16:58
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
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

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

  • Before: Completion consumes “Apply” and enters inline argument collection.
  • After: The draft becomes “/loop Apply the design notes” without sending.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Strong visual proof supports the useful central repair, but an introduced token-completion defect needs correction.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots exercise the built Control UI in Chromium with mocked Gateway transport, showing the changed parser and selection path offering /loop and preserving pasted text after Enter; the committed browser scenarios also cover Goal activation.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Typing a command before pasted text hides built-in completions or consumes the first word when completing.
Reason: The maintainer-authored direction repairs an evidenced editing failure using existing owners without adding a setting or capability.

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
Reviewed head: 266f24e5101513fa03762a32c83d7f46940f2a57

Before merge

  • Preserve colon-terminated tokens when completing inside a skill name (P2) - With a registered, referenceable weather skill, put the caret at Please use /wea|ther: and select /weather. The new lookup compares weather: against command identifiers, rejects it, and resets end to the caret. Selection then produces Please use $weather ther: instead of the previous Please use $weather . Recognize the trailing colon when checking whether the complete token names a command, while retaining the caret boundary for genuinely appended prose.

Findings

  • [P2] Preserve colon-terminated tokens when completing inside a skill name — ui/src/lib/chat/commands.ts:430-433

Tests

  • Missing end-to-end proof: Add a regression for selecting a registered skill while the caret is inside its colon-terminated slash token.
Agent review details

How this fits together

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

Technical review

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

  • [P2] Preserve colon-terminated tokens when completing inside a skill name — ui/src/lib/chat/commands.ts:430-433
    With a registered, referenceable weather skill, put the caret at Please use /wea|ther: and select /weather. The new lookup compares weather: against command identifiers, rejects it, and resets end to the caret. Selection then produces Please use $weather ther: instead of the previous Please use $weather . Recognize the trailing colon when checking whether the complete token names a command, while retaining the caret boundary for genuinely appended prose.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6edcaa28edb7.

Provenance checked

  • Leading versus inline token classification changes intended behavior with a stated reason (f8550bc: Enable intentional inline command actions while preserving surrounding prose and converting selected skills to references.)
  • Caret-local completion precedence keeps the original intent (30cdb92: Prevent an earlier command's argument branch from suppressing a later completion.)
  • Goal-mode activation keeps the original intent (0474704: Reuse the objective composer for Goal creation; subsequent repairs preserve literal objective text and reversible shorthand.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/lib/chat/commands.test.ts ui/src/pages/chat/chat-composer-suggestions.test.ts ui/src/pages/chat/components/chat-composer-menu.test.tsx --maxWorkers=1
  • pnpm tsgo:ui
  • Verify the new colon-token selection regression fails on 266f24e and passes after repair.
  • Verify leading /loop completion preserves the pasted first word and selecting /goal retains its objective.

What I checked:

Likely related people:

  • ooiuuii: Raw commit 30cdb92 adds ui/src/pages/chat/components/chat-composer-slash-menu-state.ts:207 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 30cdb9263f88; files: ui/src/pages/chat/components/chat-composer-slash-menu-state.ts)
  • RoboClaw: Raw commit e27b909 adds ui/src/pages/chat/components/chat-composer-goal-mode.tsx:148 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e27b909e49d3; files: ui/src/pages/chat/components/chat-composer-goal-mode.tsx)

PR surface

Source +23, Tests +187, Docs +1. Total +211 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 45 22 +23
Tests 3 189 2 +187
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 235 24 +211

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This affects command completion and draft preservation in a limited, recoverable editing workflow.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This affects command completion and draft preservation in a limited, recoverable editing workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

Reviewed November 9, 2026, 12:16 PM ET / 17:16 UTC.

roboclaw-bot and others added 3 commits November 9, 2026 17:45
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
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Nov 10, 2026
roboclaw-bot and others added 3 commits November 10, 2026 04:54
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
@roboclaw-bot
roboclaw-bot merged commit 8aa3ef4 into main Nov 10, 2026
100 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/crisp-prawn branch November 10, 2026 05:12
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant