Repository navigation
fix(cli): keep sessions tail responsive in large stores - #139730
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. Reviewed September 6, 2026, 2:58 AM ET / 06:58 UTC. ClawSweeper reviewWhat this changesSession progress tailing uses existing lightweight metadata readers to avoid decoding unrelated saved prompts while preserving session selection and output. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and addresses the linked issue without duplicating the adjacent merged fixes. No blocking correctness or security findings remain, and the supplied CLI observations adequately demonstrate reduced decoding work. Priority: P2 Review scores
Verification
How this fits togetherThe sessions tail CLI selects stored conversations, reads their recorded runtime events, and prints progress. Session metadata determines which conversations are selected; follow mode then watches their SQLite trajectory rows. flowchart TD
A[CLI options] --> B[Resolve agent stores]
B --> C[Read lightweight session metadata]
C --> D[Select explicit, running, or latest sessions]
E[Runtime activity metadata] --> D
D --> F[Read recorded trajectory events]
F --> G[Print and follow progress]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +9, Tests +89. Total +98 across 2 files. 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. Technical reviewBest possible solution: Keep tail selection on the existing metadata-only path while preserving full readers, runtime generation checks, and trajectory-follow behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current main selects sessions through full-store reads, and the supplied real-store CLI comparison demonstrates unrelated prompt decoding; this review verified the source path without executing it. Is this the best way to solve the issue? Yes. Reusing the existing projection and entry-aware runtime reader is a narrow repair that avoids new queries, caches, schemas, or selection policies. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a089d4e11aaf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use the existing metadata projection when selecting sessions to tail. Preserve selection and trajectory rendering while excluding unrelated saved prompt payloads. Extend the regression to cover both saved fields and selected output.
Use the existing ACP metadata reader with the selected session generation and existing owner resolution. Avoid a second full session read during running/latest selection, and cover explicit, running, latest, and ACP-driven selection with unrelated saved prompts.
1411d0a to
05caa5e
Compare
|
Thanks @ly85206559! Merged as c11192a, with your contribution preserved. Bug: tail selection decoded saved prompts from unrelated sessions; automatic selection also reread session entries during runtime activity checks. Fix: reuse the existing metadata projection and selected session identity, retaining owner and session-generation checks. Proof: built CLI against synthetic SQLite stores, 90 focused tests, independent behavior acceptance, and a clean exact-head local review. Exact-head CI passed; no CI exception was used.
Output, selection order, malformed-row errors, stale runtime bindings, full readers, and read-only state are preserved. Eight follow probes emit each appended event once. All ten observable acceptance clauses pass. The 31-pair timing comparison has only a 3.416 ms lower CPU median at 500 rows, so it does not establish a reliable speedup or general memory reduction. Internal SQLite allocation was not measured. |
Use the existing session metadata projection and reuse the selected session identity for agent-runtime activity checks. Avoid unrelated saved-prompt decoding in explicit and running/latest tail selection while preserving trajectory output and session-generation validation. Closes openclaw#139671. Preserve the original contribution by @ly85206559 and expand regression coverage across all selection modes. Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Closes #139671
What Problem This Solves
Fixes an issue where operators tailing a session decoded saved prompts from unrelated sessions before seeing progress. Automatic running/latest selection also reread session entries while checking agent-runtime activity.
Why This Change Was Made
Use the existing session metadata projection, then pass the selected entry to the existing agent-runtime metadata reader. Keep its owner resolution and session-generation checks. Full readers still return complete saved prompts. This adds no query, cache, schema, or selection policy.
User Impact
Explicit and automatic tailing avoid unrelated saved-prompt decoding while preserving selected sessions, output, read-only access, and follow behavior.
Evidence
e19a7694cef6d38140033f798215103dd638fafb: explicit-key unrelated parses fall from 100 to 0 at 100 rows and 500 to 0 at 500 rows. Latest selection falls from 200 to 0 at 100 rows. Selected output is byte-for-byte unchanged.Thirty-one alternating measured pairs per store size, after two warmups per build, on the same isolated Linux/Node 24.20.0 runtime. Timing uses no JSON parse spy.
The 500-row CPU median is 3.416 ms lower (0.17%). This is too small to establish a reliable speedup; neither general latency nor memory reduction is claimed. The measured work reduction is elimination of unrelated prompt decoding.
Original contribution by @ly85206559, with expanded repair, regression coverage, and CLI proof.