Skip to content

[Bug]: routed first-turn tool catalog is 3–5x native Sol input tokens #1587

Description

@lidge-jun

Client or integration

Codex App

Area

Proxy and routing

Summary

The same first-turn greeting uses ~21k input tokens on native gpt-5.6-sol and 62k–99k on OpenCodex-routed models.

Visible bootstrap text is almost the same. The extra tokens are the routed adapters expanding Codex Desktop's hosted/namespace tool catalog into full function JSON (parameters / input_schema) on every request. Native ChatGPT keeps those tools hosted/namespaced and can keep prior state on the backend.

I expected a ㅎㅇ / hello first turn to stay near the native 21k baseline on routed Kimi/Anthropic as well, or for unused connector schemas to stay deferred.

Reproduction

On 2026-08-13, same machine, Codex Desktop through local OpenCodex 2.13.0 (http://127.0.0.1:10100). Fresh first-turn greetings in 모두의창업 / opencodex:

  1. New thread, model gpt-5.6-sol Medium, send ㅎㅇ.
  2. New thread, model kimi/k3[1m], send ㅎㅇ.
  3. New thread, model teamwicked/teamwicked-kimi-k3, send ㅎㅇ.
  4. New thread, model anthropic/claude-opus-5 Max, send a short greeting.

Observed usage (OpenCodex request history + Codex token_count):

Request Model Route Input Cache Notes
ocx-msr39xh6-cr gpt-5.6-sol native openai-responses 21081 6912 UI 21k / 353k
ocx-msr3a361-ct kimi/k3[1m] explicit-provider openai-chat 62319 4864 same visible text as Sol
ocx-msr3abxk-cw teamwicked-kimi-k3 explicit-provider openai-chat 67671 4352 same greeting
ocx-msr3i3e9-dh anthropic/claude-opus-5 explicit-provider anthropic 98402 0 UI 99k / 950k; this thread also injected repo AGENTS.md

Session rollouts for the Sol/Kimi pair show the same developer bootstrap (~39,690 chars) and the same user payload (recommended_plugins + env + ㅎㅇ). The 21k vs 62k gap is not chat text.

Code path:

  • src/responses/parser.ts buildTools() flattens MCP type: "namespace" tools into individual functions so chat-completions models can call them.
  • src/adapters/openai-chat.ts toolsToChatFormat() and src/adapters/anthropic.ts toolsToAnthropicFormat() then send every function's full schema.
  • Native Sol stays on ChatGPT openai-responses and does not do that expansion.

Related but not the same report: #190 (Cursor catalog too large), #719 (Kiro CONTENT_FILTERED on large MCP catalogs), #1522 (routed models lose plugin/search wiring).

Version

Running local service 2.13.0 (GET /healthz). Checkout package.json is 2.14.0.

Operating system

macOS 27.0 (26A5353q)

Provider and model

openai / gpt-5.6-sol vs kimi/k3[1m], teamwicked/teamwicked-kimi-k3, anthropic/claude-opus-5

Logs or error output

native  gpt-5.6-sol                 in=21081  cache=6912  out=14   route=native
routed  kimi/k3[1m]                 in=62319  cache=4864  out=120  adapter=openai-chat
routed  teamwicked/teamwicked-kimi-k3 in=67671 cache=4352 out=49   adapter=openai-chat
routed  anthropic/claude-opus-5     in=98402  cache=0     out=156  adapter=anthropic

Codex UI for Opus: 99k / 950k (catalog 1M * 95%). Sol UI: 21k / 353k (catalog 372k * 95%). Those denominators are catalog advertisement, not this bug.

Screenshots and supporting files

Codex context popover on Opus showed 10% used, 99k / 950k tokens used, for a first-turn greeting.

Redacted configuration

No special providerContextCaps. OpenAI is the built-in ChatGPT forward provider. Kimi/Teamwicked/Anthropic are configured OAuth/key providers. API keys omitted.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

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

    bugSomething isn't workingcatalogModel catalog, slugs, visibility, routed entriesproxyHTTP proxy, routing, reverse-proxy / management authtoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions