Repository navigation
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 changesThis PR makes blank --agent failures print their existing remedy on stderr when sessions compact runs with --json. Example: Run openclaw sessions compact agent:main:test --agent " " --json.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR provides a focused, proven fix for a diagnostic still hidden on current main, with no actionable code findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe sessions compact CLI validates arguments before dispatching a Gateway RPC; the shared CLI failure renderer turns rejected arguments into human diagnostics and a JSON error envelope. flowchart LR
A[CLI arguments] --> B[Compact registration]
B --> C[Blank agent validation]
C --> D[Expected CLI error]
D --> E[Shared failure renderer]
E --> F[Stderr remedy and JSON stdout]
C --> G[Gateway RPC for valid input]
Technical reviewBest possible solution: Use the existing expected-error helper at the blank-agent guard and retain the consolidated CLI regression. Do we have a high-confidence way to reproduce the issue? Current-main source explains the hidden stderr remedy, and the supplied isolated CLI comparison demonstrates the exact before/after behavior; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: classify the known argument error at its producer and let the established renderer handle both output channels. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 669576890a1f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests 0. Total +1 across 2 files. Added test files: 0. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 14, 2026, 10:23 PM ET / November 15, 2026, 03:23 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Before/after proof for 2137efd against merge base 78d3696. Current main 99157f8 still has the same plain-Error guard. Host-ocx safety check: the entire PR touches only The real registration at Source tier: Every invocation exited 1. The blank-agent JSON stdout was byte-identical on both arms: {"ok":false,"error":{"type":"cli_error","message":"--agent must not be blank"}}Both valid-agent JSON controls reached the Gateway transport naturally and returned Vitest-source command: Simplification: the existing compact canonical-failure row now exercises the blank-agent guard instead of adding a second row. Credit: PR author @shuisadev; original commit author/committer SunnyShu [email protected] (@SunnyShu0925), a different human. The original commit is retained. The test consolidation commit is authored/committed by Ayaan Zaidi [email protected]. Agent: OpenAI coding worker SessionsCompactBlankC; no agent-attribution trailers. Full tier before push: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in d6a7f29. Thanks @shuisadev. |
… failures (openclaw#199386) fix(cli): show the blank --agent error for sessions compact --json `openclaw sessions compact <key> --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as the command's --max-lines and --timeout checks already do. Text mode, exit codes and valid-agent behavior are unchanged. No new text. Evidence: source tier with isolated state and no Gateway. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode, the --max-lines 0 message and a valid --agent (connection error with no Gateway) are the same on both. The e2e test fails on base (1 failed, 8 passed) and passes here (9 passed); full build and packed launcher pass. Net 0 test lines. Receipts: openclaw#199386 (comment). Thanks @shuisadev and @SunnyShu0925. Co-authored-by: SunnyShu <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
sessions compact <key> --agent " " --jsonemits the generic failure and Doctor hint on stderr instead of the existing--agent must not be blankremedy. The JSON envelope already contains the remedy; text mode already prints it.Fix
Raise the blank-agent guard through the existing
throwExpectedCliErrorowner, as the neighboring argument guards do. No message text, exit code, JSON envelope, accepted input, or Gateway RPC behavior changes. Validation still happens before any Gateway call.Reuse the existing compact failure-contract row for the regression (net zero test lines). The max-lines registration regression remains, with source CLI controls on both arms. Production +2/-1; tests +2/-2; no allocation file or helper.
Evidence
ocx test: candidate 9 passed; base 1 failed / 8 passed, specifically the missing stderr remedy. This E2E suite automatically prepares compiled subprocess artifacts. Candidate runner wall 450 s (test phase 136.51 s), base 144.72 s; hosted CI time will be recorded by its run.Original contributor commit retained. PR author: @shuisadev. Commit author: SunnyShu [email protected] (@SunnyShu0925), a different human.
Risk
Two-way door: a revert fully undoes the change. No stored state, migration, configuration, or published API changes. Blast radius is stderr rendering for this one invalid
sessions compact --agentinput in JSON mode.