Skip to content

[PR] fix: keep CommandCode proxy tool calls inside the loop - #6627

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_commandcode-proxy-tools
Nov 14, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_commandcode-proxy-tools

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Fixes #6625

Problem

The CommandCode adapter omitted four existing proxy-owned tool names from its static classification: acp_retire, acp_restore, acp_rewrite, and acp_cache. It replayed their calls and the round's finish to the client as though the client owned those tools. Core dispatch still executed the enabled proxy operations and sent their receipts upstream, so a proxy-only response reached the client as tool-call → finish → continuation text → finish.

This exposes internal calls and terminates the client stream before the continuation answer has arrived.

Changes

Add the four names to CommandCode's existing proxy-tool set, matching the OpenAI and Google handling introduced with #5765 / #5774. Proxy-only rounds now remain inside the loop; the client receives the continuation text followed by one terminal frame. Mixed rounds still replay real client-tool lines byte-for-byte.

The core's existing block-ops opt-in gate is unchanged. Disabled operations do not mutate blocks or trigger an internal continuation. Existing compress/custom-absorb handling and ordinary client-tool passthrough remain covered.

Validation

  • 12 new regression cases: 9 failures / 3 passing controls on unmodified master e1f31ad; all 12 pass with the fix.
  • Four real runCompressLoop cases send loopback HTTP continuations and verify retire/restore/rewrite state changes or a cache-report receipt, exact call/result correlation, retained original transcript bytes, and the final client JSONL event sequence.
  • Adapter controls cover both initial and continuation rounds, mixed proxy/real tools, a similarly prefixed client tool, custom absorb, and exact real-call bytes.
  • 73 targeted tests pass across the new suite, CommandCode adapter/wire/endpoint/plugin-pipe suites, block-ops dispatch, and compression-loop regressions.
  • Typecheck, production build, unused-export guard, test-import guard, and git diff --check pass.

The Codex E2E prerequisite check found the installed CLI and built artifact, but the configured real upstream at 127.0.0.1:8199 is unreachable here. The gated live four-phase suite was not run; the new loopback HTTP coverage and existing real proxy endpoint tests are local results, with the full repository regression left to hosted CI.

Prior work

All-state repository and author-history searches found no existing CommandCode repair for this omission. #5774 changed the OpenAI and Google adapter sets, not CommandCode; #1444 / #6032 introduced the CommandCode wire. This patch adds no new tool or kernel/configuration behavior.

@ranxianglei ranxianglei changed the title fix: keep CommandCode proxy tool calls inside the loop [PR] fix: keep CommandCode proxy tool calls inside the loop Nov 13, 2026
@ranxianglei
ranxianglei merged commit 61ddcff into ranxianglei:master Nov 14, 2026
88 of 92 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner

Superseded by #6677 (merged as 3858b6956, 2026-11-14).

Landed into master via the real merge commit 61ddcff4e62 (Merge Afloat16/2026-11-13_commandcode-proxy-tools (PR #6627)), so your original commits are preserved verbatim in master history — only hashes of the batch wrapper changed, your authorship and commit messages are intact.

The fix for #6625 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CommandCode leaks proxy-owned tool calls and premature finish frames

2 participants