Repository navigation
Conversation
|
Thanks for the context here. I did a careful shell check against current Current main already treats empty or whitespace-only Codex mirrored session history as empty history, and that behavior has shipped; the PR head is based on the older bare-session-file reader and no longer carries a mergeable unique fix. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the shipped scoped-session implementation from the transcript mirror refactor; if maintainers want explicit whitespace-only regression coverage, open a fresh test-only PR against the current scoped target API. Do we have a high-confidence way to reproduce the issue? Yes, at source level for the old reader: whitespace-only content parses to zero entries and the old code would continue to the malformed-header path, while current main returns []. I did not run tests because this review was required to keep the checkout read-only. Is this the best way to solve the issue? Yes, current main is the better solution because it treats all parsed-empty history as empty after parser normalization and preserves the scoped transcript target API. The PR's raw trim guard is now an obsolete narrower patch against an older reader signature. Security review: Security review cleared: The PR only changes Codex session-history reader behavior and colocated tests; no dependency, workflow, secret, permission, or code-execution surface is changed. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f188c664c0e7; fix evidence: release v2026.6.11-beta.1, commit 258b83c4386c. |
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
Codex app-server attempts can log
failed to read mirrored session history for codex harness hookswhen harness hooks read mirrored session history during a new-session startup race.Two transient states should be treated as empty history instead of failed history reads: the mirrored session file has not been created yet, or it exists but contains only whitespace before the session header has been written.
Why This Change Was Made
Missing or empty mirrored history means there is nothing to replay yet. That is not the same as a malformed transcript, and warning for it creates noisy gateway logs during otherwise healthy cron/session startup.
This change returns
[]for missing and empty mirrored session files, while preservingundefinedfor malformed non-empty files so the existing warning path still catches real transcript corruption.User Impact
Operators should stop seeing repeated Codex embedded-runtime warning bursts for healthy new sessions whose mirrored history artifact is created or populated shortly after the harness hook runs.
Malformed non-empty session history still surfaces as a warning, so real transcript issues remain diagnosable.
Evidence
/tmp/openclaw/openclaw-2026-07-03.log:failed to read mirrored session history for codex harness hooksappeared for yuantai cron sessions before the corresponding JSONL file's first record timestamp; after the run completed, those files parsed successfully.node scripts/run-vitest.mjs extensions/codex/src/app-server/session-history.test.tspassed with7tests.git diff --checkpassed.pnpm install --frozen-lockfilecompleted in the rebased worktree before running the test wrapper.Real behavior proof
Behavior addressed: Codex harness hook history reads should not warn when a mirrored session file is missing or empty during a new-session startup race.
Real environment tested: local OpenClaw gateway logs from
2026-07-03under the user's active~/.openclawstate, plus the current source checkout rebased ontoupstream/mainat0420aefb1d.Exact post-patch command/steps:
Evidence after fix: the new tests verify missing
session.jsonland whitespace-onlysession.jsonlreturn[]; a malformed non-empty JSONL row still returnsundefined, preserving the existing warning path for real corruption.Observed result: the targeted test file passed with
7tests.What was not tested: a full live gateway run with a patched local OpenClaw install was not performed; the behavior is covered at the reader boundary that controls whether the harness warning is emitted.