Skip to content

perf(status): batch text report output - #128168

Merged
steipete merged 1 commit into
mainfrom
codex/perf-cli-status-current
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-cli-status-current

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plain-text openclaw status assembled its complete ordered report, then sent each line through a separate runtime logging boundary. A representative report crossed console/progress-cleanup and write handling 45 times despite already being fully materialized.

Why This Change Was Made

Emit the owner-built report once by joining its existing lines with newlines. Pre-report config, secret, verbose, and failure diagnostics remain in their original positions; JSON and status --all are unchanged.

User Impact

Operators receive the same status report bytes and line order with less final-output overhead. There is no config, protocol, persistence, privacy, or security behavior change.

Evidence

  • Exact current-main parent: bfad1bf454138d57b51106376b5d7cffd9b948f0.
  • Deterministic owner proof: 45 report entries and 947 bytes; final emission changes from 45 writes to one. Baseline and candidate streams are byte-identical, retain the final newline, and share SHA-256 2bbb1dab7923484bf8cf3507a89e21d5807d3c4602905a0d75e8cdfe8268ecc5.
  • Fresh Node 24 owner microbenchmark, 20,000 reports × 7 alternating samples: 509.682 ms median linewise versus 11.022 ms batched, 46.24× / 97.84% lower for final dispatch only (not an end-to-end status-runtime claim).
  • The same six status owner/sibling files passed before and after the repair: 6 files / 29 tests.
  • node scripts/check-changed.mjs -- src/commands/status.command.ts: passed all core/core-test typechecks, lint, format, dead-code, import-cycle, and repository guards.
  • pnpm build: passed all build phases and the Control UI startup budget.
  • git diff --check: passed.
  • Diff-scoped deslop found no cleanup issue. No call-count unit test was retained because it would couple tests to this implementation detail; existing behavior tests plus exact byte-stream proof cover the public contract.
  • Exact-head Codex Sol/high autoreview passed with no actionable findings and rated the patch correct at 0.96.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS maintainer Maintainer-authored PR labels Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for exact head 965924f686fec8e21f9b6acea3914d56c309edcf (stable patch ID 13cc32e2b4588494063a16c5ea8b75e969477e16):

  • Exact owner differential preserved the complete 45-entry / 947-byte stream and trailing newline at SHA-256 2bbb1dab7923484bf8cf3507a89e21d5807d3c4602905a0d75e8cdfe8268ecc5; runtime writes fell 45 → 1.
  • Fresh 20,000-report × 7 final-dispatch benchmark: 509.682 → 11.022 ms median (46.24×; 97.84% lower for this owner microstage only).
  • Focused current-base and exact-head suites: 6 files / 29 tests passed on each side. check-changed, full build, git diff --check, and diff-scoped deslop passed.
  • Isolated built-CLI smoke passed: exit 0, 3,940 stdout bytes / 42 lines, trailing newline present, with title/Overview/Channels/Sessions/Next steps retained.
  • Exact-head Codex Sol/high autoreview was clean (0.96 confidence, no actionable findings). Native review artifacts validate with READY FOR /prepare-pr, issue status valid, and zero findings.
  • Exact-head hosted CI run 32630842373 is green. Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run passed in hosted_exact_or_recent_parent mode and verified the remote head/tree unchanged.
  • Current origin/main is 2107d1e373c5412f1a336fe0084f62324ae0c235; intervening fix(cli): reject ClawHub-only flags for source skills #128162 does not touch src/commands/status.command.ts, and the current merge-tree is conflict-free.
  • The latest full ClawSweeper artifact is still the exact-head in-progress placeholder. It has published no correctness/security finding and no Rank-up moves: item, so there is currently no move to apply or disposition before landing.

The final owner-only +1/-3 change remains behavior-neutral and ready for native merge. No agent transcript is attached or published.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 5:27 AM ET / 09:27 UTC.

ClawSweeper review

What this changes

The PR emits the assembled plain-text openclaw status report in one runtime logging call instead of one call per report line.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No correctness finding: the report is fully assembled before the changed output boundary, and batching follows existing multiline runtime-output patterns. This maintainer-labeled PR should remain open for normal exact-head CI and maintainer handling.

Priority: P3
Reviewed head: 965924f686fec8e21f9b6acea3914d56c309edcf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative output refactor with strong stated equivalence evidence and no actionable patch defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR; its body additionally provides after-fix byte-stream equivalence evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR; its body additionally provides after-fix byte-stream equivalence evidence.
Evidence reviewed 7 items Final report owner: The command builds all report lines before the sole final runtime output call, so batching stays at the owner boundary rather than changing scan or formatting behavior.
Runtime output contract: The shared runtime clears progress state and delegates log arguments to console output; a newline-joined report remains one text output with the same visible line structure.
Sibling pattern: Channel status already renders a formatted line array through one newline-joined runtime log call, supporting this canonical output shape.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw status --help

Result: PASS (completed)

pnpm openclaw status --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128168-J1Um8z/target$ pnpm openclaw status --help
$ node scripts/run-node.mjs status --help
pnpm openclaw status --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 100.44 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.6s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 11.7s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 3512ms (slowest: built plugin control-plane loads 2613ms)
│
◇

OpenClaw 2026.8.1 (965924f) — All your chats, one OpenClaw.

Usage: openclaw status [options]

Show channel health and recent session recipients

Options:
  --agent ‹id›    Agent id for --usage auth scope
  --all           Full diagnosis (read-only, pasteable) (default: false)
  --debug         Alias for --verbose (default: false)
  --deep          Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal) (default: false)
  -h, --help      D
… output truncated …

Assertions:

  • PASS expect_output: Show channel health and recent session recipients

How this fits together

The status command collects local diagnostics, formats them into an ordered human-readable report, and sends that report through the shared runtime output interface. That interface serves terminal users and captured system-agent responses.

flowchart LR
A[Operator runs status] --> B[Status diagnostics]
B --> C[Ordered text report]
C --> D[Runtime output boundary]
D --> E[Terminal or agent response]
Loading

Before merge

  • Resolve merge risk (P1) - The local partial clone could not load the specified current-main source object offline, so a direct second local baseline inspection was limited to the supplied PR patch.
Agent review details

Security

None.

PR surface

Source -2. Total -2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 3 -2
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 3 -2

Review metrics

Metric Value Why it matters
Production versus test LOC production -2, tests 0 The performance refactor removes per-line dispatch without adding a new behavior surface or test-only seam.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the single final emission and merge after exact-head checks complete, preserving the existing report-builder and runtime-output contracts.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the single final emission and merge after exact-head checks complete, preserving the existing report-builder and runtime-output contracts.

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

Not applicable: this PR is a performance refactor, and source confirms the prior path made one runtime call per already materialized report line.

Is this the best way to solve the issue?

Yes: joining at the final report owner matches existing multiline command output and leaves diagnostics, JSON mode, and report construction unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3cb52f4bb869.

Labels

Label changes:

  • add P3: This is a small, bounded terminal-output performance improvement with no demonstrated user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR; its body additionally provides after-fix byte-stream equivalence evidence.

Label justifications:

  • P3: This is a small, bounded terminal-output performance improvement with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR; its body additionally provides after-fix byte-stream equivalence evidence.

Evidence

What I checked:

  • Final report owner: The command builds all report lines before the sole final runtime output call, so batching stays at the owner boundary rather than changing scan or formatting behavior. (src/commands/status.command.ts:384, 965924f686fe)
  • Runtime output contract: The shared runtime clears progress state and delegates log arguments to console output; a newline-joined report remains one text output with the same visible line structure. (src/runtime.ts:82, 965924f686fe)
  • Sibling pattern: Channel status already renders a formatted line array through one newline-joined runtime log call, supporting this canonical output shape. (src/commands/channels/status.ts:80, 965924f686fe)
  • Agent caller compatibility: The system-agent status operation passes the same RuntimeEnv to the command, while its capture runtime preserves embedded newlines and joins separate calls only after execution. (src/system-agent/chat-turn-router.ts:64, 965924f686fe)
  • Existing behavior coverage: Status tests assert the rendered report’s headings, diagnostic content, and verbose output without coupling to the former per-line logging implementation; report-builder tests preserve ordered blank-line section layout. (src/commands/status.test.ts:1227, 965924f686fe)
  • Feature history: Recent history identifies steipete as the author of the status-command consolidation and later diagnostics fixes, making them the strongest routing candidate for this surface. (src/commands/status.command.ts:384, 5ffd2dfbc3d6)

Likely related people:

  • steipete: Authored the recent status-command consolidation and explicit-fleet diagnostics fixes in the current file’s history. (role: recent status-command contributor; confidence: high; commits: 5ffd2dfbc3d6, d5c194f4eade; files: src/commands/status.command.ts, src/commands/status.command-report.ts)

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.

@steipete
steipete merged commit a0bf9cf into main Aug 23, 2026
237 checks passed
@steipete
steipete deleted the codex/perf-cli-status-current branch August 23, 2026 09:36

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: perf(status): batch text report output This is item 2/3 in the current shard. Shard 1/18.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

2 participants