Repository navigation
feat(cli): show progress while tool input is generated - #167789
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThe PR emits bounded line-count progress while Claude CLI generates file-mutation tool arguments. Example: Claude CLI generates a 300-line Write.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a verified CLI progress gap with sufficient runtime proof and no actionable patch findings; the previously reported conflict is resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI JSONL output enters the shared streaming parser, which counts partial file-mutation arguments and publishes progress through the existing agent-event bus to Gateway clients and reconnect snapshots. flowchart LR
A[Claude CLI stream] --> B[CLI JSONL parser]
B --> C[Shared bounded diff counter]
C --> D[CLI event handler]
D --> E[Agent event bus]
E --> F[Gateway clients]
E --> G[Reconnect snapshot]
Technical reviewBest possible solution: Land the focused CLI adapter while retaining the shared counter, complete-argument execution boundary, and existing recipient routing. Do we have a high-confidence way to reproduce the issue? Yes: current-main source drops input progress, the linked report reproduces it on official releases, and supplied Gateway comparisons record the missing pre-execution events; this review ran no target code. Is this the best way to solve the issue? This is a focused solution at the shared CLI parser boundary that reuses established counting and event contracts without advancing execution or exposing arguments. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db6449d3f609. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +75, Tests +275, Docs +6. Total +356 across 10 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (4 earlier review cycles)
Reviewed October 10, 2026, 5:32 AM ET / 09:32 UTC (Revision 5). |
|
Maintainer verification for #167742, final head I preserved @ZengWen-DT's implementation and commits. The only follow-up is a merge of current main ( Built Gateway with a deterministic CLI input stream (client advertises
Each run streamed 225 native input fragments. The differing wall times reflect scheduling, not a speed claim. The fix emits progress during argument generation without moving execution start earlier, leaking file contents, or duplicating starts/results. Complete-argument preservation is also covered by the parser regressions. Real Claude Code 2.1.296, final head: a native Write created a real 300-line file and returned final Final-head checks: 123 tests passed across the CLI parser, shared live-diff counter, CLI event forwarding, Gateway snapshot, Control UI tool-stream, and Telegram progress-card suites. All proof Gateway/CLI processes stopped. Each native run used task-owned paths; Related behavior checked: Hosted final-head outcome: ClawSweeper is |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override: the only red job is checks-ui-e2e (1/2): the two session-dashboard pin cases fail because |
|
Landed in be3bedc. Thanks @ZengWen-DT for the fix and @umeranjum17 for the report: claude-cli turns now show progress while long tool inputs are written. |
claude-cli turns went silent while a tool call's input was generated, because CLI input_json_delta fragments were buffered until content_block_stop with no agent events in between (35-55 s of silence for a long Write on Claude Code 2.1.296). The CLI parser now emits the existing counts-only input_delta tool progress (shared with embedded runs) while input streams, without claiming execution started; tool start and result are unchanged. Fixes openclaw#167742. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #167742
Follow-up to #121528.
What Problem This Solves
Adds the missing CLI tool-input progress capability so chats no longer appear idle while Claude CLI generates a long Write or Edit input.
User Impact
Clients receive bounded, counts-only live edit progress before execution begins, including through the existing in-flight chat snapshot after observer reconnect. Complete tool arguments and execution-start timing are preserved; no configuration changes are required.
Why This Change Was Made
The embedded live-diff feature explicitly left CLI coverage for a follow-up. This adapts CLI input chunks to the same counter owner and existing
tool/input_deltaevent contract, retaining its 250 ms throttle, 1 MiB parsing limit, and 64-call bound. Cumulative JSON is joined lazily after admission. Progress state is cleared at completed starts, index reuse, and stream finish.Evidence
Candidate
ca6309daeb720d45adf192d2e2798ed399be293d, tested on base3223e13a514c6134e10ee7f585627434d245fd20, candidate treefe9794c12b7f1e07d963631d25e10c4af6888b9e(Node 24.19.0, frozen pnpm 12.7.0).chat.senddelivered counts-only progress while the input stream was held before block stop; a separate observer reconnected and recovered the same progress fromchat.history. Before release there was no execution start; afterward there was exactly one start with complete arguments, successfulagent.wait, and a final chat response. The command exited 0 in 124.573 seconds and joined its owned process tree.--concurrency 1and the normal admission/ownership guards preserved (85.156 seconds).Current-main composition: the patch applies cleanly to actual main
10b767dc090cf5057c2cd13b0d8d51f519f6feb5; all ten changed files remain unchanged there. The newer callable session-authority and history guards retain the progress boundary. This is source-composition verification, not a runtime rerun on that newer main.Validation limits: the full changed-check aggregate stopped at core typechecking (exit 137); a separate core attempt and the additional Gateway-server type graph also exited 137 without TypeScript diagnostics. The exact cause was not established. Full build reached declaration publishing but failed with
oneshot canceled; ordinary runtime-only parallel compilation was killed before the explicit serial runtime build passed. Locally, the full repository typecheck, full declaration/UI build, and full tests did not complete successfully. The live proof uses a local CLI stand-in, not an authenticated provider, real file mutation, or browser rendering. The PR was opened as a draft and marked ready after the exact-head review found no actionable defects and accepted the boundary proof. The normal ready-for-review CI run subsequently passed on this unchanged head: 39 jobs succeeded and 27 were intentionally skipped. Hosted production/test type checks, lint, and changed test shards passed; the build-artifacts job was intentionally skipped. CodeQL, critical-quality, OpenGrep, and the combined CI/security/dependency gate also passed. This is the repository-selected PR workflow, not a claim that every repository test ran. The local failure receipts above remain unchanged.Maintainer verification on final head
8dc3758edbaee163e1562b62c1be18a6937c85f1, after merging main and preserving both parser finalization paths: built-Gateway comparison, real Claude Code 2.1.296 long Write (199 input-progress events before execution), 123 focused consumer tests, successful core typecheck, and runtime builds. The earlier validation limits above describe the contributor's original run; this final-head check includes authenticated native CLI execution and real file mutation.Pash/Sarah overlap: checked a2bbcbf; its complete-preamble boundary and quiet-channel behavior are unchanged.