Skip to content

fix(codex): ignore missing mirrored session history - #100484

Merged
vincentkoc merged 3 commits into
mainfrom
codex/repair-pr-99575
Jul 5, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
codex/repair-pr-99575

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Codex startup can read mirrored session history before the transcript file exists. The missing file was treated like malformed history, which emitted a misleading warning during a normal new-session race.

Related: #99575

Why This Change Was Made

Treat only ENOENT as empty mirrored history. Existing but unreadable or malformed transcripts still return the warning-triggering failure result.

This is a clean maintainer replacement for #99575 after GitHub's createCommitOnBranch mutation returned HTTP 499 while updating the contributor fork to current main. The original contributor commits and Alex Tang's authorship are preserved; the maintainer commit only narrows the tests and documents the lifecycle invariant.

User Impact

New Codex sessions no longer emit a false missing-history warning during startup. Real transcript read or parse failures remain visible.

Evidence

  • Local focused proof: 2 files, 11 tests passed.
  • Crabbox delegated Testbox proof: provider blacksmith-testbox, id tbx_01kwt620rby5h12z4e32wq1shd, 2 files and 11 tests passed.
  • The same Testbox ran pnpm check:changed; all selected extension production/test typecheck, lint, boundary, database-first, sidecar, and import-cycle gates passed.
  • Fresh branch autoreview reported no findings and rated the patch correct with 0.87 confidence.
  • Direct Codex app-server contract inspection confirmed thread/start creates new history while resume history is a separate API.

@vincentkoc
vincentkoc marked this pull request as ready for review July 5, 2026 22:41
@vincentkoc vincentkoc self-assigned this Jul 5, 2026
@vincentkoc
vincentkoc force-pushed the codex/repair-pr-99575 branch from 353caf9 to 6bff4ed Compare July 5, 2026 22:42
@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 6:52 PM ET / 22:52 UTC.

Summary
The PR changes the Codex mirrored session-history reader to return empty history for ENOENT, adds hook-level warning regression coverage, and keeps malformed transcript files on the existing failure path.

PR surface: Source +8, Tests +47. Total +55 across 3 files.

Reproducibility: yes. source-reproducible: current main turns any mirrored-history read error into undefined, and the caller logs the reported warning for undefined. I did not run tests because this cleanup review is read-only, but the PR body includes real terminal and Testbox proof for the after-fix path.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/codex/src/app-server/session-history.test.ts, serialized state: extensions/codex/src/app-server/session-history.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #100484
Summary: This PR is the canonical current-base maintainer replacement for the missing mirrored-history ENOENT fix, while a broader open issue tracks adjacent lifecycle and fallback failures.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrowed maintainer replacement once the normal exact-head merge gates pass, then close or supersede the related contributor PR with the preserved authorship context.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No cleanup or repair lane is needed; this maintainer PR is ready for normal maintainer landing once repository merge gates pass.

Security
Cleared: The diff only changes local file-read error classification and focused tests; it does not touch secrets, dependencies, CI, package execution, or permission boundaries.

Review details

Best possible solution:

Land this narrowed maintainer replacement once the normal exact-head merge gates pass, then close or supersede the related contributor PR with the preserved authorship context.

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

Yes, source-reproducible: current main turns any mirrored-history read error into undefined, and the caller logs the reported warning for undefined. I did not run tests because this cleanup review is read-only, but the PR body includes real terminal and Testbox proof for the after-fix path.

Is this the best way to solve the issue?

Yes. Handling only ENOENT in the lower mirrored-history reader is the best fix because it matches the new-session lifecycle and is narrower than suppressing the wrapper warning for all failures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a905eb42acda.

Label changes

Label changes:

  • add P3: The PR fixes low-risk Codex extension warning noise during a healthy startup race without changing user data, auth, provider routing, or message delivery semantics.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer PR, so the external-contributor proof gate does not apply; the PR body still includes focused Testbox and terminal proof for the changed Codex behavior.

Label justifications:

  • P3: The PR fixes low-risk Codex extension warning noise during a healthy startup race without changing user data, auth, provider routing, or message delivery semantics.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer PR, so the external-contributor proof gate does not apply; the PR body still includes focused Testbox and terminal proof for the changed Codex behavior.
Evidence reviewed

PR surface:

Source +8, Tests +47. Total +55 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 9 1 +8
Tests 2 49 2 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 58 3 +55

What I checked:

Likely related people:

  • jalehman: Commit 258b83c migrated plugin transcript mirrors and changed the Codex session-history reader, attempt-context wrapper, and run-attempt integration implicated by this PR. (role: introduced scoped mirror path; confidence: high; commits: 258b83c4386c; files: extensions/codex/src/app-server/session-history.ts, extensions/codex/src/app-server/attempt-context.ts, extensions/codex/src/app-server/run-attempt.ts)
  • steipete: Commit 71b79f0 touched Codex session-history replay sanitization and the related image-payload sanitizer, making this a useful routing candidate for mirrored-history behavior. (role: adjacent area contributor; confidence: medium; commits: 71b79f008d1d; files: extensions/codex/src/app-server/session-history.ts, extensions/codex/src/app-server/image-payload-sanitizer.ts)
  • 100yenadmin: Commit 414ecd2 recently changed Codex app-server run-attempt recovery behavior near this startup and turn-completion surface. (role: recent adjacent contributor; confidence: medium; commits: 414ecd2b9689; files: extensions/codex/src/app-server/run-attempt.ts)
  • vincentkoc: Recent current-main and PR history shows repeated Codex app-server maintenance in run-attempt/auth startup surfaces, and this maintainer branch is the current replacement path for the related contributor PR. (role: recent area contributor; confidence: medium; commits: e085fa1a3ffd, f1cc8f0cfc7c, 6bff4ed65fdc; files: extensions/codex/src/app-server/run-attempt.ts, extensions/codex/src/app-server/session-history.ts, extensions/codex/src/app-server/attempt-context.test.ts)
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.

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.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for 6bff4ed65fdc9f20f714cf6efe762b594cb35ad9:

  • Local: node scripts/run-vitest.mjs extensions/codex/src/app-server/session-history.test.ts extensions/codex/src/app-server/attempt-context.test.ts — 2 files, 11 tests passed.
  • Crabbox delegated Testbox: provider blacksmith-testbox, id tbx_01kwt620rby5h12z4e32wq1shd — the same 2 files and 11 tests passed.
  • Same Testbox: pnpm check:changed — selected extension production/test typecheck, lint, boundary, database-first, sidecar, and import-cycle gates passed.
  • Fresh autoreview: no findings; patch rated correct with 0.86 confidence.
  • Exact-head CI: run 28757417968 completed successfully.
  • Native scripts/pr prepare-run 100484: passed; prepared head equals PR head.

No known proof gaps. The original contributor commits and Alex Tang's authorship are preserved from #99575.

@vincentkoc
vincentkoc merged commit 17ba497 into main Jul 5, 2026
112 of 116 checks passed
@vincentkoc
vincentkoc deleted the codex/repair-pr-99575 branch July 5, 2026 23:04
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(codex): ignore missing mirrored session history

* test(codex): prove missing mirrored history stays quiet

* fix(codex): narrow missing history proof

---------

Co-authored-by: Alex Tang <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
* fix(codex): ignore missing mirrored session history

* test(codex): prove missing mirrored history stays quiet

* fix(codex): narrow missing history proof

---------

Co-authored-by: Alex Tang <[email protected]>
(cherry picked from commit 17ba497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants