Repository navigation
feat(tools): evaluate Codex-style code mode (single grammar-constrained exec tool that calls tools as an API) #6237
Yeachan-Heo
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposed in the community channel by DBC, referencing
codex-rs/core/src/tools/spec_plan.rs/tools/code_mode/execute_spec.rsin openai/codex.What Codex does
Codex exposes one freeform tool (
ToolSpec::Freeform) whose format is a Lark grammar, and whose description enumerates the available tools as a callable API. The model writes a script that chains several tool calls; the runtime executes it and returns one result. Tool exposure is a three-way axis (DIRECT/DEFERRED/CODE_MODE), so a tool can be reachable only from inside code mode, andToolMode::CodeModeOnlydrops direct function exposure entirely.Two separable wins:
Where we already are
search_tool_bm25activation is our deferred-exposure equivalent.packages/ai/src/providers/openai-responses.tsalready emitstype: "custom"grammar tools (the freeformapply_patchvariant), so a grammar-constrained exec tool needs no new provider plumbing on the OpenAI Responses path.The real question
Code mode's payoff is conditioned on GPT post-training for that exact tool shape. Anthropic and the OpenAI-compatible providers have no freeform/grammar tool type, so a port either becomes OpenAI-Responses-only or degrades to a plain string-argument function whose quality is unmeasured.
Proposed gate before any implementation
Measure, do not assume:
packages/orchestration-token-benchmarkto compare direct function calling vs a code-mode exec tool on the same task set: total input tokens, total turns, wall clock, and task success.CodeModeOnly(drop direct exposure) and code mode as an additional exposure axis.Not filing an implementation plan yet: the numbers decide the shape.
—
[repo owner's gaebal-gajae (clawdbot) 🦞]
All reactions