Fix replay-invalid session recovery#85362
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 12:59 AM ET / 04:59 UTC. Summary PR surface: Source +33, Tests +111. Total +144 across 6 files. Reproducibility: yes. at source level: current main does not classify Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the branch as a last-resort reply-session recovery path, but land it only after the replay-stack coordination confirms transport retry remains first and the final replay-invalid classifier is shared rather than forked. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main does not classify Is this the best way to solve the issue? Yes, with sequencing caveat: using the existing AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3c5f5efc8c41. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +33, Tests +111. Total +144 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 PR egg: ✨ hatched 🥚 common Tiny Test Hopper. Rarity: 🥚 common. Trait: sleeps inside passing CI. DetailsShare on X: post this hatch
About:
|
|
Cross-linking the Responses item-id coordination note from #85277: For this PR, the proposed final layering is to keep replay-invalid session reset as the last-resort fallback when poisoned state reaches reply-agent failure handling, not as a replacement for #84267's recoverable OpenAI Responses transport retry. If #84267 drops replayable reasoning on retry, #85277 should also omit the signed assistant Suggested merge order from the coordination pass: #84904 -> #85277 -> #84267 -> #85362. When rebasing with #84267, the clean combined shape should keep one exported |
4762fde to
f7c9a33
Compare
This comment was marked as spam.
This comment was marked as spam.
f7c9a33 to
f2e8d98
Compare
|
Superseded by #92941, landed as Current If a concrete replay failure still escapes the transport retry on current |
Summary
invalid_encrypted_contentfailures as replay-invalid session state.resetReplyRunSessionpath before returning the recovery guidance.This is the cleaner follow-up to #85294. It deliberately leaves current
main's native Codex Responses replay contract intact: safe reasoning replay remains enabled, while upstream's existing transport sanitizer/retry continues to strip unsafe encrypted content where appropriate.Verification
git diff --checknode scripts/run-vitest.mjs src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/auto-reply/reply/agent-runner-execution.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts -t "rotates poisoned replay-invalid sessions"node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfoReal behavior proof
Behavior addressed: A native OpenAI Codex encrypted replay failure should not leave the reply agent bound to a poisoned session that keeps failing with generic "Something went wrong" responses.
Real environment tested: Local OpenClaw checkout at PR head, using the real
resetReplyRunSessionhelper against an on-disk OpenClaw session store rooted at/tmp/openclaw-live-proofwithOPENCLAW_STATE_DIR=/tmp/openclaw-live-proof/state.Exact steps or command run after this patch: Ran a local
node --import tsx --input-type=moduletranscript that created a poisonedsessions.json, invokedresetReplyRunSessionwith the observedinvalid_encrypted_contentfailure class, then inspected the persisted session store with plainnode.Evidence after fix: Terminal output from the local OpenClaw filesystem run:
Observed result after fix: The OpenClaw session store moved from
poisoned-sessionto a fresh session id, the old transcript path is no longer the active binding, stale runtime fields were cleared, and the recovery copy is the stale-session guidance instead of the generic failure copy.What was not tested: No production Telegram/OpenClaw VM turn or live OpenAI Codex backend request was run, because that would require production bot and model credentials. The PR also does not change the native Codex Responses transport replay sanitizer that is already present on
main.