Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review: needs real behavior proof before merge. What this changesThe PR makes local sessions reuse the stored form of encrypted reasoning signatures, the provider’s serialized reasoning items, so replayed input stays consistent after session reload. Example: A local Responses session runs lookup and is then reopened.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR contains a distinct, useful consistency repair that current main still lacks. No actionable patch defect was identified, and the related merged worker fix does not cover local sessions. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherLocal agent sessions receive assistant messages from model providers, execute tool calls, and save conversation history. Later provider requests replay reasoning items from either live messages or reconstructed history. flowchart TD
A[Provider assistant message] --> B[Local completion boundary]
B --> C{Nonempty encrypted reasoning?}
C -->|Yes| D[Existing signature sanitizer]
C -->|No| E[Unchanged live signature]
D --> F[Tool continuation]
E --> F
D --> G[Transcript storage]
E --> G
G --> H[Reloaded conversation]
Technical reviewBest possible solution: Keep signature canonicalization in the existing transcript owner and apply it to fresh encrypted local output before continuation. Do we have a high-confidence way to reproduce the issue? Yes, source and the supplied baseline regression establish the local signature-byte mismatch between tool continuation and reconstructed history. This read-only review did not execute the reproduction. Is this the best way to solve the issue? Yes, the patch uses the existing canonicalization owner at the fresh-message boundary and preserves plaintext-only behavior, rather than changing storage or rewriting approved history. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0cf5e291a081. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +150, Docs +4. Total +178 across 3 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 9, 2026, 6:36 AM ET / 10:36 UTC. |
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Thanks @xyrolle for diagnosing this and for the regression coverage. This is now covered on main by #169689 (438e06c), which normalizes SDK Responses replay to the stored privacy shape and field order, and #172455 (6b13edf), which preserves empty content containers and terminal reasoning ciphertext across cold reopen. I verified both commits are on current main and ran the existing storage-replay and history-prefix suites: all 11 cases passed. Managed/package requests compare serialized reasoning before and after canonical storage preparation and reload; the four-turn, 12-request scenario checks prefix stability through cold transcript replay. This is offline boundary proof, not a new live-provider/cache measurement. Closing as already fixed. The persistence/reload regression coverage is already present, so there is no remaining part to lift from this patch. Thank you for helping pin down the replay mismatch. |
Fixes #167768
What Problem This Solves
Fixes: a local Responses session changes the replayed bytes of an encrypted reasoning item when it is reopened after an in-turn tool continuation.
User Impact
User impact: encrypted reasoning items use the same signature bytes during the first tool continuation and after session reconstruction. Visible thinking, ciphertext, IDs, status, live tool arguments, and previously approved history retain their existing behavior. No configuration change or migration is required.
Risk: fresh signatures carrying non-empty
encrypted_contentnow take the stored form on the in-turn continuation, as node turns and reopened sessions already do. Their summaries and plaintext content are dropped from the replay signature. Items without a non-empty string inencrypted_contentretain today's in-turn behavior, including plaintext content; storage still canonicalizes them on reload. Provider acceptance and cache statistics were not measured on a real provider. Better prefix reuse is an expected consequence for caches sensitive to replayed input, not a measured result.Why This Change Was Made
The local completion boundary now calls the existing transcript signature sanitizer before persistence for fresh signatures carrying non-empty
encrypted_content. The sanitizer retains ownership of route eligibility, validation, and canonical bytes. Only blocks whose signatures change are copied.This extends the byte-consistency approach in #164287 to local sessions, with a narrower entry condition to avoid newly dropping plaintext-only reasoning during a turn. It does not change the sanitizer or rewrite stored history.
Evidence
encrypted_content: null) cases. On mainf5e306d4fe0a1d2c2b844ea034c5341e7a97fb4e, the encrypted case fails on raw versus canonical signature bytes; the plaintext-only case passes. The fix passes both cases and checks visible thinking, ciphertext, IDs, status, live tool arguments, unchanged history, and reconstructed-session replay.pnpm test src/agents/sessions/agent-session-reasoning-replay.test.ts --maxWorkers=1. Baseline: 1 failed, 1 passed, 10.10 s wall. Fixed: 2 passed, 20.96 s wall, 0.371 s test time, including compiled-worker preparation. The plaintext-with-null case also fails with the prior presence-only guard and passes with the non-empty-string guard.