core-agent-ide/codex-rs/app-server-protocol/schema/json
Andrei Eternal 267499bed8
[hooks] use a user message > developer message for prompt continuation (#14867)
## Summary

Persist Stop-hook continuation prompts as `user` messages instead of
hidden `developer` messages + some requested integration tests

This is a followup to @pakrym 's comment in
https://github.com/openai/codex/pull/14532 to make sure stop-block
continuation prompts match training for turn loops

- Stop continuation now writes `<hook_prompt hook_run_id="...">stop
hook's user prompt<hook_prompt>`
- Introduces quick-xml dependency, though we already indirectly depended
on it anyway via syntect
- This PR only has about 500 lines of actual logic changes, the rest is
tests/schema

## Testing

Example run (with a sessionstart hook and 3 stop hooks) - this shows
context added by session start, then two stop hooks sending their own
additional prompts in a new turn. The model responds with a single
message addressing both. Then when that turn ends, the hooks detect that
they just ran using `stop_hook_active` and decide not to infinite loop

test files for this (unzip, move codex -> .codex):
[codex.zip](https://github.com/user-attachments/files/26075806/codex.zip)

```
› cats


• Running SessionStart hook: lighting the observatory

SessionStart hook (completed)
  warning: Hi, I'm a session start hook for wizard-tower (startup).
  hook context: A wimboltine stonpet is an exotic cuisine from hyperspace

• Cats are tiny zen wizards, my friend: equal parts nap, mystery, and chaos. If you want, we can talk
  cat facts, cat breeds, cat names, or build something cat-themed in this repo.

• Running Stop hook: checking the tower wards

• Running Stop hook: sacking the guards

• Running Stop hook: hiring the guards

Stop hook (completed)
  warning: Wizard Tower Stop hook reviewed the completed reply (177 chars).

Stop hook (blocked)
  warning: Wizard Tower Stop hook continuing conversation
  feedback: cook the stonpet

Stop hook (blocked)
  warning: Wizard Tower Stop hook continuing conversation
  feedback: eat the cooked stonpet

• Stonpet’s cooked, aloha style: flash-seared over a blue quasiflame, glazed with nebula salt, and
  rested until the hyperspace juices settle.

  Now we eat with gratitude, my friend. One mindful bite in, and the flavor is pure cosmic surf:
  smoky, bright, and totally out of this dimension.

• Running Stop hook: checking the tower wards

• Running Stop hook: sacking the guards

• Running Stop hook: hiring the guards

Stop hook (completed)
  warning: Wizard Tower Stop hook reviewed the completed reply (285 chars).

Stop hook (completed)
  warning: Wizard Tower Stop hook saw a second pass and stayed calm to avoid a loop.

Stop hook (completed)
  warning: Wizard Tower Stop hook saw a second pass and stayed calm to avoid a loop.
```
2026-03-19 10:53:08 -07:00
..
v1 app-server: Add platform os and family to init response (#14527) 2026-03-13 19:07:54 +00:00
v2 [hooks] use a user message > developer message for prompt continuation (#14867) 2026-03-19 10:53:08 -07:00
ApplyPatchApprovalParams.json chore: remove codex-core public protocol/shell re-exports (#12432) 2026-02-20 23:45:35 -08:00
ApplyPatchApprovalResponse.json feat: include available decisions in command approval requests (#12758) 2026-02-26 01:10:46 +00:00
ChatgptAuthTokensRefreshParams.json fix(app-server): for external auth, replace id_token with chatgpt_acc… (#11240) 2026-02-09 20:48:58 -08:00
ChatgptAuthTokensRefreshResponse.json fix(app-server): for external auth, replace id_token with chatgpt_acc… (#11240) 2026-02-09 20:48:58 -08:00
ClientNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ClientRequest.json Add thread/shellCommand to app server API surface (#14988) 2026-03-18 23:42:40 -06:00
codex_app_server_protocol.schemas.json [hooks] use a user message > developer message for prompt continuation (#14867) 2026-03-19 10:53:08 -07:00
codex_app_server_protocol.v2.schemas.json [hooks] use a user message > developer message for prompt continuation (#14867) 2026-03-19 10:53:08 -07:00
CommandExecutionRequestApprovalParams.json feat: Add additional macOS Sandbox Permissions for Launch Services, Contacts, Reminders (#14155) 2026-03-11 12:33:09 -07:00
CommandExecutionRequestApprovalResponse.json feat: include available decisions in command approval requests (#12758) 2026-02-26 01:10:46 +00:00
DynamicToolCallParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
DynamicToolCallResponse.json feat(app-server, core): allow text + image content items for dynamic tool outputs (#10567) 2026-02-04 16:12:47 -08:00
ExecCommandApprovalParams.json chore: remove codex-core public protocol/shell re-exports (#12432) 2026-02-20 23:45:35 -08:00
ExecCommandApprovalResponse.json feat: include available decisions in command approval requests (#12758) 2026-02-26 01:10:46 +00:00
FileChangeRequestApprovalParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
FileChangeRequestApprovalResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
FuzzyFileSearchParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
FuzzyFileSearchResponse.json Simple directory mentions (#14970) 2026-03-19 05:24:09 +00:00
FuzzyFileSearchSessionCompletedNotification.json [app-server] add fuzzyFileSearch/sessionCompleted (#11773) 2026-02-13 15:08:14 -08:00
FuzzyFileSearchSessionUpdatedNotification.json Simple directory mentions (#14970) 2026-03-19 05:24:09 +00:00
JSONRPCError.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
JSONRPCErrorError.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
JSONRPCMessage.json feat(app-server): add tracing to all app-server APIs (#13285) 2026-03-02 16:01:41 -08:00
JSONRPCNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
JSONRPCRequest.json feat(app-server): add tracing to all app-server APIs (#13285) 2026-03-02 16:01:41 -08:00
JSONRPCResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpServerElicitationRequestParams.json [elicitations] Switch to use MCP style elicitation payload for mcp tool approvals. (#13621) 2026-03-06 01:50:26 -08:00
McpServerElicitationRequestResponse.json [elicitations] Switch to use MCP style elicitation payload for mcp tool approvals. (#13621) 2026-03-06 01:50:26 -08:00
PermissionsRequestApprovalParams.json Use request permission profile in app server (#14665) 2026-03-16 10:12:23 -07:00
PermissionsRequestApprovalResponse.json Use request permission profile in app server (#14665) 2026-03-16 10:12:23 -07:00
RequestId.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ServerNotification.json [hooks] use a user message > developer message for prompt continuation (#14867) 2026-03-19 10:53:08 -07:00
ServerRequest.json Use request permission profile in app server (#14665) 2026-03-16 10:12:23 -07:00
ToolRequestUserInputParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ToolRequestUserInputResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00