Skip to content

feat: enable Codex subagent tool calls - #210

Merged
yongkangc merged 2 commits into
cfal:mainfrom
0xSolarPunk:feat/codex-subagent-tools
Jun 23, 2026
Merged

feat: enable Codex subagent tool calls#210
yongkangc merged 2 commits into
cfal:mainfrom
0xSolarPunk:feat/codex-subagent-tools

Conversation

@0xSolarPunk

Copy link
Copy Markdown
Contributor

Summary

  • Add an explicit codex-subagent-tool-use shared message contract for official Codex subagent actions.
  • Convert Codex JSONL function_call rows and app-server dynamicToolCall rows into the typed message instead of external/unknown tool-use rows.
  • Render Codex subagent calls with a first-class Subagent card, result card, and frontend/server contract tests.

Upstream Codex reference

Checked current openai/codex main via GitHub/clone at e0ac5d3c1552b4eb2c11d1f7e215bb933c78ad99.

This PR does not enable subagent execution in a Codex runtime that lacks the collaboration tools. It makes Garcon typed/render-correct when Codex emits the upstream spawn_agent, send_message, followup_task, wait_agent, interrupt_agent, list_agents, send_input, close_agent, or resume_agent tool calls.

Screenshots

Desktop:

Codex subagent tool desktop

Mobile:

Codex subagent tool mobile

Validation

  • bun test server/agents/codex/__tests__/jsonl-tool-use-converter.test.js server/agents/codex/app-server/__tests__/app-server.test.js passes: 52 tests.
  • bun run --cwd web test -- src/lib/chat/__tests__/tool-roundtrip.test.ts src/lib/chat/__tests__/tool-display-registry.test.ts src/lib/components/chat/tools/__tests__/ChatToolEventRenderer.test.ts passes: 92 tests.
  • bun run check passes: ESLint and Svelte check report 0 errors / 0 warnings.
  • bun run start --port 0 builds and starts a throwaway server at http://0.0.0.0:41673; timeout then stops the foreground smoke process.
  • bun run test is blocked by the existing Bun environment missing CompressionStream; failures are isolated to server/lib/__tests__/http-compression.test.js compression round-trip/skip-rule cases.

Migration note

Known Codex subagent calls now cross the shared boundary as codex-subagent-tool-use instead of external-tool-use / unknown-tool-use. Frontend behavior resolves by message type and no client path keys off raw provider tool names for this family.

Checklist

  • Scope is focused and behavior is covered by tests
  • API/WS contract changes include type and test updates

@0xSolarPunk

Copy link
Copy Markdown
Contributor Author

Review/fix pass completed. No existing review comments were present. Fixed formatting noise in commit 098b030. Focused validation passed: bun run --cwd web test -- src/lib/chat/__tests__/tool-display-registry.test.ts src/lib/chat/__tests__/tool-roundtrip.test.ts src/lib/components/chat/tools/__tests__/ChatToolEventRenderer.test.ts -> 92 passed. GitHub checks are green again. The stacked dogfood run on #211 also exercises this base renderer path on a separate rebuilt server.

@yongkangc
yongkangc merged commit ea08275 into cfal:main Jun 23, 2026
4 checks passed
@yongkangc yongkangc changed the title Render Codex subagent tool calls feat: enable Codex subagent tool calls Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants