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

Open
opened 2026-11-07 16:31:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4210
Author: @wyxu95
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: responses-agent-message


📝 Commits (1)

  • a00a4be serve: /v1/responses reads Codex's agent_message input items (multi-agent v2: a worker's task and its answer) as user messages instead of refusing them with a 400; test

📊 Changes

3 files changed (+34 additions, -1 deletions)

View changed files

📝 docs/DETAILS.md (+1 -1)
📝 serve/responses.py (+15 -0)
📝 serve/test_responses.py (+18 -0)

📄 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4210 **Author:** [@wyxu95](https://github.com/wyxu95) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `responses-agent-message` --- ### 📝 Commits (1) - [`a00a4be`](https://github.com/Niko1221/Strata/commit/a00a4be7ce82174cfff236f5084ba5d906a2a321) serve: /v1/responses reads Codex's agent_message input items (multi-agent v2: a worker's task and its answer) as user messages instead of refusing them with a 400; test ### 📊 Changes **3 files changed** (+34 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+1 -1) 📝 `serve/responses.py` (+15 -0) 📝 `serve/test_responses.py` (+18 -0) </details> ### 📄 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4951
No description provided.