Repository navigation
fix(cli): return JSON for sessions list failures - #128316
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 23, 2026, 3:29 PM ET / 19:29 UTC. ClawSweeper reviewWhat this changesThe PR changes invalid sessions-list Merge readinessKeep this maintainer PR open: its canonical error rendering is correct, but validation still occurs after explicit session-store resolution, so an invalid filter combined with a bad Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe sessions CLI validates list filters, selects a session database, then emits session rows or an error. The root CLI renderer converts thrown expected errors into human diagnostics or a JSON flowchart LR
A[CLI arguments] --> B[Sessions list command]
B --> C[Session store selection]
C --> D[Filter validation]
D --> E[Session listing]
D --> F[Root failure renderer]
F --> G[Human or JSON error output]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +44. Total +43 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Parse both list filters before resolving any session-store target, preserve active-before-limit precedence, and add an explicit-invalid-store regression case for routed and Commander JSON execution. Do we have a high-confidence way to reproduce the issue? Yes—source reproducibly shows Is this the best way to solve the issue? No—the shared error type is the right output path, but it must be reached before session-store selection for the stated validation-before-store invariant to hold. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b3b33d24195d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Land-ready review complete. The sessions-list owner now throws canonical expected CLI errors for invalid Proof:
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where
openclaw sessions --jsonandsessions list --jsonreturned exit code 1 with empty stdout for invalid--activeor--limitvalues. Automation then encountered an unrelated JSON parse error instead of the actionable session-filter validation message.Why This Change Was Made
The sessions-list command owner now throws canonical expected CLI errors instead of writing stderr and exiting directly. Both route-first bare sessions execution and Commander/list-alias execution therefore use the existing root renderer. Validation remains before session-store reads and preserves active-before-limit precedence.
Production delta: +5/-6, net -1 line. Tests: +105/-61, net +44 lines.
AI-assisted: yes. The route and owner boundaries, validation precedence, no-store-read invariant, human and machine output, and tests were reviewed and understood.
User Impact
Sessions-list JSON consumers now receive one canonical
cli_errordocument for invalid active and limit filters. Human diagnostics, positive filters,--limit all, session selection, and successful list output remain unchanged.Evidence
fb5d2db018101a2e3c1c474258c5f96482d856bc: green.cli_errorassertion. Its only rank-up was refreshed exact-head merge/check state, now satisfied. A duplicate unchanged-head review started afterward and does not block landing.git diff --check: passed.