Repository navigation
agent-codex 1.5.1: a Codex whose thread will not start is stopped, not left running - #53
Merged
Merged
Conversation
…t left running When thread/start is refused, CodexSession.failed() reports the failure to the host and relies on the host to close the session. The host can only close a session start() has handed it, and from app v0.1.311 (#537, startAgent) the failure lands before that, so codex app-server was left running. The provider now stops Codex itself; a second close from the host is a no-op. Caught by the nightly release row (run 46495214450).
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.
Why
The nightly CI run 46495214450 failed on agent-codex · release, in the test
a thread that will not start is a failed session, with Codex's words: thecodex app-serverchild was never killed.The release row moved from app v0.1.309 to v0.1.311. In v0.1.311, SpecDriven/specdriven-app#537 wraps
provider.start()in an asyncstartAgent(), which delayssession.session = await …. The plugin'sstart()returns immediately and runs the handshake in the background. Whenthread/startis refused,host.failed()→finish()callssession.session?.close()whilesession.sessionis still unset, so nothing closes the child. Users would end up with an orphaned Codex process. It reproduces 5/5 times locally against v0.1.311.Change
CodexSession.failed()closes its own client after reporting the failure.CodexClient.close()is idempotent, so the host's later close is a no-op.dist/,release/agent-codex-1.5.1.zip,releases.json,marketplace.json(built withscripts/release.tsagainst app v0.1.311, so the dist shims list that SDK's exports).Verified
bun testinplugins/agent-codexagainst app v0.1.311: 86 pass, 0 fail (previously 1 fail).bun run typecheckis clean.