Repository navigation
Read daemon-owned rollouts for hand-typed Codex - #840
Merged
Merged
Conversation
A Codex 0.157+ TUI attached to the shared daemon holds no rollout, so the log provider found nothing and detection relied on the screen alone. - When the TUI's open files are complete and hold no rollout, read the rollouts the pane drives through the daemon: the root thread of the pane's newest indexed submit and its descendants. The session log must belong to the current TUI process. - Start a newly bound rollout at the live task_started of that submit. Binding happens after the user item lands, which is after the turn started, so starting at the file end would miss the open turn. - Honor the live boundary of forked rollouts in the thread index. - Record the change in docs-ai 073.002.
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.
Problem
CodexLogProviderfinds Codex rollouts through the open files of the pane's TUI process. A Codex 0.157+ TUI typed by hand attaches to the shared app-server daemon, which owns every rollout, so the TUI holds none. The state machine reportedscreen.noLiveTurnand relied on the screen alone. That is how the original symptom surfaced: a 0.158 footer change hid the Working row (#838), and nothing else knew the turn was open.Change
CodexDaemonThreadMapper(from Resolve CLI callers under Codex's shared daemon #839) for the pane's binding: the root thread of the pane's newest indexed submit plus every descendant the daemon holds open. It feeds those rollouts into the existing incremental decoder, so lineage, subagent work, and suspension rules are unchanged.task_startedthat precedes the bound submit, not at the file end. Binding happens only after the turn's user item lands, which is aftertask_started; starting at the end would miss the open turn of a resumed, older rollout./forkwrites only the fork's own items, and a forked subagent copiestask_startedbut not user items before itsthread_settings_applied.daemon.pidunder the TUI's ownCODEX_HOME, and the pid must still be the managed daemon.--no-daemon) is unchanged: its TUI owns its rollouts and is read directly.docs/components/agent-detection.mdanddocs-ai/073-codex-daemon-caller-identity/002-daemon-log-detection.md.Verification
daemon.pidvalidation.make check,make test(3599 passed, 0 failed insupacode-tests), andmake build-apppass.CODEX_HOMEdaemon, two hand-typed Codex panes in one cwd (prowl agents --json, sampled every 2 s):detection_reasonscreen.noLiveTurn(unbound, as before)sleep 40/sleep 15turnslog.openWork, thenlog.turnEndedat its own endsleep 20while the parent waitslog.openWorkthroughout/new, then a new turnlog.openWorkon the new threadlog.openWorkthroughoutcodex resumeof a thread created before the provider, then a turnlog.openWorklog.turnEnded