[GH-ISSUE #5160] [Bug] Codex + kimi-k3: older REA schemas trigger misleading recursion errors; recovery guidance missing #3170

Closed
opened 2026-10-31 00:37:27 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Cross2pro on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5160

Before submitting

  • Searched open and closed issues for Moonshot, Kimi, and "infinite recursion". Related: #1484, #1514, #1749, #2999.
  • Removed credentials, private endpoint URLs, private filesystem paths, and target data.

Area / interface / earliest failure

MCP or agent integration / MCP / downstream model request validation.

Observed behavior

In Codex Desktop with kimi-k3, the first "你好" completed and the identical second message failed with:

Invalid request: ***.***.parameters is not a valid moonshot flavored json schema,
details: <At path '***.steps': detected infinite recursion without termination condition>

The actual input schema advertised by the cached REA package's capture_native_ui_scenario reproduces this error when submitted alone as a function tool to the configured Responses-compatible gateway. Expanding its acyclic local references makes the same request succeed. This does not establish that the schema is actually recursive or identify whether the gateway or final provider misinterprets it.

Reproduction actually run

  1. Obtain capture_native_ui_scenario from TOOL_CONTRACTS in the cached package and use toolInputSchemaWithMetadata(contract)["~standard"].jsonSchema.input({target: "draft-2020-12"}), matching SDK registration.
  2. Submit a streaming Responses request for kimi-k3, a short greeting, and that function's advertised parameters. Observed: HTTP 400, exact steps error above.
  3. Inline the local $ref targets without changing the constraints. Observed: HTTP 200, response.completed.
  4. Repeat with official npm rea-agents@6.7.0: capture_native_ui_scenario now succeeds without modification. Its advertised input is already self-contained. However, compare_web_captures in the full profile still fails with schema exceeds maximum allowed size; its compact projection succeeds (HTTP 200, response.completed).

Expected behavior and current upstream status

Codex users selecting a Moonshot model should have a documented recovery path: refresh the actual running REA package, select REA_MCP_INPUT_SCHEMA_PROFILE=compact on the Codex MCP registration, and reconnect/restart the server.

The runtime reference fix already exists on main (5e30969cc5f1255d44ec7a1f1ca8dbac0af5e7c4, "fix(mcp): advertise self-contained tool inputs"). This report is not a claim that current main still emits the older shared input schema. The remaining actionable gap is Codex-specific recovery guidance and outdated text under docs/mcp-contracts.md#schema-advertisement that still describes selective reference-budget fallback.

Impact and scope

An unrelated greeting fails before a tool executes. Logs show REA became ready after the first request started and before the second started, consistent with the tool catalog becoming available between turns; the exact outgoing Codex requests were not captured. Live probes cover two individual tools, not model-driven invocation or the complete current catalog. Other gateways/models are unverified.

REA version

Affected cached package: package.json reports 6.3.0. The configured npx registration separately requested 6.5.0; why the inspected cache differs is NOT_ENOUGH_INFO. Do not treat that configured selector as proof that 6.5.0 was reproduced. Control: official npm 6.7.0.

Runtime and platform

Node 22.22.1, macOS arm64; Codex Desktop 26.1013.40934; configured Responses-compatible gateway with model kimi-k3. No binary or analysis engine needed.

Proposed change

Document the two distinct schema failures and the tested Codex TOML recovery configuration; update the schema-advertisement description to match the existing inline implementation. Preserve the current runtime fix and canonical validation.

Originally created by @Cross2pro on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5160 ### Before submitting - [x] Searched open and closed issues for Moonshot, Kimi, and "infinite recursion". Related: #1484, #1514, #1749, #2999. - [x] Removed credentials, private endpoint URLs, private filesystem paths, and target data. ### Area / interface / earliest failure MCP or agent integration / MCP / downstream model request validation. ### Observed behavior In Codex Desktop with `kimi-k3`, the first "你好" completed and the identical second message failed with: ```text Invalid request: ***.***.parameters is not a valid moonshot flavored json schema, details: <At path '***.steps': detected infinite recursion without termination condition> ``` The actual input schema advertised by the cached REA package's `capture_native_ui_scenario` reproduces this error when submitted alone as a function tool to the configured Responses-compatible gateway. Expanding its acyclic local references makes the same request succeed. This does not establish that the schema is actually recursive or identify whether the gateway or final provider misinterprets it. ### Reproduction actually run 1. Obtain `capture_native_ui_scenario` from `TOOL_CONTRACTS` in the cached package and use `toolInputSchemaWithMetadata(contract)["~standard"].jsonSchema.input({target: "draft-2020-12"})`, matching SDK registration. 2. Submit a streaming Responses request for `kimi-k3`, a short greeting, and that function's advertised parameters. Observed: HTTP 400, exact `steps` error above. 3. Inline the local `$ref` targets without changing the constraints. Observed: HTTP 200, `response.completed`. 4. Repeat with official npm `rea-agents@6.7.0`: `capture_native_ui_scenario` now succeeds without modification. Its advertised input is already self-contained. However, `compare_web_captures` in the full profile still fails with `schema exceeds maximum allowed size`; its compact projection succeeds (HTTP 200, `response.completed`). ### Expected behavior and current upstream status Codex users selecting a Moonshot model should have a documented recovery path: refresh the actual running REA package, select `REA_MCP_INPUT_SCHEMA_PROFILE=compact` on the Codex MCP registration, and reconnect/restart the server. The runtime reference fix already exists on main (`5e30969cc5f1255d44ec7a1f1ca8dbac0af5e7c4`, "fix(mcp): advertise self-contained tool inputs"). This report is **not** a claim that current main still emits the older shared input schema. The remaining actionable gap is Codex-specific recovery guidance and outdated text under `docs/mcp-contracts.md#schema-advertisement` that still describes selective reference-budget fallback. ### Impact and scope An unrelated greeting fails before a tool executes. Logs show REA became ready after the first request started and before the second started, consistent with the tool catalog becoming available between turns; the exact outgoing Codex requests were not captured. Live probes cover two individual tools, not model-driven invocation or the complete current catalog. Other gateways/models are unverified. ### REA version Affected cached package: `package.json` reports **6.3.0**. The configured npx registration separately requested 6.5.0; why the inspected cache differs is **NOT_ENOUGH_INFO**. Do not treat that configured selector as proof that 6.5.0 was reproduced. Control: official npm **6.7.0**. ### Runtime and platform Node 22.22.1, macOS arm64; Codex Desktop 26.1013.40934; configured Responses-compatible gateway with model `kimi-k3`. No binary or analysis engine needed. ### Proposed change Document the two distinct schema failures and the tested Codex TOML recovery configuration; update the schema-advertisement description to match the existing inline implementation. Preserve the current runtime fix and canonical validation.
Author
Owner

@XinwangTao commented on GitHub (Oct 19, 2026):

Agreed that the actionable gap here is the recovery guidance rather than the runtime fix — the schema-advertisement section in docs/mcp-contracts.md is indeed stale now that main advertises self-contained inputs. A documented Codex TOML recovery path (refresh the package + REA_MCP_INPUT_SCHEMA_PROFILE=compact + reconnect) would have saved users a confusing 'infinite recursion' chase, since that error message gives no hint that the advertised schema came from a cached older package.

The HTTP 400/200 contrast with the inline experiment is a clean way to pin the cause, and noting that official 6.7.0 is already self-contained helps reviewers see this is purely a docs/UX gap. Nice catch on the cached-package discrepancy too — the version-mismatch note is worth keeping visible for anyone else hitting the same wall.

<!-- gh-comment-id:6259598526 --> @XinwangTao commented on GitHub (Oct 19, 2026): Agreed that the actionable gap here is the recovery guidance rather than the runtime fix — the schema-advertisement section in docs/mcp-contracts.md is indeed stale now that main advertises self-contained inputs. A documented Codex TOML recovery path (refresh the package + REA_MCP_INPUT_SCHEMA_PROFILE=compact + reconnect) would have saved users a confusing 'infinite recursion' chase, since that error message gives no hint that the advertised schema came from a cached older package. The HTTP 400/200 contrast with the inline experiment is a clean way to pin the cause, and noting that official 6.7.0 is already self-contained helps reviewers see this is purely a docs/UX gap. Nice catch on the cached-package discrepancy too — the version-mismatch note is worth keeping visible for anyone else hitting the same wall.
Author
Owner

@morluto commented on GitHub (Oct 26, 2026):

Thank you for distinguishing the old cached package from the separately configured selector and for testing the individual schemas. The self-contained input projection is on main, and b791f029a updated both the schema-advertisement description and Codex-specific recovery guidance, including the TOML setting, active launcher check, and reconnect. Compact is now the default, while an explicit full override remains respected. I am closing this documentation follow-up; the reported gateway probes do not establish acceptance of the entire current catalog, and no new model or client run was performed here.

<!-- gh-comment-id:6428655125 --> @morluto commented on GitHub (Oct 26, 2026): Thank you for distinguishing the old cached package from the separately configured selector and for testing the individual schemas. The self-contained input projection is on main, and b791f029a updated both the schema-advertisement description and Codex-specific recovery guidance, including the TOML setting, active launcher check, and reconnect. Compact is now the default, while an explicit full override remains respected. I am closing this documentation follow-up; the reported gateway probes do not establish acceptance of the entire current catalog, and no new model or client run was performed here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3170
No description provided.