Drive the agent tools from Codex¶
New in 0.2
Not tested in Codex
This page was checked against the server code and the Codex docs. Nobody has run it in Codex yet.
Add astro-weights mcp RUN_DIR to Codex as a stdio MCP server and Codex becomes the editor.
You need the mcp extra, plus hf for forward_pass:
1. Make a run directory¶
Write RUN_DIR/run.json as in Drive the agent tools from Claude Code; every key is in Reference: CLI. Use an absolute RUN_DIR. Tools, result keys and refusals: Reference: MCP server.
2. Add the server¶
Or in ~/.codex/config.toml:
Syntax from the Codex MCP docs. Codex stops a tool call after tool_timeout_sec (60 s default per those docs). exec_python and forward_pass return a handle at once and the work runs in the background, so a long job does not hit that timeout; Codex polls status(handle).
3. Run¶
Start codex and ask it to use the astro-weights tools to edit the model and call finish when done.
Limits¶
- The server counts
code_runsandforward_passes. Codex's own tokens and dollars are not reported to the server, sotokensanddollarslimits do not cap a Codex session. Your own Codex limits and your provider's terms apply. - Codex also sees the editor tools
report_usage,check_spendandreport_refusal. - With no OS sandbox,
exec_pythonreturns an error; see Explanation: agent budgets and sandbox.
Not tested: this page was checked against the server code and the Codex docs, not run in Codex.