Skip to content

fix(chat): show command instructions while pending - #140041

Merged
obviyus merged 3 commits into
mainfrom
codex/command-block-progress
Sep 6, 2026
Merged

obviyus merged 3 commits into
mainfrom
codex/command-block-progress

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #136257.

What Problem This Solves

WebChat hid a private command's instructions until completion, even when the command was waiting for the user. Combined final text could also expose internal control tokens.

Why This Change Was Made

Visible command blocks use the existing chat-delta delivery while the command is active. The shared finalizer retains terminal delivery and history ownership. Each display payload is filtered before combination, and preview state is released after completion.

User Impact

Instructions appear while commands wait. Stop suppresses late blocks; completion stays single and ordered. Agent and global-session boundaries remain intact.

Evidence

Real Gateway and browser checks reproduced the hidden instructions, then verified pending visibility, ordering, cancellation, replacement, restart history, and one final response. All 542 focused tests passed, including regressions for display filtering and preview cleanup. Before/after browser captures showed instructions during the pending command. Authentication and model responses were synthetic.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@obviyus obviyus self-assigned this Sep 6, 2026
@obviyus
obviyus marked this pull request as ready for review September 6, 2026 10:36
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 7:34 AM ET / 11:34 UTC.

ClawSweeper review

What this changes

Show WebChat command instructions while commands are pending, filter internal control tokens, and release preview state after completion.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still buffers command instructions until completion. The previous preview-retention finding is resolved, and no remaining blocking defect was found.

Priority: P2
Reviewed head: 2fe01f19099a89d046b125b4bcef63bbc984807a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with recorded production-path observations and regression coverage; the prior lifecycle blocker is fixed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records after-fix public chat.send observations on the reviewed built Gateway: command instructions arrive while execution is held, followed by ordered output and one terminal, with cancellation and isolation checks. Synthetic command inputs exercise the production delivery boundary without claiming provider authentication; linked prior-head screenshots could not be inspected here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records after-fix public chat.send observations on the reviewed built Gateway: command instructions arrive while execution is held, followed by ordered output and one terminal, with cancellation and isolation checks. Synthetic command inputs exercise the production delivery boundary without claiming provider authentication; linked prior-head screenshots could not be inspected here.
Evidence reviewed 7 items Current main still needs the fix: At the fetched main revision, block and final deliveries only append to deliveredReplies; they do not publish pending command text.
Latest release comparison: The v2026.9.2 implementation likewise captures command blocks without publishing intermediate chat events.
Previous finding addressed: The change since the previously reviewed head clears previews for non-agent and reply-dispatch completion, including error settlement, while preserving native-agent ownership. Added assertions cover error-before-retirement ordering and preserved native output; the command integration case verifies actual completion removes preview state.
Findings None None.
Security None None.

How this fits together

The Gateway receives WebChat commands and sends reply events to connected clients. This change exposes intermediate command text through the existing streaming channel while leaving final replies and transcript persistence with their current owners.

flowchart TD
  A[WebChat command] --> B[Gateway dispatch]
  B --> C[Visible command blocks]
  C --> D{Run still active}
  D -->|Yes| E[Bounded chat preview]
  E --> F[Subscribed clients]
  B --> G[Final reply and history]
  G --> H[Release preview state]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +87, Tests +167. Total +254 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 110 23 +87
Tests 4 181 14 +167
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 291 37 +254

Review metrics

Metric Value Why it matters
Production and test growth production +87 lines net; tests +167 lines net Production growth supplies pending delivery and cleanup through existing transport owners; tests cover filtering, scope, bounds, and lifecycle settlement.

Technical review

Best possible solution:

Keep pending instructions in the existing bounded chat stream, with one final reply and lifecycle-owned cleanup.

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

Yes: current main captures command blocks without broadcasting them until dispatch settles, so a command that emits instructions and waits exposes the defect. This review verified the source path without executing it.

Is this the best way to solve the issue?

Yes: reusing the existing chat delta format, scoped broadcaster, and terminal lifecycle is a focused repair that avoids a separate command-delivery system.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2b28525b5562.

Labels

Label justifications:

  • P2: This repairs delayed instructions in WebChat command execution with a bounded Gateway change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records after-fix public chat.send observations on the reviewed built Gateway: command instructions arrive while execution is held, followed by ordered output and one terminal, with cancellation and isolation checks. Synthetic command inputs exercise the production delivery boundary without claiming provider authentication; linked prior-head screenshots could not be inspected here.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records after-fix public chat.send observations on the reviewed built Gateway: command instructions arrive while execution is held, followed by ordered output and one terminal, with cancellation and isolation checks. Synthetic command inputs exercise the production delivery boundary without claiming provider authentication; linked prior-head screenshots could not be inspected here.

Evidence

What I checked:

  • Current main still needs the fix: At the fetched main revision, block and final deliveries only append to deliveredReplies; they do not publish pending command text. (src/gateway/server-methods/chat-send-reply-dispatch.ts:427, 2b28525b5562)
  • Latest release comparison: The v2026.9.2 implementation likewise captures command blocks without publishing intermediate chat events. (src/gateway/server-methods/chat-send-reply-dispatch.ts:427, 3928bad9badf)
  • Previous finding addressed: The change since the previously reviewed head clears previews for non-agent and reply-dispatch completion, including error settlement, while preserving native-agent ownership. Added assertions cover error-before-retirement ordering and preserved native output; the command integration case verifies actual completion removes preview state. (src/gateway/server-methods/chat-send-dispatch-errors.ts:289, 2fe01f19099a)
  • Delivery and lifecycle boundary: Command previews check the active abort registration, reuse session-scoped delivery, cap text, and share the existing cancellation group. The broadcaster drains that group's pending text before terminal delivery. This path changes command display, without relying on a Codex runtime or protocol contract. (src/gateway/server-methods/chat-broadcast.ts:157, 2fe01f19099a)
  • Recorded real behavior evidence: The captured PR body records a built Gateway exercised through public chat.send and subscribers at the reviewed head: instructions appear while held, ordered blocks produce one terminal, and cancellation, replacement, global isolation, and restart history pass. Screenshots are explicitly from the prior d734 candidate. Attachment retrieval failed in this reviewer environment, so their pixels were not inspected; the recorded runtime observations remain separate evidence. No tests or target code were executed during this review. (2fe01f19099a)
  • Related staging work: feat(models): direct model lists and provider login across surfaces #136257 describes the same buffered-command problem within a broader provider-login staging draft. It is open and unmerged, so it does not supersede this focused repair.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-09-06T10:43:14.580Z sha d7344ec :: blocked before merge. :: [P2] Clear command preview state when the dispatch finishes

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@obviyus
obviyus merged commit 6b33d1a into main Sep 6, 2026
189 of 191 checks passed
@obviyus
obviyus deleted the codex/command-block-progress branch September 6, 2026 11:48
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 6b33d1a44dd079cfe9be548f1abfb44b8e96eb51.

Proof: the existing command now shows instructions through public WebChat while its synthetic work remains pending. Completion produces one ordered reply. Stop suppresses late output, and replacement, normal streaming, selected-agent/global routing, reload and restart checks pass.

  • Bug: command blocks were buffered until completion, leaving users unable to see instructions needed while waiting.
  • Fix: publish command previews through the existing bounded chat transport and retire their state when dispatch settles. Keep native agent and final-reply ownership unchanged; filter standalone control tokens before display combination.
  • Validation: 542 tests passed with fresh compiled subprocess generation; all eight independent public acceptance clauses passed; exact-head ClawSweeper review passed at platinum with no findings or security concerns; CI passed without reruns or exceptions.
  • Scope: all command/model work was synthetic. No real provider authentication, credential operation, configuration, schema or protocol change. Structured reasoning has separate dispatcher coverage, not a public-fixture claim. The broader source draft feat(models): direct model lists and provider login across surfaces #136257 remains frozen and unmerged.
Before After
Instructions stayed hidden while the command waited Instructions appear before completion
Standalone control tokens could leak in the combined display Tokens are filtered before combination

Complete proof and failure history are retained. The isolated proof runtime is stopped and its resources are released.

vincentkoc pushed a commit to gaoanze888/openclaw that referenced this pull request Sep 6, 2026
* commit '3ed964c8ca6206d26ecc0b6567ccd1389d9948fc': (36 commits)
  refactor(plugins): unify install config snapshot preparation (openclaw#140081)
  fix: cloud provisioning stays failed after temporary storage recovers (openclaw#140021)
  fix(ci): preflight job outputs exceed 1 MiB on full-plan pull requests (openclaw#140018)
  refactor: consolidate command and provider helpers (openclaw#140072)
  fix(doctor): replace unavailable TUI cleanup advice (openclaw#140074)
  fix(plugins): avoid scoped pack failures and missing runtime entries (openclaw#140016)
  fix: clarify background command timeouts (openclaw#140022)
  fix(workboard): refresh board navigation while retaining drafts (openclaw#139952)
  fix: preserve newer chat drafts when rewind completes (openclaw#140066)
  feat(transcripts): browse and export saved meeting archives (openclaw#139875)
  fix(cron): complete timeout test observation phase (openclaw#140076)
  fix(macos): show the full automation count (openclaw#139692)
  fix: native worker turns fail to load WebSocket transport (openclaw#140071)
  fix(cli): complete quoted Bash option values (openclaw#140034)
  fix(chat): show command instructions while pending (openclaw#140041)
  refactor(cli): use canonical resume result schema (openclaw#140056)
  fix: restore package acceptance across install runtimes (openclaw#140062)
  refactor(auto-reply): keep model-selection fixtures in tests (openclaw#140069)
  fix(plugins): remove owned aliases before uninstalling files (openclaw#140065)
  fix: completed replies hang when context-engine cleanup stalls (openclaw#140023)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Publish existing command blocks through the current chat delta transport while their run remains active. Preserve ordered final folding, history, selected-agent routing and cancellation; retire preview state at dispatch settlement without taking native agent ownership.

Filter standalone control replies before display combination. Cover the original pending-delivery, display-filtering and preview-lifetime failures with owner regressions and real public Gateway proof.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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