Skip to content

fix(scripts): return sessionPath instead of null when session state not found#2183

Open
jonckr wants to merge 1 commit intoYeachan-Heo:devfrom
jonckr:fix/persistent-mode-session-path-return
Open

fix(scripts): return sessionPath instead of null when session state not found#2183
jonckr wants to merge 1 commit intoYeachan-Heo:devfrom
jonckr:fix/persistent-mode-session-path-return

Conversation

@jonckr
Copy link
Copy Markdown

@jonckr jonckr commented Apr 5, 2026

Problem

In scripts/persistent-mode.cjs, readStateFileWithSession returns { state: null, path: null } when no matching session state is found. The path: null return causes shouldWriteStateBack to return false, silently skipping all state writes for that session.

Fix

Changed path: null to path: sessionPath, matching the .mjs implementation.

Evidence

The parallel .mjs implementation at scripts/persistent-mode.mjs:364 correctly returns { state: null, path: sessionPath }, preserving the intended write target.

Testing

  • node --check scripts/persistent-mode.cjs passes
  • npx tsc --noEmit passes
  • npm run lint passes
  • npm run build passes

…ot found

readStateFileWithSession returned path: null when no matching session
state was found, causing shouldWriteStateBack to return false and
silently skip all state updates. The .mjs counterpart correctly returns
the sessionPath at this branch, ensuring writes proceed to the
expected location.

Confidence: high
Scope-risk: narrow
Directive: Return value must match the .mjs parallel implementation at scripts/persistent-mode.mjs line 364
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant