Skip to content

feat: agents can run one program that makes many tool calls - #26

Merged
collissimo merged 4 commits into
collin/mainfrom
t3/factory-feature-integration
Oct 31, 2026
Merged

collissimo merged 4 commits into
collin/mainfrom
t3/factory-feature-integration

Conversation

@collissimo

Copy link
Copy Markdown
Owner

Factory's Droid 1.0 makes programmatic tool calling its default: the model writes one program that makes many tool calls, and only what the program prints reaches its context. T3 Code does not own the model loop, so it has to add this at the provider boundary.

What changed

  • Codex: Code mode switch, per account in Settings → Providers, off by default. It starts codex app-server --enable code_mode, Codex's native version. Nested calls arrive as ordinary commandExecution items, so the timeline already shows them.
  • All providers: script MCP tool, switched in Settings → Labs and on mobile, off by default. It runs JavaScript in a child process with tools.read, write, exec, grep, and every T3 tool, at most 16 calls at once, 1,000 per script, 5 minutes per run, and 30,000 printed characters.
  • With the switch off the tool is not listed and calls are refused.
Provider Decision
Codex Native Code mode, plus the script tool with instructions
Claude Script tool with instructions, since the Agent SDK has no equivalent option
Cursor, Grok, OpenCode, Antigravity, ACP, Pi Script tool through its description only; not run on these providers

Limits

  • Script calls skip provider permission prompts and hooks, so the tool refuses any thread that is not full access and rechecks before every nested call. node:vm is not a security boundary; the gate is that a full-access agent already has a shell.
  • The script tool cannot reach MCP servers configured inside a provider, such as Linear. Codex Code mode can.
  • A script can call any T3 tool in a loop, including delegate_task.
  • The timeline shows a script as one tool call, not its nested calls.
  • Codex marks code_mode as under development.

Measured

Real turns on the dev server, one sample each:

  • Claude Sonnet chose script by itself to read every thread in a project. It kept native tools for a 40-file edit, and Haiku kept them for a file search.
  • No token saving is shown yet. A forced Haiku script turn cost 155k input tokens in 3 requests, about the same as a comparable direct turn (153k, 3 requests).
  • Codex with code_mode: 55k against 35k input tokens on a 6-file task, and 30.8k against 30.9k on a 40-file task.

Verification

  • vp run check:changed origin/collin/main: all pass except 13 ClaudeAdapterV2.test.ts Windows failures. The same 13 fail on collin/main without this change.
  • Real Claude turn ran a script with 4 nested calls, including a T3 tool. After switching off in the UI, a new thread's ToolSearch returned no script tool.
  • Real Codex turn through T3 with the switch on made custom_tool_call requests.
  • Bundled dist/script-sandbox-worker.mjs ran.

Not checked: evals (no API key on this machine, and the new text only appears with the switch on), single-executable builds, the desktop app, and the mobile switch on a device beyond typecheck. The new settings rows were checked in the web client; screenshots are not attached.

Model and harness: Claude Opus 5.5 in Claude Code, inside T3 Code.

🤖 Generated with Claude Code

collissimo and others added 4 commits October 31, 2026 17:45
Codex gets a per-account Code mode switch for its native code_mode. Every provider gets
an opt-in script MCP tool, switched in Settings > Labs and limited to full-access threads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Oct 31, 2026
@collissimo collissimo added the agent-context-increase Accepts growth of the agent context budget label Oct 31, 2026
@collissimo
collissimo merged commit f463309 into collin/main Oct 31, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-context-increase Accepts growth of the agent context budget size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant