Skip to content

[Provider compatibility] qoder-cn tool calls fail in Codex with “tool outside the isolated catalog” (Qoder CLI 1.1.89 / MCP lazy loading) #8704

Closed

Description

@testerggf

Client or integration

Codex App on macOS.

Provider or upstream service

  • Provider: qoder-cn
  • Selected model: qoder-cn/Qwen4-Max-Preview
  • Qoder CN CLI: @qodercn-ai/[email protected]
  • OpenCodex: @bitkyc08/[email protected]
  • OS: macOS 15.6.1 (24G90), Apple Silicon / arm64

OpenCodex version

2.100.2 (installed npm package @bitkyc08/opencodex).

Endpoint or capability

Codex tool calls / streaming through OpenCodex's Qoder provider adapter. Local directory listing and file access cannot complete.

Current behaviour

When using the selected qoder-cn model in Codex, requests that need tools repeatedly fail with:

stream disconnected before completion: Coding-agent CLI called a tool outside the isolated catalog.

The user observes this whenever tool use is needed in this setup. The attached evidence specifically covers repeated attempts to list the Desktop directory and subsequent diagnostic requests. This report does not claim that every Qoder model or CLI version has been tested.

Codex automatically retries, but the same failure recurs. Switching this same chat to a native Codex model allowed the local command to run and the Desktop contents to be listed.

Expected behaviour

Qoder should request the tools supplied by Codex/OpenCodex, with Codex retaining ownership of approval, sandboxing and execution. A request to list a local directory should complete through that tool loop.

Internal Qoder MCP discovery operations should not be exposed to Codex as undeclared external tool calls.

Minimal redacted request or reproduction

  1. Configure the qoder-cn provider in OpenCodex 2.100.2 with Qoder CN CLI 1.1.89 available.
  2. In Codex App, select qoder-cn/Qwen4-Max-Preview.
  3. Ask: 帮我列一下桌面的文件 (“Please list the files on my Desktop”).
  4. Observe the error above as soon as tool use starts.
  5. Retry: the same tool-catalog error occurs again.

No source patch or lazy-loading workaround was applied during these observations.

Actual response or error

stream disconnected before completion: Coding-agent CLI called a tool outside the isolated catalog.

The corresponding adapter branch emits undeclared_tool_call, status 502, retryable: false. Codex nevertheless retries the failed stream as shown in the evidence below.

Additional context and attachments

Supporting evidence (redacted):

Times below are local UTC+08:00 on 2026-11-14. User paths and session/call identifiers have been removed or replaced; only relevant log excerpts are included.

1. Qoder initializes the isolated MCP server with lazy loading enabled.

From ~/.qoder-cn/logs/runs/2026-11-14T00-03-32-864+08-00-…/qodercli.log, original lines 2043, 2244 and 2626:

2026-11-14T00:03:35.877+08:00 ... [session-mcp] created session=<redacted> cwd=/ configuredServers=1 lazy=true
2026-11-14T00:03:35.957+08:00 ... [mcp-client] tools listed server=opencodex count=8 durationMs=3
2026-11-14T00:03:36.028+08:00 ... [MCP LazyDelta] catalog added=8 removed=0

2. The first tool requested is Qoder's internal discovery tool, not the registered target tool.

Same log, original line 2664:

2026-11-14T00:03:46.420+08:00 ... tool.requested tool_name="mcp_get" args={"toolName":"mcp__opencodex__exec"}

Other runs show the same discovery/wrapper pattern:

2026-11-14T00:04:16.855+08:00 ... tool.requested tool_name="mcp_call" args={"arguments":{"cmd":"ls -la <HOME>/Desktop"},"toolName":"mcp__opencodex__exec"}
2026-11-14T00:07:09.779+08:00 ... tool.requested tool_name="mcp_list" args={"includeDescription":true}

The mcp_call excerpt records the CLI's emitted arguments; it is not evidence that the target tool ran or that those arguments satisfy Codex's exec schema.

3. Codex records repeated identical stream failures.

Selected entries extracted read-only from ~/.codex/logs_2.sqlite:

2026-11-14 00:02:09 +08:00 ... retrying sampling request (1/5 in 214ms) ... sampling_error=stream disconnected before completion: Coding-agent CLI called a tool outside the isolated catalog.
2026-11-14 00:02:19 +08:00 ... retrying sampling request (2/5 in 386ms) ... sampling_error=stream disconnected before completion: Coding-agent CLI called a tool outside the isolated catalog.
2026-11-14 00:02:29 +08:00 ... retrying sampling request (3/5 in 868ms) ... sampling_error=stream disconnected before completion: Coding-agent CLI called a tool outside the isolated catalog.

Source-level findings

The installed source points to a mismatch between Qoder's internal MCP discovery calls and OpenCodex's request-scoped tool catalog:

  1. Qoder buildQoderArgs, v2.100.2 passes --tools "", --strict-mcp-config, --setting-sources "" and --max-turns 1, but does not explicitly set mcp.lazyLoad=false.
  2. Generated MCP config includes defer_loading: false and alwaysLoad: true, yet the actual CLI log still reports lazy=true.
  3. Tool-name validation only accepts a name from emittedNameMap or the selected wire names. Otherwise it emits the exact reported message with code undeclared_tool_call, status 502, retryable: false, and kills the child process.
  4. Inspection of the installed Qoder CLI 1.1.89 bundle shows that MCP lazy loading defaults on when no explicit mcp.lazyLoad setting is present. QODER_MCP_LAZY=1 can also force it on. Its --help confirms that --settings accepts inline JSON.

Taken together, these findings strongly indicate that Qoder's internal mcp_get / mcp_list / mcp_call operations are incompatible with the current bridge's expected tool identities.

Suggested mapping or implementation notes

A minimal candidate fix is to explicitly disable lazy loading for the request-scoped Qoder child:

"--settings", JSON.stringify({ mcp: { lazyLoad: false } }),

This is a proposed fix based on source inspection, not an end-to-end verified workaround. It should be tested against the supported CLI versions, including any inherited environment override, a real tool call, and continuation with the tool result.

If lazy loading is intentionally retained, a Qoder-specific normalization layer would need to distinguish internal discovery calls from client tool calls, validate and unwrap mcp_call.input.toolName/arguments, and avoid ending the outer turn on a discovery-only call. Simply adding these names to the external tool allowlist would not preserve the existing execution contract.

Upstream documentation

The expected behaviour is the concrete Codex client requirement above and the existing bridge contract described in:

The lazy-loading default described here was observed in the installed CLI and logs; it is not presented as a documented cross-version Qoder guarantee.

Checks

  • Searched existing provider/compatibility issues; did not find an open issue matching this failure.
  • Removed credentials, account details, personal paths, session identifiers and unrelated file contents.
  • Expected behaviour is based on a concrete client requirement.

Activity

  1. added
    provider-compatibility
    catalog
    provider
    tools
    on Nov 13, 2026
  2. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

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

    catalogproviderprovider-compatibilitytools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions