Repository navigation
feat(codex): record why settled-turn finalization context is unavailable - #124454
karmafeast wants to merge 1 commit into
Conversation
Return a private closed-reason capture result instead of collapsing every attestation failure to undefined. Valid context stays byte-equivalent; invalid branches stay fail-closed. Refs #1256 Co-authored-by: Copilot <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 20, 2026, 2:53 AM ET / 06:53 UTC. ClawSweeper reviewWhat this changesThe PR changes Codex settled-turn context capture to return closed rejection codes and logs the code with existing turn identifiers when finalization context is unavailable. Merge readiness⛔ Blocked until real behavior proof is added - 8 items remain Keep open: the proposed diagnostic still collapses genuine session-history failures and several host-prompt attestation failures into broad codes, so it does not yet preserve the promised cause. It also needs an after-fix warning from the unavailable-context path before merge. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Codex app-server extension mirrors turn events into OpenClaw transcript state before an embedded attempt can finalize a tool-only turn. The finalizer accepts only an attested frozen transcript; otherwise it emits an operator warning and leaves the attempt fail-closed. flowchart LR
A[Codex app-server turn] --> B[Attempt finalizer]
B --> C{Context capture needed}
C -->|yes| D[Transcript attestation]
D -->|valid| E[Frozen finalization context]
D -->|rejected| F[Unavailable-context warning]
C -->|no| G[Normal attempt completion]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +61, Tests +86. Total +147 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Return closed failure information from both the session-history reader and host-prompt adoption path, preserve the existing fail-closed finalizer behavior, then attach redacted output of an actual unavailable-context warning containing the resulting reason. Do we have a high-confidence way to reproduce the issue? Yes, from source: make the session-history reader return undefined or reject host-prompt adoption, then the changed capture path emits the broad codes identified above. No real unavailable-context warning was supplied. Is this the best way to solve the issue? No: the closed result is the right owner boundary, but it must include rejection information from session-history and host-prompt adoption rather than reclassifying both downstream. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c3051d453cc3. 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 (2 earlier review cycles)
|
|
withdrawn. diagnostics scatter and no real fix. #121204 will see refinement from causal graph back walk. current sickness seems to surround amplification of stale messages in multi-openclaw open-listen / 'always' activation, where we see stale message accumulation, reply to them as if new, and in a fashion that implies return of cached infer (almost identical text), pressure on sqlite, symptomatically. #124337 remains active and needs proof generation. |
Related: karmaterminal#1256
Coordinates with #124176 (does not absorb its
sessions_yieldskip).What Problem This Solves
Fixes an issue where operators would see an undifferentiated
codex settled-turn finalization context is unavailablewarning when a Codexturn had a tool result and no assistant text. The specific attestation failure
was erased, so the same warning covered missing history, duplicate identities,
boundary-order drift, and capture errors.
This is instrumentation only. It does not repair zero-payload delivery.
Why This Change Was Made
The capture owner now returns a private closed-reason result instead of
collapsing every rejection to
undefined. Valid frozen transcript context isunchanged. Invalid branches stay fail-closed: no synthesized history and no
Codex
turn/completedsummary substitute.The existing warning may add only the reason plus existing thread/turn/run
identities. Yield-specific capture skipping remains #124176's job.
User Impact
When settled-turn context capture fails, the existing warning now includes a
closed reason code. Successful turns are unchanged. No Plugin SDK, queue, or
delivery behavior change.
Evidence
Base:
acbbff19bad0a5539cd4725e6a6c8ae8e53f6694. Head:d74c71c0a3e585f5411c6ea1fac236ee30445299.extensions/codex/src/app-server/settled-turn-context.test.tsrequires one exact reason per rejection branch.
undefined); patch GREEN(21/21); patch-only revert RED; reapply GREEN.
reason,threadId,turnId, optionalrunId.review: no significant issues.
0.147.0(rust-v0.147.0/3ed6f04f6bf8b7c46299d1cb1ff99c74ce21a51d):turn/completedis last-agent-message summary only; OpenClaw still ownsmirror attestation.
here. No live fleet DB access.
Production LOC: +83/-22 (net +61) | Tests: +155/-69.