Skip to content

fix(auto-reply): preserve sessions after compaction failures#70479

Merged
clawsweeper[bot] merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/preserve-session-on-compaction-failure
May 22, 2026
Merged

fix(auto-reply): preserve sessions after compaction failures#70479
clawsweeper[bot] merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/preserve-session-on-compaction-failure

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the active session mapping when overflow recovery or compaction failure cannot recover a turn
  • keep the existing dynamic overflow guidance while adding explicit preserved-session guidance to retry, /compact, or /new
  • mark preserved-session failure replies for delivery despite source-reply suppression
  • add regression coverage for embedded overflow payloads and thrown compaction-failure errors
  • update the session compaction docs for the preserved-session failure path

Fixes #70472.

Real behavior proof

Behavior addressed: auto-reply no longer rotates/orphans the active session mapping when compaction or overflow recovery fails; the user gets a delivered failure reply that keeps dynamic overflow hints.

Real environment tested: local OpenClaw source checkout in an isolated PR worktree after rebasing onto current upstream/main b8e9ab9385 (fix(codex): surface native compaction failures (#85160)); pnpm openclaw --version built and ran the pushed head 193d3c0. No live WebChat/model run.

Exact steps or command run after this patch:

  • git fetch upstream main && git fetch origin fix/preserve-session-on-compaction-failure
  • git rebase upstream/main (clean rebase; no textual conflicts)
  • git grep -n "resetSessionAfterCompactionFailure" upstream/main -- src/auto-reply/reply src/agents confirmed current upstream/main still has the reset path, so this PR is still relevant after fix(codex): surface native compaction failures #85160.
  • pnpm docs:list
  • pnpm openclaw --version
  • node --import tsx --input-type=module production-helper probe importing buildContextOverflowRecoveryText, markReplyPayloadForSourceSuppressionDelivery, and getReplyPayloadMetadata from src/auto-reply.
  • pnpm exec oxfmt --check --threads=1 src/auto-reply/reply/agent-runner-execution.ts src/auto-reply/reply/agent-runner.ts src/auto-reply/reply/agent-runner-execution.test.ts CHANGELOG.md docs/reference/session-management-compaction.md
  • focused Vitest through scripts/run-vitest.mjs exports, because local Node 23 did not execute that script's import.meta.main branch: node --input-type=module with spawnWatchedVitestProcess({ pnpmArgs: ['exec', 'node', ...resolveVitestNodeArgs(process.env), resolveVitestCliEntry(), 'run', 'src/auto-reply/reply/agent-runner-execution.test.ts', '--reporter=dot'] })
  • compaction-adjacent Vitest selection through the same wrapper exports: src/agents/command/cli-compaction.test.ts, src/agents/command/session-store.test.ts, extensions/codex/src/app-server/compact.test.ts
  • git diff --check upstream/main...HEAD
  • autoreview branch pass with tests disabled, using the focused proof above: --mode branch --base upstream/main

Evidence after fix: terminal output from the local OpenClaw source setup and production-helper probe after rebasing on #85160:

$ pnpm openclaw --version
OpenClaw 2026.5.21 (193d3c0)

$ node --import tsx --input-type=module
runtime probe after upstream compaction rebase
active session before: session
active session after: session
deliverDespiteSourceReplySuppression: true
contains preserved-session guidance: true
contains dynamic reserveTokensFloor hint: true
reply preview: ⚠️ Auto-compaction could not recover this turn. I kept this conversation mapped to the current session. Please try again, use /compact, or use /new to start a fresh session.

Supplemental focused runtime coverage: src/auto-reply/reply/agent-runner-execution.test.ts passed 111 tests. The compaction-adjacent selection from #85160 passed 100 tests across src/agents/command/cli-compaction.test.ts, src/agents/command/session-store.test.ts, and extensions/codex/src/app-server/compact.test.ts. The new regression tests assert the preserved active session remains session, replyOperation.updateSessionId is not called, updateSessionStore is not called, the failure payload has deliverDespiteSourceReplySuppression: true, and the reply includes both the preserved-session guidance and the existing dynamic reserveTokensFloor hint.

Observed result after fix: the pushed head is rebased on b8e9ab9385, the local OpenClaw source build reports 193d3c0, the production-helper probe keeps the session id unchanged, marks the failure reply for suppressed-source delivery, and keeps the dynamic overflow hint. Autoreview reported no actionable regressions against the new upstream/main.
Maintainer supplemental before/after proof (May 22, 2026): I ran the same deterministic failure-path probe against clean archive copies of pre-fix origin/main and this PR head 193d3c0fdd5a42cc5291f4f279e80f872fdd1051. The probe exercises the actual runAgentTurnWithFallback branches for both embedded context-overflow error payloads and thrown compaction failures, with the real resetReplyRunSession helper wired on the pre-fix side.

Exact commands run for the before/after proof:

  • Pre-fix: env OPENCLAW_PR70479_EXPECT=broken OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs src/auto-reply/reply/pr70479-live-proof.test.ts --reporter=verbose in a git archive origin/main checkout.
  • PR head: env OPENCLAW_PR70479_EXPECT=fixed OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs src/auto-reply/reply/pr70479-live-proof.test.ts --reporter=verbose in a git archive 193d3c0fdd5a42cc5291f4f279e80f872fdd1051 checkout.
  • PR committed regression slice: env OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-execution.test.ts -t "preserves the active session" --reporter=verbose.

Before fix evidence from origin/main:

PR70479_PROOF {"scenario":"embedded context-overflow payload","expectedMode":"broken","activeSessionId":"session-after","followupSessionId":"session-after","updateSessionStoreCalls":1,"updateSessionIdCalls":1,"deliverDespiteSourceReplySuppression":true,"text":"⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.\n\nTo prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config."}
PR70479_PROOF {"scenario":"thrown compaction failure","expectedMode":"broken","activeSessionId":"session-after","followupSessionId":"session-after","updateSessionStoreCalls":1,"updateSessionIdCalls":1,"deliverDespiteSourceReplySuppression":true,"text":"⚠️ Context limit exceeded during compaction. I've reset our conversation to start fresh - please try again.\n\nTo prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config."}

After fix evidence from PR head:

PR70479_PROOF {"scenario":"embedded context-overflow payload","expectedMode":"fixed","activeSessionId":"session-before","followupSessionId":"session-before","updateSessionStoreCalls":0,"updateSessionIdCalls":0,"deliverDespiteSourceReplySuppression":true,"text":"⚠️ Auto-compaction could not recover this turn. I kept this conversation mapped to the current session. Please try again, use /compact, or use /new to start a fresh session.\n\nTo prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config."}
PR70479_PROOF {"scenario":"thrown compaction failure","expectedMode":"fixed","activeSessionId":"session-before","followupSessionId":"session-before","updateSessionStoreCalls":0,"updateSessionIdCalls":0,"deliverDespiteSourceReplySuppression":true,"text":"⚠️ Auto-compaction could not recover this turn. I kept this conversation mapped to the current session. Please try again, use /compact, or use /new to start a fresh session.\n\nTo prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config."}

Observed result from the before/after proof: pre-fix origin/main rewrites the active agent:main:main session from session-before to session-after and calls both updateSessionStore and replyOperation.updateSessionId. The PR head keeps the active session at session-before in both failure modes, makes zero session-store/updateSessionId calls, and returns a failure payload marked deliverDespiteSourceReplySuppression: true with retry, /compact, and /new guidance. The committed focused regression slice passed: 2 passed | 109 skipped for the two preserves the active session tests.

What was not tested: live WebChat UI overflow with a real model; the compaction/overflow failure behavior was exercised with a local OpenClaw source runtime probe plus focused runtime-unit coverage.

Notes

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Apr 23, 2026
@greptile-apps

greptile-apps Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes session orphaning after compaction failures in the auto-reply agent. Instead of silently rotating the session key to a new session ID when overflow recovery or compaction fails, both failure paths now preserve the active session mapping and surface an explicit user message with actionable guidance (retry, /compact, or /new). The resetSessionAfterCompactionFailure callback is fully removed from the runAgentTurnWithFallback interface and all call-sites, resolving the dead-parameter concern flagged in a prior review. Regression tests are added for both the embedded-overflow payload path and the thrown-error compaction failure path.

Confidence Score: 5/5

This PR is safe to merge — it correctly removes a session-rotation footgun and replaces it with session-preserving, user-visible guidance, with targeted regression coverage for both failure paths.

All changes are narrowly scoped to the compaction-failure paths. The dead resetSessionAfterCompactionFailure parameter raised in the previous review is fully removed. Both new code paths are covered by regression tests that assert the exact user-facing text and the fail() call. No P0/P1 issues identified.

No files require special attention.

Reviews (2): Last reviewed commit: "fix(auto-reply): drop dead compaction re..." | Re-trigger Greptile

@fuller-stack-dev

fuller-stack-dev commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the dead resetSessionAfterCompactionFailure surface in 3befdda128 by removing the unused execution param and all remaining call-site/test stubs.

Current red CI on the previous run does not point at this branch’s diff:

  • checks-node-extensions-shard-6 failed in extensions/codex/src/app-server/{approval,elicitation}-bridge.test.ts; those same targeted tests pass locally on this branch.
  • check-lint flagged extensions/codex/src/app-server/compact.ts:192 (NaN vs Number.NaN), which is outside this PR’s changed files.

This branch only changes:

  • src/auto-reply/reply/agent-runner.ts
  • src/auto-reply/reply/agent-runner-execution.ts
  • src/auto-reply/reply/agent-runner-execution.test.ts
  • docs/reference/session-management-compaction.md

@fuller-stack-dev

Copy link
Copy Markdown
Contributor Author

@greptileai review again puhlez

@fuller-stack-dev fuller-stack-dev force-pushed the fix/preserve-session-on-compaction-failure branch from 3befdda to 3367448 Compare April 23, 2026 07:48
@fuller-stack-dev

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (f8894d5) and retriggering CI. The docker-e2e-fast failure on the previous run was a timeout (exit 124) in the bundled-channel Docker E2E, unrelated to our changes.

@martingarramon

Copy link
Copy Markdown
Contributor

Static review. LGTM-shape on removing the silent session rotation — surfacing "please /compact or /new" is the right UX.

Three checks:

  1. Retry-loop regression. The embeddedError branch previously returned only after resetSessionAfterCompactionFailure returned true. Now it returns unconditionally on any isContextOverflowError without the didResetAfterCompactionFailure guard. Confirm the surrounding retry harness can't re-enter with the same error — the old guard tracked "already reset once"; if that state lived inside the removed function, the retry loop needs a replacement latch.
  2. Factory-level did-reset state. agent-runner.ts:1179-1185's resetSession helper is still called from resetSessionAfterRoleOrderingConflict via the same factory. If the factory tracks "did-reset-once" that the removed call was flipping, the role-ordering path could inherit stale state.
  3. Dead-reference check. grep -rn resetSessionAfterCompactionFailure src/ after merge should return zero hits — signature removed at ~L587 but the full tree needs confirmation.

Non-blocking: user-facing string change is a behavior regression for anyone grepping transcripts for "reset our conversation to start fresh". Worth a release-note mention.

@vincentkoc

Copy link
Copy Markdown
Member

ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical.

Source PR: #70479
Validation: pnpm -s vitest run src/auto-reply/reply/agent-runner-execution.test.ts; pnpm check:changed
Contributor credit is preserved in the branch history and PR context.

@clawsweeper

clawsweeper Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.

Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow payloads and thrown compaction failures into resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

PR rating
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Summary: The patch is focused and has deterministic before/after runtime proof; live WebChat proof would be stronger but is not required to understand this branch behavior.

Rank-up moves:

  • none
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.

Real behavior proof
Sufficient (terminal): The updated PR body includes maintainer before/after terminal proof showing the pre-fix reset and the PR-head preserved session mapping with delivered failure payload metadata.

Mantis proof suggestion
A live WebChat/runtime proof would be useful because the change affects visible failure guidance and active session mapping after compaction failure. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify WebChat compaction-failure recovery preserves agent:main:main mapping and shows retry /compact /new guidance.

Risk before merge

  • Merging changes the failure path from automatic session rotation to preserved-session guidance, so maintainers should be comfortable owning that session-state behavior change.
  • The proof now exercises the actual fallback branches in terminal runs, but it still is not a live WebChat UI overflow with a real model.

Maintainer options:

  1. Proceed with the supplied proof (recommended)
    Accept the deterministic before/after runAgentTurnWithFallback proof as enough evidence for this failure path and let exact-head merge gates run.
  2. Ask for one live WebChat proof
    Require a redacted live WebChat/model overflow run or runtime log showing the active mapping remains unchanged and the guidance is delivered.
  3. Keep paused for maintainer validation
    Hold the PR until a maintainer with the right setup validates the failure path directly.

Next step before merge
No repair PR is needed; the review found no actionable code defect and the remaining work is normal exact-head merge gating or maintainer proof preference.

Security
Cleared: The diff touches auto-reply control flow, focused tests, docs, and changelog only, with no dependency, CI, secret, permission, package-resolution, or external code-execution change.

Review details

Best possible solution:

Land the session-preserving recovery path if maintainers accept the supplied before/after runtime proof, with CI and exact-head automerge gates handling normal merge safety.

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

Yes, at source level with high confidence. Current main routes both embedded overflow payloads and thrown compaction failures into resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Is this the best way to solve the issue?

Yes. Preserving the active mapping and returning explicit retry /compact /new guidance is a narrow fix for the existing orphaning path, without adding a new config mode or duplicating session policy.

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body includes maintainer before/after terminal proof showing the pre-fix reset and the PR-head preserved session mapping with delivered failure payload metadata.
  • add rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🐚 platinum hermit, and The patch is focused and has deterministic before/after runtime proof; live WebChat proof would be stronger but is not required to understand this branch behavior.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: The PR targets a user-visible session orphaning path that can break long-running WebChat continuity after compaction failure.
  • merge-risk: 🚨 session-state: Merging intentionally changes failure-path session mapping behavior from rotation to preservation.
  • merge-risk: 🚨 message-delivery: The fix depends on delivered failure guidance despite source-reply suppression.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🐚 platinum hermit, and The patch is focused and has deterministic before/after runtime proof; live WebChat proof would be stronger but is not required to understand this branch behavior.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (terminal): The updated PR body includes maintainer before/after terminal proof showing the pre-fix reset and the PR-head preserved session mapping with delivered failure payload metadata.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body includes maintainer before/after terminal proof showing the pre-fix reset and the PR-head preserved session mapping with delivered failure payload metadata.

What I checked:

Likely related people:

  • steipete: Git history ties the compaction overflow reset and subsequent recovery/refactor work to the current auto-reply failure path. (role: introduced behavior; confidence: high; commits: 67743325eeb5, 9faa95d55832, ea018a68ccb9; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/agent-runner-execution.ts)
  • joshavant: Recently merged the native compaction-failure surfacing work that this PR rebased on and explicitly separates from. (role: adjacent compaction owner; confidence: medium; commits: b8e9ab9385c0; files: extensions/codex/src/app-server/compact.ts, src/agents/command/cli-compaction.ts, src/agents/pi-embedded-runner/run.ts)
  • Takhoffman: Raised the main review concerns in the PR discussion around retry-loop behavior, factory reset state, and dead reset references. (role: reviewer; confidence: medium; files: src/auto-reply/reply/agent-runner-execution.ts, src/auto-reply/reply/agent-runner.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 55cfe00a3a40.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 20, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Gilded Lint Imp

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: sparkles near resolved comments.
Image traits: location green-check meadow; accessory review stamp; palette cobalt, lime, and pearl; mood patient; pose standing beside its cracked shell; shell brushed metal shell; lighting clean product lighting; background small green status lights.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Gilded Lint Imp in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@fuller-stack-dev fuller-stack-dev force-pushed the fix/preserve-session-on-compaction-failure branch from 74a145f to 9152393 Compare May 22, 2026 02:37
@openclaw-barnacle openclaw-barnacle Bot added 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 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=193d3c0fdd5a42cc5291f4f279e80f872fdd1051)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-05-22T05:04:42Z
Merge commit: cd1cae5be9ba

What merged:

  • The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
  • Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:

  • PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
  • PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

The automerge loop is complete.

Automerge progress:

  • 2026-05-22 03:06:37 UTC review queued 193d3c0fdd5a (queued)
  • 2026-05-22 05:04:23 UTC review passed 193d3c0fdd5a (structured ClawSweeper verdict: pass (sha=193d3c0fdd5a42cc5291f4f279e80f872fdd1...)
  • 2026-05-22 05:04:44 UTC merged 193d3c0fdd5a (merged by ClawSweeper automerge)

@clawsweeper clawsweeper Bot added status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: Automerge is armed, but the remaining blocker is a maintainer proof judgment that automation cannot supply for the contributor's runtime environment.; Cleared: Cleared: the diff touches auto-reply control flow, tests, docs, and changelog only, with no dependency, CI, secret, permission, package-resolution, or external code-execution change. (sha=193d3c0fdd5a42cc5291f4f279e80f872fdd1051)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@joshavant joshavant self-assigned this May 22, 2026
@joshavant

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper could not start a re-review for this item.

Reason: re-review requires an open issue or PR.

@joshavant

Copy link
Copy Markdown
Contributor

Updated the PR body with supplemental maintainer before/after proof for the requested session-state and delivery-path evidence.

The added proof shows pre-fix origin/main rewrites agent:main:main from session-before to session-after and calls both updateSessionStore and replyOperation.updateSessionId; the PR head keeps session-before, makes zero session-store/updateSessionId calls, and returns a deliverDespiteSourceReplySuppression: true failure payload with retry, /compact, and /new guidance for both embedded overflow payloads and thrown compaction failures.

@clawsweeper re-review

@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 22, 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. clawsweeper:human-review Needs maintainer review before ClawSweeper can continue labels May 22, 2026
@clawsweeper clawsweeper Bot merged commit cd1cae5 into openclaw:main May 22, 2026
162 of 168 checks passed
karmafeast pushed a commit to karmaterminal/openclaw that referenced this pull request May 22, 2026
…red production

Restoration commit bbecf06 reverted PR openclaw#70479 (preserve-session-on-compaction)
and re-introduced session-system-events as a {text, forceSenderIsOwnerFalse}
block, but left three test/production sites stale.

- get-reply-run.media-only.test.ts: mock drainFormattedSystemEventBlock
  (replaces the string-returning legacy helper that get-reply-run no longer
  imports) and return the new block shape from each mockResolvedValueOnce.
- agent-runner-execution.test.ts: override resetSessionAfterCompactionFailure
  to true in the two compaction-failure tests so the restored recovery branch
  is actually taken, and update expected reply text to match the restored
  'I've reset our conversation to start fresh' copy.
- sessions/store-cache.ts: stamp storedAt on serialized-cache entries and
  drop them from getSerializedSessionStore once they outlive the session
  store TTL, restoring the parity-with-object-cache assertion added in the
  restoration commit.
karmafeast pushed a commit to karmaterminal/openclaw that referenced this pull request May 22, 2026
…red production

Restoration commit bbecf06 reverted PR openclaw#70479 (preserve-session-on-compaction)
and re-introduced session-system-events as a {text, forceSenderIsOwnerFalse}
block, but left three test/production sites stale.

- get-reply-run.media-only.test.ts: mock drainFormattedSystemEventBlock
  (replaces the string-returning legacy helper that get-reply-run no longer
  imports) and return the new block shape from each mockResolvedValueOnce.
- agent-runner-execution.test.ts: override resetSessionAfterCompactionFailure
  to true in the two compaction-failure tests so the restored recovery branch
  is actually taken, and update expected reply text to match the restored
  'I've reset our conversation to start fresh' copy.
- sessions/store-cache.ts: stamp storedAt on serialized-cache entries and
  drop them from getSerializedSessionStore once they outlive the session
  store TTL, restoring the parity-with-object-cache assertion added in the
  restoration commit.
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…w#70479)

Summary:
- The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog.
- Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook
- PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures

Validation:
- ClawSweeper review passed for head 193d3c0.
- Required merge gates passed before the squash merge.

Prepared head SHA: 193d3c0
Review: openclaw#70479 (comment)

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge docs Improvements or additions to documentation merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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: M stale Marked as stale due to inactivity status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Context overflow / compaction can orphan agent:main:main and silently rotate WebChat to a new session

5 participants