Skip to content

Codex bundled skills (spreadsheet/artifact) broken: host never registers codex_app.load_workspace_dependencies — dynamicTools patch included #8658

Closed as not planned

Description

@vinceo1

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_dependencies tool, so the agent formally declared the goal blocked. No amount of codex mcp list / codex mcp get codex_app diagnostics, 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:

  1. register it through the dynamicTools field of thread/start, and
  2. serve the resulting item/tool/call request 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 — buildThreadStartParams sends only cwd/approvals/sandbox/model/serviceTier; no dynamic tools.
  • apps/server/src/provider/Layers/CodexAdapter.ts — item/tool/call is recognized but only surfaced to the UI as a generic dynamic_tool_call request; nothing answers it.
  • packages/effect-codex-app-server generated schema has no dynamicTools field on thread/start at 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):

  1. New module apps/server/src/provider/Layers/CodexWorkspaceDependencies.ts:
    • workspaceDependencyDynamicTools — the tool declaration (codex_app namespace, no arguments).
    • handleWorkspaceDependencyToolCall(payload, environment, platform) — validates the bundled runtime manifest and @oai/artifact-tool, rejects unexpected arguments, and returns the Node path, node_modules path, Python path, override-binary and fallback-binary paths.
  2. thread/start: include dynamicTools in the start params. Because the pinned generated schema strips unknown fields, the patch routes only thread/start through the validated raw request path. For upstream the cleaner fix is to regenerate effect-codex-app-server from a current app-server spec so dynamicTools is a first-class field (the protocol supports it; T3 already enables the experimental API).
  3. thread/resume: deliberately does not resend dynamicTools. Codex restores the tool from the saved rollout; the live probe confirms a resumed thread can still call the loader. thread/resume stays fully schema-checked.
  4. 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 both v0.0.33 and v0.0.34.
  • A live probe script (apps/server/scripts/probe-workspace-dependency-tool.ts, included) runs a real codex app-server round trip: fresh thread calls the loader, then the thread is resumed without dynamicTools and calls it again. It prints LIVE_LOADER_CALL_OK with freshCallSuccess: true and resumedCallSuccess: 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/call plumbing 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/list without 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions