Repository navigation
Description
TL;DR: Codex threads inside T3 Code cannot use OpenAI's bundled workspace-dependency loader (codex_app.load_workspace_dependencies), so any Codex skill that needs the bundled runtime (spreadsheet/artifact tools, @oai/artifact-tool) fails inside T3 while working fine in the plain Codex CLI. The fix is a small host-side integration in T3's Codex provider: register the tool via dynamicTools at thread/start and answer the resulting item/tool/call server request.
A complete, tested implementation is attached as a git patch (6 files, +728/−46, includes tests and a live probe script): 0001-feat-codex-load-workspace-dependencies-through-host-.patch. It was developed against v0.0.33, re-applied to v0.0.34 with zero conflicts, and both bases pass the full verification below. Checked main @ 053affbe (2026-08-29): no equivalent exists upstream yet (load_workspace_dependencies and dynamicTools have zero hits repo-wide).
The real-world failure this fixes
This was hit in production use, not found by code reading. A long-running Codex agent thread in T3 was building editor video libraries for three brands and had to deliver XLSX catalogs via the Codex spreadsheet skill. The run went fine until the spreadsheet step, then hard-blocked:
- The spreadsheet plugin itself was installed and enabled, but its companion bundled app-tools server (
codex_app) showed up as disabled in the host's MCP list, with Codex reporting "MCP is disabled and cannot be enabled safely inside the running host session." - Three consecutive capability checks found no
load_workspace_dependenciestool, so the agent formally declared the goal blocked. No amount ofcodex mcp list/codex mcp get codex_appdiagnostics, config edits, or restarts could enable it, because the tool can only come from the host (see below). - The same workflow works in the plain Codex CLI, so from a user's perspective T3 is the component that breaks Codex's bundled skills (spreadsheets, presentations — anything needing
@oai/artifact-tool).
The agent had to fall back to a temporary non-canonical workbook writer to produce interim files — a workaround, not a fix. With the attached patch applied and a live round trip verified, the loader is callable again and the blocked run completed.
Root cause
T3 drives Codex through codex app-server, not the interactive CLI. In that mode, codex_app.load_workspace_dependencies is not a normal MCP server the user can enable in ~/.codex/config.toml — it is a host-provided tool. The host must:
- register it through the
dynamicToolsfield ofthread/start, and - serve the resulting
item/tool/callrequest with the bundled runtime paths.
T3 currently does neither, so inside T3 the tool never exists — which is why no user-side remedy works. Enabling the bundled server via config or CODEX_APP_TOOLS_PIPE_PATH was tested and is a dead end: it starts but fails during tools/list because the host-managed IPC pipe is missing.
Current state of main (still true at 053affbe, 2026-08-29):
apps/server/src/provider/Layers/CodexSessionRuntime.ts—buildThreadStartParamssends only cwd/approvals/sandbox/model/serviceTier; no dynamic tools.apps/server/src/provider/Layers/CodexAdapter.ts—item/tool/callis recognized but only surfaced to the UI as a genericdynamic_tool_callrequest; nothing answers it.packages/effect-codex-app-servergenerated schema has nodynamicToolsfield onthread/startat all, and it strips unknown fields, so the registration cannot even be passed through today.
Proposed implementation
This mirrors the attached patch (baseline v0.0.33, re-verified on v0.0.34):
- New module
apps/server/src/provider/Layers/CodexWorkspaceDependencies.ts:workspaceDependencyDynamicTools— the tool declaration (codex_appnamespace, no arguments).handleWorkspaceDependencyToolCall(payload, environment, platform)— validates the bundled runtime manifest and@oai/artifact-tool, rejects unexpected arguments, and returns the Node path,node_modulespath, Python path, override-binary and fallback-binary paths.
thread/start: includedynamicToolsin the start params. Because the pinned generated schema strips unknown fields, the patch routes onlythread/startthrough the validated raw request path. For upstream the cleaner fix is to regenerateeffect-codex-app-serverfrom a current app-server spec sodynamicToolsis a first-class field (the protocol supports it; T3 already enables the experimental API).thread/resume: deliberately does not resenddynamicTools. Codex restores the tool from the saved rollout; the live probe confirms a resumed thread can still call the loader.thread/resumestays fully schema-checked.item/tool/call: answer the request in the Codex session runtime with the loader response instead of only forwarding it to the UI as an approval event.
Verification shipped with the patch
- 43 focused tests green (
CodexSessionRuntime.test.ts,CodexWorkspaceDependencies.test.ts): fresh registration, resume without tool replacement, recoverable-resume fallback, manifest validation, argument rejection, and a host-handler invocation. Lint and typecheck pass — on bothv0.0.33andv0.0.34. - A live probe script (
apps/server/scripts/probe-workspace-dependency-tool.ts, included) runs a realcodex app-serverround trip: fresh thread calls the loader, then the thread is resumed withoutdynamicToolsand calls it again. It printsLIVE_LOADER_CALL_OKwithfreshCallSuccess: trueandresumedCallSuccess: true.
Suggested acceptance criteria:
- A fresh Codex thread in T3 exposes
codex_app.load_workspace_dependencies. - The tool successfully loads
@oai/artifact-tool. - A resumed thread still exposes and can call it.
- A Codex skill that generates an XLSX works end to end inside T3.
Notes
- The generic
dynamicTools+item/tool/callplumbing is reusable: once in place, any future host-provided Codex tool can ride the same path. - Independently reviewed with GPT-5 Codex before implementation; the "just add an MCP stanza" route was tested and confirmed a dead end (starts, then fails
tools/listwithout the host broker). - Happy to open this as a PR instead if that's preferred — the patch applies cleanly to current tags with
git am -3.
Patch developed and verified locally on T3 Code v0.0.33/v0.0.34, Linux x86_64. Until this lands upstream we re-apply it after every auto-update, so shipping it natively would be much appreciated.
Activity
Squashed '.repos/effect-smol/' changes from a43c7e244c..e17ecdbe90