Skip to content

fix(agents): repair persisted tool result pairing#81397

Open
stainlu wants to merge 1 commit into
openclaw:mainfrom
stainlu:stainlu/fix-session-file-tool-pairing-repair
Open

fix(agents): repair persisted tool result pairing#81397
stainlu wants to merge 1 commit into
openclaw:mainfrom
stainlu:stainlu/fix-session-file-tool-pairing-repair

Conversation

@stainlu

@stainlu stainlu commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: interrupted or killed tool runs can leave persisted session JSONL with toolResult entries separated from their assistant tool-call entry, duplicated, or orphaned.
  • Why it matters: session-file repair runs before OpenClaw loads a transcript. If the durable JSONL keeps invalid tool-result ordering, the same session can keep failing on later turns after restart.
  • What changed: the session-file repair pass now moves matching persisted tool results next to their assistant tool call and drops duplicate or orphan persisted tool results before loading the transcript.
  • What did NOT change: runtime/provider replay can still synthesize missing generic tool results when a provider policy needs it. The durable disk repair does not invent missing generic outputs; it only preserves and reorders real persisted entries or removes invalid persisted entries. The existing Codex-specific session-file repair for aborted tool outputs remains unchanged.

Change Type

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Chore/infra

Scope

  • Gateway / orchestration
  • Agents / runtime
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Real behavior proof

  • Behavior or issue addressed: persisted session JSONL with a displaced matching toolResult, a duplicate toolResult, and an orphan toolResult.
  • Real environment tested: local macOS OpenClaw checkout, current main JSONL session-file repair path, real temp session file, and production repairSessionFileIfNeeded.
  • Exact steps or command run after this patch: ran a local node --import tsx --input-type=module command that wrote a corrupted session.jsonl, invoked repairSessionFileIfNeeded, then read the durable JSONL back from disk.
  • Evidence after fix: console output from that command:
OpenClaw console output: repair result {
  "repaired": true,
  "movedToolResults": 1,
  "droppedDuplicateToolResults": 1,
  "droppedOrphanToolResults": 1,
  "hasBackup": true
}
OpenClaw console output: repaired role order session > user > assistant > toolResult > user
OpenClaw console output: repaired ids proof-session > msg-user > msg-assistant > msg-tool-result > msg-user-followup
OpenClaw console output: preserved moved result parent preserved-parent
  • Observed result after fix: the durable JSONL transcript is rewritten so the real matching tool result sits immediately after the assistant tool call, the duplicate and orphan tool results are removed, the moved entry metadata is preserved, and the original session file is backed up.
  • What was not tested: a live provider call after killing an active tool run, because this patch is isolated to deterministic durable transcript repair.

Root Cause

  • Root cause: transcript replay already knew how to repair invalid tool-call/tool-result order in memory, but session-file repair did not repair persisted tool-result pairing before loading JSONL transcript entries.
  • Missing detection / guardrail: existing disk repair covered malformed JSONL, malformed messages, blank user text, empty assistant error turns, and Codex missing outputs, but did not cover toolResult entries that were displaced, duplicated, or orphaned in the persisted transcript.
  • Contributing context: interruption paths can persist partial tool-call sequences. Once persisted, the invalid entries survive restart and can poison later context rebuilds for the session.

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/agents/session-file-repair.test.ts
  • Scenario the test should lock in: session-file repair moves a real matching late tool result next to its assistant tool call, drops duplicate persisted tool results, and drops orphan persisted tool results without synthesizing missing generic results.
  • Why this is the smallest reliable guardrail: it exercises the actual durable JSONL repair boundary and atomic rewrite/backup behavior without requiring provider scheduling or process-kill timing.
  • Existing test that already covers this: in-memory replay repair coverage exists in src/agents/session-transcript-repair.test.ts, but durable session-file repair did not have persisted-entry coverage for this corruption shape.

User-visible / Behavior Changes

Sessions with persisted tool-call/tool-result pairing corruption can recover on restart instead of repeatedly failing during later context rebuilds.

Diagram

Before:
session.jsonl:
assistant(toolCall call_1) -> user follow-up -> toolResult(call_1) -> duplicate/orphan result
load/replay later -> invalid durable transcript can fail again

After:
session-file repair:
assistant(toolCall call_1) -> toolResult(call_1) -> user follow-up
duplicate/orphan persisted results removed

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 22 repo test wrapper and JSONL session-file repair
  • Model/provider: N/A
  • Integration/channel: N/A
  • Relevant config: temp session JSONL file

Steps

  1. Write a session JSONL file with an assistant toolCall entry.
  2. Persist a user follow-up before the matching toolResult.
  3. Persist a duplicate matching toolResult and an unrelated orphan toolResult.
  4. Run repairSessionFileIfNeeded.
  5. Read the repaired session JSONL back from disk.

Expected

  • The matching toolResult is moved next to the assistant tool call.
  • Duplicate and orphan persisted toolResult entries are removed.
  • Missing generic tool results are not synthesized into durable state.
  • The original session file is backed up.

Actual

  • Before this patch, session-file repair left the invalid tool-result entries in place.
  • After this patch, the persisted JSONL entries are repaired deterministically.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers

Human Verification

  • Verified scenarios: moved displaced matching tool result, duplicate persisted tool result dropped, orphan persisted tool result dropped, moved entry metadata preserved, backup file written.
  • Edge cases checked: malformed-line repair still works, empty assistant error-turn repair still works, blank user repair still works, delivered trailing assistant messages remain untouched, Codex-specific missing-output repair remains intact, in-memory replay repair coverage still passes.
  • What you did not verify: live provider call after killing an active tool run.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: durable repair could accidentally rewrite valid transcript shape.
    • Mitigation: the repair only touches toolResult entries whose ids match a visible assistant tool call span, duplicate ids, or tool results with no matching assistant tool call. Regression tests assert delivered assistant turns and unrelated non-message entries are preserved.
  • Risk: durable repair could invent fake generic tool output.
    • Mitigation: this pass intentionally does not synthesize missing generic tool results; synthetic missing-output repair remains runtime/provider-specific. The existing Codex session-file aborted repair is left as-is.

Validation

  • pnpm docs:list
  • pnpm test src/agents/session-file-repair.test.ts src/agents/session-transcript-repair.test.ts src/agents/pi-embedded-runner.sanitize-session-history.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/reference/transcript-hygiene.md src/agents/session-file-repair.ts src/agents/session-file-repair.test.ts
  • git diff --check
  • pnpm changed:lanes --base upstream/main --json
  • pnpm check:changed --base upstream/main

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling triage: blank-template Candidate: PR template appears mostly untouched. size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 13, 2026
@clawsweeper

clawsweeper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 3, 2026, 11:49 PM ET / 03:49 UTC.

Summary
The PR adds durable session-file repair for displaced, duplicate, and orphan persisted toolResult entries, plus focused tests, transcript-hygiene docs, and a changelog entry.

PR surface: Source +167, Tests +176, Docs +1. Total +344 across 4 files.

Reproducibility: yes. Source inspection shows current main still lacks a durable pairing pass for displaced, duplicate, and orphan persisted tool results, and the PR body includes terminal proof constructing that JSONL shape against repairSessionFileIfNeeded after the patch.

Review metrics: 1 noteworthy metric.

  • Durable Session Rewrite: 1 repair path changed. The PR changes code that rewrites persisted session JSONL, so upgrade, session-state, and sensitive transcript handling need current-main proof before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: CHANGELOG.md, migration/backfill/repair: docs/reference/transcript-hygiene.md, serialized state: CHANGELOG.md, serialized state: docs/reference/transcript-hygiene.md, serialized state: src/agents/session-file-repair.test.ts, serialized state: src/agents/session-file-repair.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #58608
Summary: This PR is the candidate durable disk-repair fix for the closed session-corruption report; adjacent repair PRs cover related but distinct transcript poisoning paths.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

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

Rank-up moves:

  • [P2] Port the durable pairing repair onto current main's repair lifecycle.
  • [P2] Add the synthetic-before-real persisted-result regression and prove the real result wins.
  • Refresh focused terminal/test proof after the port.

Risk before merge

  • [P1] The PR is currently CONFLICTING against main, so maintainers cannot rely on the submitted branch without a rebase or replacement port.
  • [P1] The branch's successful-repair backup behavior can leave full session JSONL transcript content in sibling backup files outside the canonical session file.
  • [P1] The duplicate durable-result rule can keep an earlier synthetic missing-result placeholder and drop a later real persisted tool result unless the port mirrors current replay repair semantics.

Maintainer options:

  1. Port Onto Current Repair Lifecycle (recommended)
    Move only the durable pairing logic into current main while preserving trusted snapshots, incremental repair caching, delivery-mirror insertion, corrupted-image repair, and validated snapshot publication.
  2. Ask For Manual Rebase
    Have the contributor rebase onto current main, resolve the repair lifecycle conflicts, remove the changelog edit, and refresh focused terminal proof on the rebased head.
  3. Open A Credited Replacement
    If the source branch is difficult to update safely, a maintainer can land a narrow replacement PR that credits this source PR and closes it afterward.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Port only the durable tool-result pairing repair onto current main's src/agents/session-file-repair.ts. Preserve trustedSnapshot/validatedSnapshot publication, tryIncrementalSessionRepair, sessionRepairCache, corrupted image repair, message-delivery mirror repair, transient backup cleanup, canonical OpenAI provider identifiers, and current docs backup wording. Add a durable JSONL regression where an earlier synthetic missing-result entry is followed by a later real persisted tool result and the real result wins. Remove the CHANGELOG.md edit. Do not change missing generic-result semantics; https://github.com/openclaw/openclaw/issues/85668 owns that decision.

Next step before merge

  • [P2] A focused automated repair can preserve the useful durable pairing logic while resolving the stale-branch, session-state, backup-handling, and changelog blockers.

Security
Needs attention: The diff has no new dependency or network execution surface, but it retains successful session JSONL backups that can preserve sensitive transcript content outside the canonical file.

Review findings

  • [P1] Port pairing repair into the current lifecycle — src/agents/session-file-repair.ts:531-537
  • [P1] Keep real results over synthetic placeholders — src/agents/session-file-repair.ts:298-303
  • [P1] Do not retain successful repair backups — src/agents/session-file-repair.ts:608
Review details

Best possible solution:

Land a narrow current-main port of the durable persisted pairing repair that preserves snapshot/cache lifecycle, delivery-mirror repair, real-over-synthetic selection, transient backup cleanup, and current docs/tests.

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

Yes. Source inspection shows current main still lacks a durable pairing pass for displaced, duplicate, and orphan persisted tool results, and the PR body includes terminal proof constructing that JSONL shape against repairSessionFileIfNeeded after the patch.

Is this the best way to solve the issue?

No, not as submitted. Durable session-file repair is the right layer, but the branch must be ported onto current main and mirror current real-over-synthetic and transient-backup semantics.

Full review comments:

  • [P1] Port pairing repair into the current lifecycle — src/agents/session-file-repair.ts:531-537
    This wiring adds the pairing pass to the branch's older full-file repair flow. Current main now has trusted snapshots, incremental repair/cache, delivery-mirror insertion, corrupted-image repair, current OpenAI identifiers, and validated-snapshot publication; port the pairing pass into that lifecycle instead of landing this branch version.
    Confidence: 0.93
  • [P1] Keep real results over synthetic placeholders — src/agents/session-file-repair.ts:298-303
    This duplicate rule keeps the first result seen for an id and drops a later duplicate. If an earlier persisted synthetic missing-result placeholder appears before a later real persisted result, durable repair would keep the false placeholder and discard the real output; mirror current replay repair's real-over-synthetic replacement rule.
    Confidence: 0.9
  • [P1] Do not retain successful repair backups — src/agents/session-file-repair.ts:608
    The branch returns backupPath after a successful rewrite and never deletes the backup. Current main treats session JSONL backups as transient and removes them after the atomic replace, because retained backups can leave sensitive transcript content outside the canonical file.
    Confidence: 0.88
  • [P3] Remove the release-owned changelog edit — CHANGELOG.md:12
    Normal PRs should not edit CHANGELOG.md; release generation owns that file. Keep this release-note context in the PR body or squash message and remove the changelog line.
    Confidence: 0.84

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e.

Label changes

Label justifications:

  • P1: The PR targets restart-persistent session corruption that can keep real agent sessions failing after interrupted tool runs.
  • merge-risk: 🚨 compatibility: The submitted branch conflicts with current main and predates the current repair API, snapshot/cache lifecycle, and canonical OpenAI provider identifiers.
  • merge-risk: 🚨 session-state: The diff rewrites durable session JSONL and can currently preserve synthetic output while dropping later real persisted tool output.
  • merge-risk: 🚨 security-boundary: The branch retains full session JSONL backup files after successful repair, which can preserve sensitive transcript data outside the canonical file.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes after-fix terminal output from a real temp session file invoking production repairSessionFileIfNeeded for displaced, duplicate, and orphan persisted tool results; proof should be refreshed after a current-main port.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from a real temp session file invoking production repairSessionFileIfNeeded for displaced, duplicate, and orphan persisted tool results; proof should be refreshed after a current-main port.
Evidence reviewed

PR surface:

Source +167, Tests +176, Docs +1. Total +344 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 180 13 +167
Tests 1 176 0 +176
Docs 2 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 358 14 +344

Security concerns:

  • [medium] Retains successful transcript repair backups — src/agents/session-file-repair.ts:608
    Session JSONL can contain user prompts, tool arguments, and tool results; keeping .bak-* copies after successful repair expands where sensitive transcript content persists compared with current main's transient cleanup behavior.
    Confidence: 0.88

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/agents/session-file-repair.test.ts src/agents/session-transcript-repair.test.ts src/agents/embedded-agent-runner.sanitize-session-history.test.ts.
  • [P1] pnpm exec oxfmt --check --threads=1 docs/reference/transcript-hygiene.md src/agents/session-file-repair.ts src/agents/session-file-repair.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • anyech: Authored merged PR fix(agents): recover message-tool mirror replay poison #84708, which added adjacent session-file repair logic for delivery-mirror replay poisoning in the same file. (role: recent area contributor; confidence: high; commits: e90fb676414a; files: src/agents/session-file-repair.ts, src/agents/session-file-repair.test.ts)
  • vincentkoc: Recent commit history shows multiple June 2026 changes to session repair and transcript repair internals, including result indexing and refactors around missing-result text. (role: recent area contributor; confidence: high; commits: 4dac8f47ed46, 3001ec438157, 9bc7dced980e; files: src/agents/session-file-repair.ts, src/agents/session-transcript-repair.ts)
  • Alix-007: Authored the validated transcript cache work that added the current trusted snapshot and incremental repair lifecycle this PR now needs to preserve. (role: recent area contributor; confidence: high; commits: a0b16f37e835; files: src/agents/session-file-repair.ts, src/agents/session-file-repair.test.ts)
  • Eva (agent): Authored the transient session-repair backup cleanup commit that makes retained successful JSONL backups a security-sensitive regression for this PR. (role: introduced adjacent behavior; confidence: medium; commits: e1d7ba59158c; files: src/agents/session-file-repair.ts, src/agents/session-file-repair.test.ts, docs/reference/transcript-hygiene.md)
  • steipete: Recent history shows broad agent runtime and OpenAI provider identity refactors affecting this repair surface and the canonical provider ids the PR must preserve. (role: adjacent owner; confidence: medium; commits: 7423e9cb663c, 4c33aaa86c16, bb46b79d3c14; files: src/agents/session-file-repair.ts, src/agents/embedded-agent-runner/run/attempt.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.

@stainlu
stainlu force-pushed the stainlu/fix-session-file-tool-pairing-repair branch 2 times, most recently from 1b1e4f5 to 385bc83 Compare May 13, 2026 14:02
@stainlu
stainlu force-pushed the stainlu/fix-session-file-tool-pairing-repair branch from 385bc83 to 0fdf37f Compare May 15, 2026 11:23
@stainlu

stainlu commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the only conflict in CHANGELOG.md; no intended behavior change.

Latest local proof on rebased head 0fdf37f:

  • node_modules/.bin/oxfmt --check --threads=1 CHANGELOG.md docs/reference/transcript-hygiene.md src/agents/session-file-repair.ts src/agents/session-file-repair.test.ts
  • git diff --check upstream/main...HEAD
  • env OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/test-projects.mjs src/agents/session-file-repair.test.ts -- --reporter=verbose — 28 passed
  • env OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/test-projects.mjs src/agents/session-transcript-repair.test.ts src/agents/pi-embedded-runner.sanitize-session-history.test.ts -- --reporter=verbose — 35 + 56 passed

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 15, 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:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 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. 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. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 21, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(agents): repair persisted tool result pairing This is item 1/1 in the current shard. Shard 6/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. triage: blank-template Candidate: PR template appears mostly untouched.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session corruption from orphaned tool_result blocks survives restart (overload/timeout interruption)

1 participant