Repository navigation
fix(agents): timestamp recovered Claude CLI history - #119528
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 7:58 PM ET / 23:58 UTC. ClawSweeper reviewWhat this changesThe PR carries canonical persisted transcript timestamps into fresh Claude CLI reseed prompts and adds brief guidance to verify time-sensitive recovered context. Merge readinessThe patch is a coherent owner-boundary repair, but it remains open because the submitted evidence exercises fixtures rather than an after-fix Claude CLI recovery run; its protected human-review state also requires maintainer handling. Priority: P2 Review scores
Verification
How this fits togetherWhen a Claude CLI native session cannot resume, OpenClaw's CLI runner reads its stored transcript and creates a bounded prompt for a fresh CLI turn. This change affects the recovered-history projection and prompt text, while native resume and delivery continue through their existing paths. flowchart LR
A[Stored transcript rows] --> B[CLI session recovery]
B --> C{Native session available?}
C -->|Yes| D[Native resume]
C -->|No| E[Reseed projection]
E --> F[Canonical timestamps and stale guidance]
F --> G[Fresh Claude CLI turn]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +43, Tests +73. Total +116 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add a redacted real Claude CLI recovery transcript showing a persisted timestamp and stale-context guidance in the fresh-turn prompt, then land the owner-boundary projection unchanged. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main discards the transcript-row timestamp in the reseed loader and the renderer emits only role and content; the PR's focused tests model that recovery path, though no live CLI run was performed here. Is this the best way to solve the issue? Yes for the code path: transcript rows own persistence time, so projecting that fact at reseed construction is narrower than downstream prompt reconstruction and preserves native-resume behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 723c7f9a7de4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
Punchcard-Session: brisk-meadow-river-2e
|
@clawsweeper re-review Exact head: The permissive Blacksmith proof: https://github.com/openclaw/openclaw/actions/runs/31540303454 |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Retrying the exact-head review because the first command's comment-router runs Head remains |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
@clawsweeper re-review Exact head remains |
* origin/main: (1725 commits) fix(agents): preserve reply cleanup when cancellation throws (#122252) fix(ui): render disallowed link schemes as plain text (#122311) fix(test): isolate gateway helper env stubs (#122319) fix(ui): keep chat Markdown block rhythm consistent (#122289) test(cli): trim duplicate Hooks process cases (#122278) fix(ui): retain identity while agent roster loads fix(ui): preserve configured agent labels fix(plugins): keep startup convergence read-only (#122330) fix: preserve WebChat reply context after reloads (#122169) fix(ui): make DONE moves visibly reversible (#122303) fix(ui): keep inline-code punctuation attached (#122291) fix(google-meet): publish exports atomically (#122306) fix(channels): preserve failed agent run reactions (#122009) fix(ui): label patch file operations accurately (#122287) fix(windows): preserve Unicode LAN route aliases (#122263) test(media): synchronize transcode pool completion (#122279) fix(android): keep completed subagent activity visible for sixty seconds (#122089) fix(ui): humanize bare GitHub item links (#122285) refactor(qqbot): install plugin from Tencent package (#107295) chore: scope SQLite session lifecycle CI (#121917) ...
|
@clawsweeper re-review Exact head: The signed merge refresh preserves the original ClawSweeper commit and incorporates current-main fixture/path-helper changes without altering the existing three-file PR diff. Blacksmith exact-content proof:
The PR body records the full non-promisor inspection, remaining presentation-only risk, and refreshed Punchcard receipt. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper approve Maintainer acceptance for exact head
|
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper automerge Opt exact head ClawSweeper's merge execution gate is currently closed; after the protected human-review gate is cleared, landing will proceed through the repository-native squash merge workflow. |
|
🦞🧹
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
Re-review progress:
|
|
Merged via squash.
|
* fix(agents): timestamp recovered Claude CLI history * fix(agents): reject noncanonical recovered timestamps Punchcard-Session: brisk-meadow-river-2e --------- Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes #94679 and preserves #94679 context. A fresh Claude CLI session can receive bounded OpenClaw history after its native session is invalidated, but the prior rendering dropped persisted timestamps and provided no warning that recovered context may be stale.
Why This Change Was Made
Keep the established raw-reseed allowlist, bounded tail, compaction-summary pinning, and native-resume behavior. Carry each canonical transcript row timestamp into reseed projection, render only canonical UTC ISO values whose normalized form round-trips exactly, omit invalid, missing, numeric, and noncanonical values, and reserve prompt budget for concise guidance to verify time-sensitive/current facts.
The canonical check specifically rejects permissive
Date.parsecoercions such as"0"and"2026"without changing the separate permissive timestamp contract inpackages/agent-core.User Impact
Recovered Claude CLI sessions can distinguish older history from the current turn and are explicitly prompted to verify current facts before acting. Invalid timestamp values never produce false normalized dates, and their associated messages remain present.
Evidence
Exact head:
f564c9782644d1ba94834a171984da5ddcc29869Blacksmith Testbox:
tbx_01kzsh81fngnk15n52hkw6m3th: https://github.com/openclaw/openclaw/actions/runs/31545190303session-history.test.ts+prepare.test.ts: 132 passedtbx_01kzshxepbzwy311ycwwh6d0ye: https://github.com/openclaw/openclaw/actions/runs/31545964338git diff --check, formatting, focused oxlint, and explicit-pathcheck:changed: passedThe exact head was inspected and validated from a full, non-promisor clone. A signed merge refresh incorporates current-main fixture and path-helper refactors while preserving the original ClawSweeper commit and the existing three-file PR diff. The focused preparation tests exercise the production recovery boundary and inspect the actual prompt supplied to the Claude CLI runner for both fresh-reseed and native-resume decisions; no live provider credentials are required or exposed.
The production growth implements the owner-boundary capability: bounded recovered-history projection, canonical timestamp rendering, guidance, and native-resume preservation. Remaining risk is limited to presentation wording in recovered context; native resume, transcript selection, and message payloads retain their existing paths.
Punchcard
Punchcard-Session: brisk-meadow-river-2e
pc1.cHVuY2hjYXJkLXNlcnZlci1yZWNlaXB0LXYxAGF0dF8wMUtaU0pQRFdYWFQ1Ujg5OVNZTVIzVE5CMwB0bnRfMDFKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAdXNyXzAxSjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxAGRldl8zODZGRjVCMzQxQTI2NzQzQjJDREEzMEY0RAB3cmtfMDFLWlM5VDZGQk0yRkoxQzZIUUg5WkdKVzMAc2VzXzAxS1pTOVQ4R0FXWDNRM0ZaUDBQREVGNkVBAGJyaXNrLW1lYWRvdy1yaXZlci0yZQBvcGVuY2xhdy9vcGVuY2xhdwAAMTE5NTI4AGZmZGM5ZTVkMTFjOTczYjI1MWY1ZmVkMmI5ODEwY2QzMWRjN2ZiOTQyZjU4NDA4YmY3MDhkMjE3OWZiNjdhZDcAc2lnbmluZy12MQBSMEZKc19idGp2dW5WZ1RrcDVhQnN4RlNueTJvUm9NOUdBRW9wb05wYUN5NHRWT1F1MWNCSW1lQkhWZndPUXdZWjBDX0hIdGQxek9qSVBRaG55NFNCZwAyMDI2LTA4LTExVDIzOjMyOjAzLjYxM1oA.cBwNrNkiTozdQP2Qw-fOGyWajHWGeEKqfnfE3fJikBF57ZSzRIJJP9PNSkHE8SJw5CKh859GvoLaTm0cRfFyAA