Add an agent extension runner (#33076)

## What changed

- Add `codex-agent-extension` with an `AgentRunner` that starts a resolved agent prompt in a thread forked from its parent.
- Propagate the invocation's trace context, select the configured execution environments, submit the initial prompt, and return the spawned thread and turn identifiers.
- Reject empty agent prompts and report when the owning thread manager is no longer available.

## Testing

- Add an integration test that verifies the agent runs in a forked thread, returns the started turn identifier, completes the turn, and sends the resolved prompt to the model.

GitOrigin-RevId: ffb805efabadf758969d6611a6867db6fa9f059a
This commit is contained in:
jif authored and copyberry committed 2026-07-14 14:41:30 +00:00
1 parent 5bed644799
commit 6629e08702
7 files changed
+218

No files matched your search

+1
View File
@@ -120,6 +120,7 @@ fn sample_mcp_tool_call_event(thread_id: &str, plugin_id: Option<&str>) -> Track
event_params: CodexMcpToolCallEventParams {
base: CodexToolItemEventBase {
thread_id: thread_id.to_string(),
session_id: format!("session-{thread_id}"),
turn_id: "turn-1".to_string(),
item_id: format!("item-{thread_id}"),
app_server_client: CodexAppServerClientMetadata {