Skip to content

fix(sessions): cache warm transcript reads to avoid per-turn re-parse#90412

Merged
steipete merged 12 commits into
openclaw:mainfrom
Alix-007:alix/fix-83943
Jun 15, 2026
Merged

fix(sessions): cache warm transcript reads to avoid per-turn re-parse#90412
steipete merged 12 commits into
openclaw:mainfrom
Alix-007:alix/fix-83943

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #83943.

The session resource loader re-parsed the entire transcript on every warm turn. loadEntriesFromFile ran readFileSync + line-by-line JSON.parse over the whole JSONL each time SessionManager.open was called, so the per-warm-turn cost grew O(n) with transcript length. The reporter measured the session-resource-loader stage climbing from ~14.5s → 31.5s → 42.3s across consecutive warm turns of a single session, eventually tripping a WebSocket timeout.

What changed

src/agents/sessions/session-manager.ts — add a bounded (max 8) snapshot-keyed cache for loadEntriesFromFile. The cache key is a high-resolution file snapshot (dev/ino/size + nanosecond mtime/ctime via statSync({ bigint: true })); a warm open whose snapshot still matches returns the cached entries without re-reading or re-parsing the file. Only current-version (v3) transcripts are cached — older versions still go through migration with fresh mutable entries, so cache hits never share objects that migrate. Cached entries are deep-frozen and handed out as a shallow array copy (.slice()), so callers cannot mutate the cached prefix and manager appends land on a separate array, while avoiding a per-open deep clone. Appends update the cache incrementally; the cache invalidates when the file snapshot changes (external replace / another writer). Adds syncSnapshotAfterHeaderRewrite() so an out-of-band transcript rewrite can refresh the manager snapshot/cache (see follow-up below).

src/agents/embedded-agent-runner/session-manager-init.ts — after prepareSessionManagerForRun rewrites the on-disk header (the recovered-header and normalization branches), call syncSnapshotAfterHeaderRewrite() so the manager's snapshot/cache match the rewritten file before the first append.

src/agents/sessions/session-manager.test.ts — 9 tests: warm reuse without re-parse, append without stale readback, cache invalidation on external file replacement, invalidation when another writer appends before this manager persists, old-version transcripts still migrating while bypassing the cache, embedded header normalization without re-parse, and (new) keeping the warm cache across an embedded prepare-plus-append so the next warm open does not reparse.

Real behavior proof

Behavior addressed: loadEntriesFromFile no longer re-parses the whole transcript on every warm SessionManager.open. Warm opens of an unchanged current-version session reuse cached entries, eliminating the per-warm-turn O(n) re-parse cost, while session correctness (no stale or shared-mutation, cache invalidation on external change) is preserved.

Real environment tested: Local worktree of origin/main at base ca9249e357291890125a5a801a5681defbc816ff with this patch applied, Node v22.22.0. Drove the real exported loadEntriesFromFile via node --import tsx — the actual production loader, no mocks. JSON.parse call count measured by wrapping the global parse around the loop.

Exact steps or command run after this patch:

# Real production loader, 4000-entry transcript, 12 warm opens:
node --import tsx ./proof-83943.mts
# Baseline measured by git-stashing this patch and re-running the same harness.

# Regression suite:
node scripts/run-vitest.mjs run src/agents/sessions/session-manager.test.ts

Evidence after fix: Real output driving the production loadEntriesFromFile over a 4000-entry transcript, 12 warm opens:

# AFTER (this patch):
transcript entries = 4000 (+1 session header), warm opens = 12
entries returned per open = 4001 (correctness: stable across opens)
JSON.parse calls = 4001
wall time = 45.0ms

# BASELINE (origin/main, this patch stashed):
JSON.parse calls = 48012
wall time = 198.0ms

Observed result after fix: JSON.parse calls drop from 48012 (12 × full re-parse) to 4001 (one initial parse; the 11 warm hits do zero parsing) — a 91.7% reduction — and wall time drops from 198.0ms to 45.0ms (~4.4× faster). Every open still returns all 4001 entries, so correctness is preserved.

What was not tested: No live end-to-end Windows + Feishu + MiniMax reproduction of the original ~42s stall (that environment is unavailable); the change is in the deterministic transcript loader, exercised directly with the real exported function and disk readback. This PR addresses only the per-warm-turn transcript-growth subpath, not the constant reload() baseline cost discussed in #82536.

Follow-up: embedded prepare-plus-append cache gap (code-review finding)

Code review found that the embedded runner's prepareSessionManagerForRun rewrites the transcript header after SessionManager.open, leaving the cached sessionFileSnapshot describing the pre-rewrite file. The first append then took the snapshot-mismatch branch in rememberAppendedSessionEntry, dropped the cache, and the next warm embedded turn reparsed the whole transcript — so the warm cache did not survive the embedded path.

Fix: the header rewrite now calls syncSnapshotAfterHeaderRewrite(), which refreshes the snapshot and cache from the rewritten file, so the first append stays on the incremental cache path.

Proof (real SessionManager + real on-disk transcript, JSON.parse readback): new regression keeps the warm cache after prepareSessionManagerForRun rewrites then appends drives the real SessionManager.openprepareSessionManagerForRun (real header rewrite to disk) → appendMessage (real append to disk) → another warm SessionManager.open, counting global JSON.parse:

# WITH FIX:
node scripts/run-vitest.mjs src/agents/sessions/session-manager.test.ts
Tests  9 passed (9)
# the new test asserts JSON.parse calls == 0 on the warm open after prepare+append

# NEGATIVE CONTROL (git-stash the session-manager-init.ts sync calls):
Tests  1 failed | 8 passed (9)
# the new test fails: the post-rewrite append drops the cache, so the next warm open reparses (JSON.parse > 0)

Validation (supplemental)

  • node scripts/run-vitest.mjs run src/agents/sessions/session-manager.test.tsTests 9 passed (9)
  • negative control (stash the embedded sync calls) → the new embedded-cache test fails, the other 8 pass — proves the fix is required and the test is not a tautology
  • tsgo:core / tsgo:core:test → no new errors in changed files; oxfmt → clean

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 1:18 PM ET / 17:18 UTC.

Summary
The PR adds bounded snapshot-keyed SessionManager and repair caches, lock-owned snapshot publication, newline-safe canonical JSONL appends, and focused regression coverage for warm session transcript reads.

PR surface: Source +936, Tests +1321. Total +2257 across 13 files.

Reproducibility: yes. from source and supplied proof, though not from the original Windows Feishu MiniMax environment. Current main opens a session by reading and parsing the JSONL transcript each time, and the PR proof exercises the real session transcript lifecycle with large warm transcripts.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/agents/embedded-agent-runner/run/attempt.ts, migration/backfill/repair: src/agents/embedded-agent-runner/session-manager-init.ts, migration/backfill/repair: src/agents/session-file-repair.test.ts, migration/backfill/repair: src/agents/sessions/session-manager.test.ts, migration/backfill/repair: src/agents/sessions/session-manager.ts, persistent cache schema: src/agents/sessions/session-manager.test.ts, and 16 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Merging changes SDK-visible SessionManager warm-hit behavior: cached non-header entries are frozen/shared, while tests preserve a mutable exported loader and cloned mutable session headers.
  • [P1] The cache contract depends on exact file fingerprints and lock-owned snapshot publication; the PR has focused coverage and maintainer proof, but this remains a session-state compatibility decision for maintainers.
  • [P1] This addresses the transcript-growth subpath from the linked bug; the separate constant resourceLoader.reload() baseline remains tracked by perf: skip packageManager.resolve() by loading extensionFactories directly #82536.

Maintainer options:

  1. Land With Session Owner Acceptance (recommended)
    If maintainers accept the frozen-entry and fingerprinted cache contract, merge after the required checks finish on head e447302 because the current proof covers the changed transcript lifecycle.
  2. Pause For Additional Session API Review
    If maintainers are not comfortable with SDK-visible SessionManager mutability changes, pause for a session/API owner decision rather than asking automation for speculative code churn.

Next step before merge

  • No narrow automated repair is indicated; maintainers need to finish the merge decision after accepting the session-state compatibility risk and required checks.

Security
Cleared: No concrete security or supply-chain concern found; the diff stays in session transcript runtime/tests and does not change workflows, dependencies, permissions, or secret handling.

Review details

Best possible solution:

Land this cache-backed transcript fix after required checks complete and maintainers accept the session cache ownership contract, while keeping the separate resource-loader baseline work tracked independently.

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

Yes from source and supplied proof, though not from the original Windows Feishu MiniMax environment. Current main opens a session by reading and parsing the JSONL transcript each time, and the PR proof exercises the real session transcript lifecycle with large warm transcripts.

Is this the best way to solve the issue?

Yes, likely the best current fix shape. Caching inside SessionManager plus lock-scoped snapshot publication targets the implicated hot path; a broader exported-loader cache would be riskier, and the PR keeps the exported file loader mutable and separate.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 40f1190c8be1.

Label changes

Label justifications:

  • P1: The linked bug report describes warm-turn session-resource-loader stalls that can make real agent runs unusable.
  • merge-risk: 🚨 compatibility: The PR changes exported agent-session runtime behavior and helper return contracts around transcript entry mutability and cache reuse.
  • merge-risk: 🚨 session-state: The PR changes how persisted session transcript entries, repair results, and file snapshots are cached and trusted across embedded turns.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body and maintainer comment provide after-fix terminal output, a negative-control regression, and linked Crabbox Linux/production-shaped session transcript runs for head e447302.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and maintainer comment provide after-fix terminal output, a negative-control regression, and linked Crabbox Linux/production-shaped session transcript runs for head e447302.
Evidence reviewed

PR surface:

Source +936, Tests +1321. Total +2257 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 9 1092 156 +936
Tests 4 1324 3 +1321
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 2416 159 +2257

What I checked:

  • Current-main behavior: Current main calls loadEntriesFromFile from SessionManager.setSessionFile, and loadEntriesFromFile does a synchronous file read plus JSONL parse each time, matching the reported warm-open reparse path. (src/agents/sessions/session-manager.ts:391, 40f1190c8be1)
  • PR cache implementation: PR head adds loadEntriesFromFileWithSnapshot, validates before/after stat snapshots, returns cached entries on unchanged snapshots, and bounds cached transcript files/bytes. (src/agents/sessions/session-manager.ts:407, e4473025adb3)
  • Session-state guardrails: Cache advancement is allowed only for owned appends whose previous snapshot matches, and the lock controller only authorizes advancement/publication while the exact trusted write lock is active. (src/agents/sessions/session-manager.ts:610, e4473025adb3)
  • Embedded path integration: runEmbeddedAttempt now wraps context-engine bootstrap and session preparation in the owned transcript write context, and repair publishes only validated snapshots before warm SessionManager.open. (src/agents/embedded-agent-runner/run/attempt.ts:2074, e4473025adb3)
  • Regression coverage: PR tests cover zero-parse warm opens after owned appends, cache survival after embedded header rewrite plus append, incremental repair from trusted snapshots, and lock-scoped cache publication. (src/agents/sessions/session-manager.test.ts:172, e4473025adb3)
  • Real behavior proof: A maintainer pass on head e447302 reports clean autoreview, a Crabbox Linux gate, and a production-shaped 4,000-entry/12-turn scenario ending with PR90412_E2E_PASS. (e4473025adb3)

Likely related people:

  • steipete: Live history shows repeated recent work on session repair/session-lock files, and the latest PR head contains a land-ready maintainer pass plus several session-cache follow-up commits authored by this person. (role: recent area contributor and current PR maintainer pass; confidence: high; commits: 5181a9339140, 20577f0b3b21, 7ca77124fea0; files: src/agents/session-file-repair.ts, src/agents/embedded-agent-runner/run/attempt.session-lock.ts, src/agents/sessions/session-manager.ts)
  • Ben Badejo: Local blame attributes the current main SessionManager, repair, and embedded-run session scaffolding in this checkout to the grafted commit that imported the OpenClaw agent runtime paths. (role: current-main implementation introducer; confidence: medium; commits: 3fc850fe86; files: src/agents/sessions/session-manager.ts, src/agents/session-file-repair.ts, src/agents/embedded-agent-runner/run/attempt.ts)
  • lzyyzznl: Recent live history for attempt.session-lock.ts includes a session file fingerprint/fence fix, directly adjacent to this PR's trusted snapshot and cache-publication logic. (role: recent session-lock contributor; confidence: medium; commits: 1e878dde7c3c; files: src/agents/embedded-agent-runner/run/attempt.session-lock.ts)
  • yetval: Recent live history for session-manager.ts includes a focused session migration correctness fix on the same persisted transcript loading surface. (role: recent session-manager contributor; confidence: medium; commits: 4b4211e6c783; files: src/agents/sessions/session-manager.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 4, 2026
@byungskers

Copy link
Copy Markdown

The snapshot-keyed warm cache looks solid, especially with the frozen-entry guardrails. One thing I wanted to ask about is the choice to key entirely off dev/ino/size + mtimeNs/ctimeNs: on the common filesystems this is probably plenty, but do we have any environments in the project where ctimeNs/mtimeNs granularity or inode behavior is weird enough that an external rewrite could slip through without invalidating? If not, totally fine — I just think this PR is performance-sensitive enough that a short note in the code or PR about why this snapshot is considered sufficient would help future maintainers.

@Alix-007

Alix-007 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added size: L and removed size: M proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@byungskers Good question — the snapshot comes from statSync(..., { bigint: true }), so mtimeNs/ctimeNs carry nanosecond precision where the filesystem provides it. For the rewrite scenarios: a replace-via-rename changes ino, and an in-place rewrite changes size or bumps ctimeNsctime is kernel-managed and can't be back-dated from userland, so even an mtime-spoofed rewrite still invalidates. The remaining theoretical window is a same-size in-place write on a filesystem with coarse timestamp granularity, within the same tick, keeping the same inode — but these transcripts are append-only JSONL managed by the gateway, so any real append changes size and invalidates on the next read. Happy to fold this rationale into a short code comment if you'd like it inline.

@sallyom sorry for the direct ping — this one is in the sessions area, close to the lifecycle work you've been touching recently. It fixes #83943: the session resource loader re-parsed the whole JSONL transcript on every warm turn, so per-turn cost grew O(n) with transcript length (the reporter measured the loader stage climbing 14.5s → 42.3s). The fix adds a snapshot-keyed warm cache (capped at 8 files) without changing transcript semantics, scoped to the session resource loader + regression tests. ClawSweeper rated it 🐚 platinum / proof: sufficient, and the PR is clean and green on the current head. Does the approach look right to you?

@Alix-007

Copy link
Copy Markdown
Contributor Author

@byungskers good question — agreed it's worth being explicit for a perf-sensitive path. The snapshot is the 5-tuple dev + ino + size + mtimeNs + ctimeNs, all read at nanosecond bigint precision (statSync(path, { bigint: true })), and isSameSessionFileSnapshot requires all five to match for a warm hit.

Why an external rewrite can't slip through:

  • Append / truncate changes size.
  • Atomic replace (rename into place) changes ino (fresh inode), often dev too.
  • In-place rewrite changes mtimeNs.
  • The real safety net is ctimeNs: ctime is bumped by the kernel on any inode metadata/content change and cannot be forged from userspace (utimensat can backdate atime/mtime but never ctime). So even a touch -r-style mtime-preserving rewrite that somehow kept identical byte length still flips ctimeNs → cache invalidated.

To actually slip through you'd need inode reuse and identical dev+size+mtimeNs+ctimeNs at the same instant — a nanosecond timestamp collision plus immediate inode reuse plus byte-identical length, which isn't reachable for an append-only transcript.

There's also a second guard for the concurrent-writer case: beforeAppendSnapshot re-stats right before persisting and invalidates if another writer touched the file first — covered by invalidates the warm cache when another writer appends before this manager persists, alongside invalidates the transcript entry cache when the file is externally replaced.

Happy to condense this into an inline comment next to SessionFileSnapshot if you'd prefer it in-code.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 15, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@vincentkoc flagging this since you've been through the agents/session paths today. It's ready (platinum, proof: sufficient) and narrow: the warm session-transcript cache is silently dropped on the embedded prepare-plus-append path — prepareSessionManagerForRun rewrites the transcript header after SessionManager.open, so the cached snapshot goes stale, the first append takes the mismatch branch and drops the cache, and the next embedded turn reparses the whole JSONL. The fix syncs the snapshot/cache right after the header rewrite; includes a regression test with a negative control (revert → the warm open reparses). Happy to reshape if you'd prefer something narrower.

@steipete steipete self-assigned this Jun 15, 2026
Alix-007 and others added 12 commits June 15, 2026 12:59
loadEntriesFromFile re-read and re-parsed the entire transcript JSONL on
every warm SessionManager.open, so the per-warm-turn cost grew O(n) with
transcript length (openclaw#83943). Add a bounded (max 8) snapshot-keyed cache:
warm opens whose file snapshot still matches reuse frozen, append-only
entries via a shallow array copy instead of re-reading and re-parsing.
Only current-version transcripts are cached; the cache invalidates on
external file changes (replace / another writer).
…warm cache

The warm transcript cache deep-freezes entries; returning the shared frozen
header made prepareSessionManagerForRun throw when it normalizes header id/cwd
on existing-session embedded runs. Clone only the session header (entries[0])
on the read path so callers get a mutable header while message entries stay
shared+frozen and the cache keeps its re-parse savings.
prepareSessionManagerForRun rewrites the transcript header out-of-band after open, leaving the cached sessionFileSnapshot stale; the first append then dropped the warm cache and the next embedded turn reparsed the whole transcript. Add SessionManager.syncSnapshotAfterHeaderRewrite() and call it after the recovered-header and normalization rewrites, plus a regression covering prepare+append+warm-open.
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer pass complete.

What changed:

  • Reworked transcript repair to advance from a validated warm snapshot instead of reparsing the full history each turn.
  • Kept cache publication behind active lock ownership and exact file fingerprint checks.
  • Published exact verified snapshots for compound SessionManager writes and invalidated/resynced after header rewrites.
  • Preserved canonical JSONL bytes, including safe appends to unterminated files and serialization before file inspection.
  • Added regression coverage for repair, lock/fence ownership, compound writes, rewrite publication, newline handling, and side-effecting serialization.

Verification on exact head e4473025ad:

Known proof gaps: none for the changed session transcript lifecycle.

@steipete

Copy link
Copy Markdown
Contributor

Final CI follow-up:

  • Exact PR head verified: e4473025adb3bb037f71e21699b8acc1d39185a9.
  • Crabbox run_c69572756d81: full build, format, lint, 257 focused tests, test types, and import-cycle checks passed.
  • Crabbox run_d2b89b1954ed: production-shaped 4,000-entry transcript E2E passed across 12 lock release/reacquire turns, ending with 4,048 validated entries.
  • Fresh branch autoreview completed with no accepted or actionable findings.
  • The GitHub-hosted fallback CI passed every job except two unrelated existing tests outside this PR's changed surface. Both failures were 120-second runner-pressure timeouts and both tests pass independently on this exact checkout:
    • src/commands/agent.test.ts target: 1 passed in 13.85s.
    • src/auto-reply/reply/dispatch-from-config.test.ts target: 1 passed in 26.13s.
  • Native Blacksmith PR CI, CodeQL, and OpenGrep reruns remain queued without runner adoption after the June 15 Actions incident.

No known proof gap remains in the session transcript cache or lock-ownership surface changed by this PR.

@steipete
steipete merged commit a0b16f3 into openclaw:main Jun 15, 2026
36 of 77 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 16, 2026
Avoid repeated full JSONL parsing and cloning on every embedded-agent turn by keeping a bounded, validated transcript cache and advancing repair incrementally.

The final implementation preserves lock ownership and exact fingerprint validation, publishes only verified writes, handles header rewrites and unterminated JSONL safely, and adds focused regression coverage.

Fixes openclaw#83943.

Co-authored-by: Alix-007 <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
Avoid repeated full JSONL parsing and cloning on every embedded-agent turn by keeping a bounded, validated transcript cache and advancing repair incrementally.

The final implementation preserves lock ownership and exact fingerprint validation, publishes only verified writes, handles header rewrites and unterminated JSONL safely, and adds focused regression coverage.

Fixes openclaw#83943.

Co-authored-by: Alix-007 <[email protected]>
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
Avoid repeated full JSONL parsing and cloning on every embedded-agent turn by keeping a bounded, validated transcript cache and advancing repair incrementally.

The final implementation preserves lock ownership and exact fingerprint validation, publishes only verified writes, handles header rewrites and unterminated JSONL safely, and adds focused regression coverage.

Fixes openclaw#83943.

Co-authored-by: Alix-007 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

[Bug]: Session resource loader grows unbounded across warm turns — 5.x regression vs 4.23 baseline (Windows + Feishu + MiniMax OAuth)

3 participants