core-agent-ide/codex-rs/app-server/tests/suite/v2
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
..
account.rs Reduce app-server test timeout pressure (#13884) 2026-03-09 09:37:41 -07:00
analytics.rs feat(app-server): add tracing to all app-server APIs (#13285) 2026-03-02 16:01:41 -08:00
app_list.rs [apps] Fix apps enablement condition. (#14011) 2026-03-09 22:25:43 -07:00
collaboration_mode_list.rs Enable request_user_input in Default mode (#12735) 2026-02-25 15:20:46 -08:00
command_exec.rs refactor: make bubblewrap the default Linux sandbox (#13996) 2026-03-11 23:31:18 -07:00
compaction.rs Prefer websockets when providers support them (#13592) 2026-03-17 19:46:44 -07:00
config_rpc.rs Allow bool web_search in ToolsToml (#14352) 2026-03-11 12:33:10 -07:00
connection_handling_websocket.rs app-server: reject websocket requests with Origin headers (#14995) 2026-03-18 00:24:53 +00:00
connection_handling_websocket_unix.rs Stabilize websocket test server binding (#14002) 2026-03-09 23:39:56 -07:00
dynamic_tools.rs dynamic tool calls: add param exposeToContext to optionally hide tool (#14501) 2026-03-14 01:58:43 -07:00
experimental_api.rs Rename reject approval policy to granular (#14516) 2026-03-12 16:38:04 -07:00
experimental_feature_list.rs Agent jobs (spawn_agents_on_csv) + progress UI (#10935) 2026-02-24 21:00:19 +00:00
fs.rs app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
initialize.rs app-server: Add platform os and family to init response (#14527) 2026-03-13 19:07:54 +00:00
mcp_server_elicitation.rs Normalize MCP tool names to code-mode safe form (#14605) 2026-03-13 14:50:16 -07:00
mod.rs Add thread/shellCommand to app server API surface (#14988) 2026-03-18 23:42:40 -06:00
model_list.rs Add model availability NUX metadata (#12972) 2026-02-26 22:02:57 -08:00
output_schema.rs Add text element metadata to types (#9235) 2026-01-14 16:41:50 -08:00
plan_item.rs Stabilize plan item app-server tests (#14058) 2026-03-09 10:24:18 -07:00
plugin_install.rs feat: support product-scoped plugins. (#15041) 2026-03-19 00:46:15 -07:00
plugin_list.rs Support featured plugins (#15042) 2026-03-18 17:45:30 -07:00
plugin_read.rs feat: support product-scoped plugins. (#15041) 2026-03-19 00:46:15 -07:00
plugin_uninstall.rs Support featured plugins (#15042) 2026-03-18 17:45:30 -07:00
rate_limits.rs chore(app-server): delete v1 RPC methods and notifications (#13375) 2026-03-03 13:18:25 -08:00
realtime_conversation.rs Unify realtime shutdown in core (#14902) 2026-03-17 15:58:52 -07:00
request_permissions.rs Use request permission profile in app server (#14665) 2026-03-16 10:12:23 -07:00
request_user_input.rs app-server: Replay pending item requests on thread/resume (#12560) 2026-02-27 12:45:59 -08:00
review.rs app-server: Silence thread status changes caused by thread being created (#13079) 2026-03-03 00:52:28 +00:00
safety_check_downgrade.rs Chore: remove response model check and rely on header model for downgrade (#12061) 2026-02-18 01:50:06 +00:00
skills_list.rs Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
thread_archive.rs feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
thread_fork.rs Refactor cloud requirements error and surface in JSON-RPC error (#14504) 2026-03-13 03:30:51 +00:00
thread_list.rs feat: simplify DB further (#13771) 2026-03-07 03:48:36 -08:00
thread_loaded_list.rs [chore] move app server tests from chat completion to responses (#8939) 2026-01-08 22:27:55 +00:00
thread_metadata_update.rs feat: simplify DB further (#13771) 2026-03-07 03:48:36 -08:00
thread_name_websocket.rs Stabilize websocket test server binding (#14002) 2026-03-09 23:39:56 -07:00
thread_read.rs app-server: Update thread/name/set to support not-loaded threads (#13282) 2026-03-02 15:13:18 -08:00
thread_resume.rs feat: add memory citation to agent message (#14821) 2026-03-18 10:03:38 +00:00
thread_rollback.rs Add field to Thread object for the latest rename set for a given thread (#12301) 2026-02-20 18:26:57 -08:00
thread_shell_command.rs Add thread/shellCommand to app server API surface (#14988) 2026-03-18 23:42:40 -06:00
thread_start.rs Refactor cloud requirements error and surface in JSON-RPC error (#14504) 2026-03-13 03:30:51 +00:00
thread_status.rs app-server: expose loaded thread status via read/list and notifications (#11786) 2026-02-18 15:20:03 -08:00
thread_unarchive.rs Add field to Thread object for the latest rename set for a given thread (#12301) 2026-02-20 18:26:57 -08:00
thread_unsubscribe.rs Stabilize app-server notify initialize test (#13939) 2026-03-09 23:41:58 -07:00
turn_interrupt.rs app-server: Replay pending item requests on thread/resume (#12560) 2026-02-27 12:45:59 -08:00
turn_start.rs [hooks] use a user message > developer message for prompt continuation (#14867) 2026-03-19 10:53:08 -07:00
turn_start_zsh_fork.rs chore(app-server): stop emitting codex/event/ notifications (#14392) 2026-03-12 00:45:20 +00:00
turn_steer.rs chore(app-server): stop emitting codex/event/ notifications (#14392) 2026-03-12 00:45:20 +00:00
windows_sandbox_setup.rs app-server: require absolute cwd for windowsSandbox/setupStart (#13833) 2026-03-06 22:47:08 -08:00