Skip to content

Resolve a Codex loop's real thread before reading its goal or resuming it (#346) - #352

Merged
scgopi merged 1 commit into
mainfrom
fix/346-codex-thread-id
Sep 13, 2026
Merged

scgopi merged 1 commit into
mainfrom
fix/346-codex-thread-id

Conversation

@scgopi

@scgopi scgopi commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Follow-up to #350 and #351 (#346), Codex only.

What the live run on 0.1.70-beta3 found

Codex's notify hook banks the thread-id of the event it receives. For a Codex goal loop that opens on /goal, that id named a thread Codex never persisted: no rollout, no row in Codex's own threads table, no goal. The loop's real thread held the goal and completed it, but:

  • the daemon asked for the goal on the banked id, so it could not read Codex's own verdict, and the loop only resolved because it also ran graphcode node done
  • resuming the loop used the same id, which would fail and fall back to a fresh launch

What changes

For Codex loops only, the thread id is resolved against Codex's own state database before it is used. The banked id is kept when Codex knows it as a thread. Otherwise the loop's real thread is found by its node id, which appears in the launch line Codex records as the thread's first message.

Both uses go through it: reading the Codex goal verdict, and resuming a local Codex session. Claude Code, Copilot CLI, OpenCode and pi are untouched.

…g it (#346)

Codex's notify hook banks the thread-id of the event it receives. For a
goal loop that opens on /goal, that id named a thread Codex never
persisted: no rollout, no row in its threads table, no goal. The daemon
read the goal verdict from it and found nothing, and a resume would have
failed over to a fresh launch.

For Codex only, the banked id is checked against Codex's own state
database; when Codex does not know it, the loop's real thread is found by
the node id its launch line carries. The goal verdict and the local
resume both use it. Other backends are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scgopi
scgopi merged commit cc2b482 into main Sep 13, 2026
1 check passed
scgopi added a commit that referenced this pull request Sep 13, 2026
PR #352 landed with one [LineLength] violation, so `make check` exited 2 on
main. Formatter output only, no semantic change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016n4hSXVu6wLR4RCfnt6PPG
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