#4210 [Engine] serve: /v1/responses accepts Codex's agent_message input items (multi-agent v2 workers)

closed · @wyxu95 · 0 comments · View on GitHub

Server & APIMulti-GPUSecurityDocumentationWindowsLinux

Description

Draft: the end-to-end run used the older revision 7dd5cf1 with this patch, and only one model family (see Validation).

## Problem and result

Codex's multi-agent v2 sends the task the parent agent gives a worker, and the worker's answer, as `agent_message`
input items on `/v1/responses`. Strata refused them, so every worker request failed:

```
{"error": {"message": "input items of type 'agent_message' are not supported", "type": "invalid_request_error", "param": "input[58].type", "code": "unsupported_parameter"}}
```

- Before: a Codex Security scan (it turns on multi-agent v2 and starts workers) stopped in its threat-model phase
  with this error.
- After: the same scan completed. Its 4 workers each got their task and sent back their answer.

## Approach

An `agent_message` item becomes a user message. Its content is an `input_text` header that Codex writes
(`Message Type: NEW_TASK`, `Task name`, `Sender`, `Payload:`) and, for a task, an `encrypted_content` part with the
payload. When the agents run on this server, that part holds the task as plain text, so it is read as text. Other
input items and the requests without `agent_message` items are rendered as before. `docs/DETAILS.md` lists the new
item type.

## Validation

Passed:
- `python -m unittest serve.test_responses` at a00a4be (this branch, on 4b9e05a): 42 tests, OK (1 skipped). The new
  test `test_agent_messages_become_user_messages` covers a worker's task (with `encrypted_content`) and a worker's
  answer after a `spawn_agent` call.
- End to end on Linux, 2x H100 80GB, DeepSeek-V4.1-Flash IST-DAS-2.25bpw, Strata 7dd5cf1 with this patch
  (`serve/responses.py` and `serve/test_responses.py` are the same at 7dd5cf1 and 4b9e05a): Codex Security CLI 0.6.0
  with its bundled Codex CLI 0.163.0, a standard scan of a small Flask repository, multi-agent v2 on (its default).
  Before the patch, the run stopped with the error above. With the patch, the scan completed in 37 minutes. The
  Codex session files show 4 workers (`baseline_auditor`, `architecture_reviewer`, `sql_injection_investigator`,
  `command_injection_investigator`). Each got a `NEW_TASK` and sent a `FINAL_ANSWER`, and no answer was an error.
  The container has no user namespaces, so Codex ran its commands with `--dangerously-bypass-approvals-and-sandbox`.
  That changes where Codex runs commands, not the requests it sends to Strata.

Failed: none observed.

Not run:
- The end-to-end run at 4b9e05a (it ran at 7dd5cf1, see above).
- Other model families (Qwen) end to end, Windows, macOS, and Codex versions other than 0.163.0.
- GPU builds: the change is Python only.

## Limits

- The model sees the header Codex writes, not the item's `author` and `recipient` fields.
- An `encrypted_content` part that another server encrypted (for example, from a conversation that started on
  OpenAI's servers) goes into the prompt as its opaque text.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Related on this site

Quick links to related pages.