You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bcf0e92
Browse filesBrowse the repository at this point in the historyBrowse files
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 ignored
`hook/completed`, which carries the hook's status and output.
## Changes
- **`hook/completed` with status `blocked` or `stopped` becomes a
warning**, sent the same way as other Codex warnings: a session
`notice`, an AIR `sessionFailure` advisory, or agent text.
- The title names the event and what it blocked, for example
`UserPromptSubmit hook blocked the prompt` or `PreToolUse hook blocked
the tool call`.
- The reason is the hook's output, without `context` entries.
- Hooks that complete or fail without blocking send nothing.
- **Advisory ids no longer repeat across prompts.** The id counter lived
in the per-prompt event handler, so the first advisory of every prompt
had the same id and revision. It is now shared, in `SessionFailureIds`.
- `readme-dev.md` documents hook notices.
## Testing
- Reproduced against real Codex with a blocking `UserPromptSubmit` hook.
After the fix, each prompt shows the reason with a distinct id.
- Tests cover all three warning paths, ACP v2, and distinct ids across
prompts.
The wording for events other than `UserPromptSubmit` was not checked
against real Codex.
Copy file name to clipboardExpand all lines: readme-dev.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ npm run package:all
101
101
### Session notices
102
102
103
103
The adapter implements [Session Notices](https://agentclientprotocol.com/rfds/session-notices)
104
-
for Codex warnings, configuration warnings, deprecation notices, model rerouting, and the legacy
104
+
for Codex warnings, configuration warnings, deprecation notices, model rerouting, hooks that block or stop Codex, and the legacy
105
105
`thread/compacted` advisory when the client advertises `clientCapabilities.session.notices: {}`.
106
106
These are live `session/update` notifications with
107
107
`sessionUpdate: "notice"`, a severity, a plain-text title, and optional description.
@@ -112,6 +112,10 @@ the existing assistant/thought text or AIR `sessionFailure` advisory records. Wh
112
112
enabled, they take precedence over AIR advisory records. Clients control their presentation;
113
113
the adapter does not rely on notices being displayed.
114
114
115
+
A hook notice is a warning titled with the hook event and what it did (for example `UserPromptSubmit hook blocked
116
+
the prompt` or `PreToolUse hook blocked the tool call`); its description holds the hook's `stop`, `feedback`, `error` and `warning` output. Hooks that complete
117
+
or fail without blocking send nothing, because Codex carries on as usual.
118
+
115
119
Command replies, review results, and terminal/retrying errors retain their existing response or
116
120
failure channels. Clients advertising session compaction support continue to receive the dedicated
117
121
compaction lifecycle instead of the legacy completion advisory.
0 commit comments