Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 6:50 PM ET / 22:50 UTC. ClawSweeper reviewWhat this changesThe PR makes OpenAI Responses session replay skip malformed or non-reasoning persisted reasoning signatures while preserving valid reasoning replay. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open: it remains necessary, and the focused shared replay repair has no confirmed patch defect. The branch is behind current main, so exact-merge CI and replay validation should precede landing. Priority: P2 Review scores
Verification
How this fits togetherOpenAI Responses replay converts stored assistant reasoning blocks into the next provider request for a continuing session. This shared converter feeds both provider-owned and transport-owned request paths. flowchart LR
A[Stored session history] --> B[Responses replay]
B --> C[Parse reasoning signature]
C --> D{Reasoning record?}
D -->|Yes| E[Replay valid reasoning]
D -->|No| F[Skip invalid block]
E --> G[Provider request]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +24. Total +30 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the shared parse-and-discriminate repair only after validating the rebased merge result, retaining coverage for malformed values and valid encrypted reasoning across both replay styles. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main directly parses persisted signatures at the replay boundary, so malformed JSON can abort conversion before the later assistant content is emitted. The PR also supplies a documented before/after gateway continuation run. Is this the best way to solve the issue? Yes: the shared converter owns both provider and transport replay paths, and rejecting malformed or unrelated parsed values there avoids downstream compensation while retaining valid reasoning replay. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2fc85bdc1bd2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Responses replay parsed persisted thinking signatures without validating their JSON shape, so corrupt or unrelated values could prevent every later turn in a session. Parse signatures in the shared replay owner and accept only reasoning records. Cover malformed syntax, null, arrays, and wrong item types through both provider- and transport-style converters.
fb2f5b1 to
1d15dae
Compare
|
Added release-shaped OCM A/B behavior proof to the PR body for exact head The proof used package runtimes for the pre-fix parent and PR head, OCM-managed loopback gateways, a strict local Responses-compatible endpoint, authentic gateway-created sessions, persisted SQLite history, a stop/mutate/integrity-check/restart boundary, and continuation of the same sessions through gateway WebSockets. Observed result:
|
|
Land-ready verification for head
No remaining proof gaps. The local provider was strict and credential-free; no real provider call was needed to prove the persisted replay boundary. |
|
Merged via squash.
|
…23228) Responses replay parsed persisted thinking signatures without validating their JSON shape, so corrupt or unrelated values could prevent every later turn in a session. Parse signatures in the shared replay owner and accept only reasoning records. Cover malformed syntax, null, arrays, and wrong item types through both provider- and transport-style converters.
What Problem This Solves
Fixes an issue where users continuing a Responses-provider session could have every later turn fail before the network request when persisted reasoning history contained malformed JSON or a non-reasoning JSON value.
Why This Change Was Made
The shared Responses replay converter now catches JSON parse failures and accepts only non-array records tagged as
type: "reasoning". Invalid persisted signatures are skipped while valid reasoning items and later assistant content continue through the same provider- and transport-style replay paths.User Impact
Sessions with truncated, imported, edited, or otherwise incompatible reasoning signatures remain usable. Valid reasoning history replays as before.
Evidence
Release-shaped OCM behavior proof
Built and ran isolated package runtimes for the exact pre-fix parent
57e862980beand PR head1d15daec194. Each runtime used an OCM-managed loopback gateway and a strict local OpenAI Responses-compatible endpoint with no credentials or real provider calls.The harness created sessions through the gateway so OpenClaw persisted authentic encrypted reasoning signatures in SQLite. It then stopped the gateways, changed copied session signatures transactionally, verified SQLite integrity, restarted the gateways, and continued the same sessions through gateway WebSockets.
57e862980be1d15daec194nullBoth provider- and transport-style converters were exercised. Successful post-fix requests retained assistant text and valid history. The valid control confirms the change does not disable reasoning replay.
Protocol cross-check:
openai/codex@97729885defines Responses items as atype-tagged enum with a structuredReasoningvariant incodex-rs/protocol/src/models.rs:814-860, and requestsreasoning.encrypted_contentincodex-rs/core/src/client.rs:907.Automated checks
pnpm test packages/ai/src/transports/openai-responses-compaction-replay.test.tsfailed for both converter styles at the sharedJSON.parse(2 failed, 38 passed). Blacksmith Testboxtbx_01m08sy5kqas8gptk11brsbmyx.null, arrays, and wrong item types for both converter styles. Blacksmith Testboxtbx_01m08t12nnkzt8817p80ng6bvk: https://github.com/openclaw/openclaw/actions/runs/32071314320pnpm check:changedpassed formatting, core and core-test typechecks, lint, import-cycle checks, and repository guards. Blacksmith Testboxtbx_01m08t3bdcznfyydfwma51x5tb: https://github.com/openclaw/openclaw/actions/runs/32071421182.agents/skills/autoreview/scripts/autoreview --mode uncommittedexited 0; TruffleHog clean; no accepted/actionable findings.AI-assisted maintainer rewrite. The original contributor remains the commit author.