Repository navigation
fix: report hooks that block or stop Codex - #767
Merged
Merged
Conversation
A blocking UserPromptSubmit hook ended every turn with no answer and no reason (IJAI-6099). hook/completed with status blocked or stopped now becomes a warning notice, an AIR sessionFailure advisory, or agent text, with the hook's output as the reason. Advisory ids are now numbered for the whole adapter process instead of per prompt, so the first advisory of each prompt no longer reuses the same id and revision.
On Linux Codex can stream the command output before the command completes, and then the completed update does not repeat it.
EugeneTheDev
pushed a commit
that referenced
this pull request
Nov 16, 2026
🤖 I have created a release *beep* *boop* --- ## [2.7.0](v2.6.0...v2.7.0) (2026-11-16) ### Features * report delegated tasks as session messages and reference children from tool calls ([#760](#760)) ([6567651](6567651)) * send structured plans as items plan_update when the client supports it ([#752](#752)) ([ab7a968](ab7a968)) * show the retry cause as details of the AIR retry warning ([#755](#755)) ([e981b3c](e981b3c)) ### Bug Fixes * Map priority mode to fast ([#327](#327)) ([52cc518](52cc518)) * report hooks that block or stop Codex ([#767](#767)) ([bcf0e92](bcf0e92)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
mrmans0n
added a commit
to mrmans0n/codex-acp
that referenced
this pull request
Nov 17, 2026
Upstream v2.7.0 (agentclientprotocol#767) replaces the event handler's session failure epoch with SessionFailureIds, a connection-wide counter that every prompt's event handler shares so notice and failure ids stay unique across handlers. The pre-prompt goal subscription still passed this.sessionFailureEpoch, which no longer exists: typecheck fails, and at run time the first notice or failure of goal work set before the first prompt throws. It now passes this.sessionFailureIds like the prompt subscription. Every other line is unchanged from 8f65eb8 (originally 9d2c300). A new test reports a hook that blocks such goal work (agentclientprotocol#767) as a typed AIR session failure; it fails with the old argument.
mrmans0n
added a commit
to mrmans0n/codex-acp
that referenced
this pull request
Nov 17, 2026
Upstream v2.7.0 (agentclientprotocol#760) stops advertising sessionCapabilities.subagents to standard clients: the scenario baseline now strips it from each recorded initialize response, and CodexAcpServer imports SessionFailureIds (agentclientprotocol#767) on the import line next to the patch's SessionInstructions import. The adaptation keeps upstream's subagents removal next to the patch's _meta.systemPrompt capability in the baseline and both notes in its comment. The sorted added and removed lines are identical to 57fdf79 (originally febcd2b); upstream v2.7.0 does not change the systemPrompt conversion that the _meta.systemPrompt.append alias feeds.
mrmans0n
added a commit
to mrmans0n/codex-acp
that referenced
this pull request
Nov 17, 2026
Upstream v2.7.0 (agentclientprotocol#760) adds an initialize test (sessionCapabilities.subagents only for AIR) at the position of the hook review initialize tests. Both are kept; the sorted added and removed lines are identical to 2662df6 (originally 2341b05). Upstream's agentclientprotocol#767 reports hook runs that block or stop Codex from hook/completed notifications, independently of the hook list and trust review, which v2.7.0 does not touch.
mrmans0n
added a commit
to mrmans0n/codex-acp
that referenced
this pull request
Nov 17, 2026
Upstream v2.7.0 (agentclientprotocol#767) replaces the event handler's session failure epoch and per-handler notice counter with SessionFailureIds, one counter per connection that every prompt's handler shares, and passes it as the fourth constructor argument. 8aaab39 conflicted there: it kept the epoch string and numbered client-neutral incidents with the incident counter of its connection-wide NeutralSessionFailureLedger. Upstream's counter now does exactly that for both typed forms, with the same <epoch>:<n> id format, so the adaptation: - takes upstream's SessionFailureIds next to the format (the boolean AIR flag of upstream's own callers still means air or none); - allocates failure and notice ids from it in both forms and drops the ledger's now unused incident counter; - keeps the ledger's revision floor for the neutral form, which upstream does not have (a later handler can still re-send <turnId>:error); - passes this.capabilities.sessionFailureFormat and this.sessionFailureIds from the server, including the pre-prompt goal subscription. With agentclientprotocol#755 the retry warning carries the trimmed Codex additionalDetails as details; the neutral record follows the AIR lane's title and details rules, as docs/air-extensions.md already states, so the neutral retry test now expects them. With agentclientprotocol#767 a hook that blocks or stops Codex is a notice: a neutral client without session.notices gets it as a _meta.sessionFailure record with kind notice. New test for that; it and the existing neutral tests fail when the typed lane is AIR-only, and the later-prompt id test fails with per-handler ids. Adapted from 8aaab39 (originally 2a1384e).
mrmans0n
added a commit
to mrmans0n/codex-acp
that referenced
this pull request
Nov 17, 2026
Backport of the shell-approval integration test change in upstream bcf0e92 (agentclientprotocol#767), byte-identical. Codex can stream the command output before the command completes, and the completed update then does not repeat it. The test now looks for the output in any update of the command. `ci` on alas-based branches started failing this test on GitHub runners (pinned @openai/codex unchanged), while upstream v2.7.0 already carries the fix. On the v2.7.0 sync this commit replays as an empty pick.
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.
A Codex hook that blocks or stops the prompt ended the turn with a bare
end_turn: no answer, no error, no reason. codex-acp ignoredhook/completed, which carries the hook's status and output.Changes
hook/completedwith statusblockedorstoppedbecomes a warning, sent the same way as other Codex warnings: a sessionnotice, an AIRsessionFailureadvisory, or agent text.UserPromptSubmit hook blocked the promptorPreToolUse hook blocked the tool call.contextentries.SessionFailureIds.readme-dev.mddocuments hook notices.Testing
UserPromptSubmithook. After the fix, each prompt shows the reason with a distinct id.The wording for events other than
UserPromptSubmitwas not checked against real Codex.