fix(codex-wake): keep seeded thread usable — carry cwd, keep path, skip resume - #97
Open
alexanderyswork wants to merge 1 commit into
Open
Conversation
…ip resume A thread seeded inside the wake call has no rollout file until its first turn, so thread/resume always failed on it with 'no rollout found'. That failure left threadPath null, which silently disabled the session-log completion fallback — the only path that actually completes a turn on Codex CLI 0.145. Result: Codex answered, the answer sat in the session JSONL, and the daemon timed out without relaying it. - buildThreadStartParams now carries peer cwd/model, so a seeded thread no longer starts in / with no project instructions or workspace roots - the thread/start response path is kept as threadPath (it was discarded) - a freshly seeded thread is no longer resumed; re-seed shares one code path - normalizeWakeConfig preserves the resume flag, which it dropped entirely, making the injector's resume opt-out unreachable from real config Tests cover the gap that broke in production: relayFinalToMurmur with no threadId configured. Refs alexfrmn#96 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the root cause behind #96. Found while running Murmur on a small personal mesh (two Claude Code agents + Codex) — thanks for the project.
Problem
A thread seeded inside the wake call has no rollout file until its first turn, so
thread/resumealways fails on it withno rollout found. That failure leavesthreadPathnull, which silently disables the session-log completion fallback — the only path that actually completes a turn on Codex CLI 0.145. Codex answers, the answer sits in the session JSONL, and the daemon times out without relaying anything.Observed on a live mesh: with an explicit
threadIdthe reply relays in 10–15s viasource: "session-log"; without it every message ends incodex-app-server-turn-completion-timeout.Changes
buildThreadStartParamscarries peercwd/modelintothread/start. Previously a seeded thread started withcwd: null— verified on a live session:session_meta.cwd == "/", so no project instructions, wrong workspace roots and permissions. After the fix the same probe returns the configured project directory.thread/startresponsepathis kept asthreadPath; it used to be discarded, andthreadPathwas only ever taken fromthread/resume.normalizeWakeConfigpreserves theresumeflag — it dropped the field entirely, making the injector'speer.resume === falseopt-out unreachable from real config.Tests
Three new tests, each red before the change:
normalizeWakeConfig preserves the explicit resume opt-outbuildThreadStartParams carries peer cwd and model into thread/startCodex app-server injector keeps the seeded thread path and skips resume— covers the untested gap:relayFinalToMurmurwith nothreadId.node --test tests/codex-app-server-wake.test.mjs→ 19/19 pass.Full
npm test: 88/89. The single failure (collectPrometheusSnapshot,ERR_DLOPEN_FAILEDon an unbuiltbetter-sqlite3native module) reproduces identically on unmodifiedmain— unrelated.Also verified end-to-end after the change with
threadIdremoved from the config: the reply relays normally and Codex now runs in the configured working directory.Not addressed here
Deliberately out of scope, all listed in #96: single-WebSocket transport for start/resume/turn, cursor advancing on failed wakes (silent message loss), per-conversation threads, relay idempotency, head-of-line blocking in
WakeMonitor.drain.🤖 Generated with Claude Code