Skip to content

fix(agent-acp): send session/set_config_option without the _ extension prefix#5

Merged
huntharo merged 1 commit into
mainfrom
fix/acp-bare-config-option-method
Jun 8, 2026
Merged

fix(agent-acp): send session/set_config_option without the _ extension prefix#5
huntharo merged 1 commit into
mainfrom
fix/acp-bare-config-option-method

Conversation

@huntharo

@huntharo huntharo commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Problem

Config options aren't a typed method in @zed-industries/agent-client-protocol, so AcpConnection.request routes session/set_config_option through the library's extMethod — which prefixes every extension method with _ (_session/set_config_option). Agents that implement config options (Kimi) expose them without the underscore and reject the prefixed name with "Method not found".

Effect: the thought-level / thinking toggle (added in 0.12.0) silently never applied, so Kimi enrichment kept running with thinking ON (~50s) instead of off (~6s). The 0.12.0 unit tests missed it because the fake transport records the bare method string — the _ is added inside the real library's extMethod.

Fix

Rewrite the method name on the outbound ndjson stream: _session/set_config_optionsession/set_config_option (mirrors the existing inbound sanitizeAcpNotificationLine). JSON-RPC correlates responses by id, so the rewrite is transparent to the library's pending-request matching, and only this one method is touched (genuine vendor extension methods keep their _). New exported helper rewriteOutboundAcpLine.

Verification

Probed against Kimi 0.11.0: bare session/set_config_option { configId: "thinking", value: "off" } is accepted, and the enrichment turn drops from ~50s to ~6s. pnpm build, pnpm typecheck, pnpm test (132, +4), pnpm lint:licenses, pnpm lint:boundaries all green.

🤖 Generated with Claude Code

…ion prefix

Config options aren't a typed method in @zed-industries/agent-client-protocol,
so the transport routed `session/set_config_option` through `extMethod`, which
prefixes extension methods with `_`. Agents that implement config options (Kimi)
expose them WITHOUT the underscore and reject `_session/set_config_option` with
"Method not found" — so the thought-level/thinking toggle silently never
applied (enrichment kept running with thinking ON, ~50s instead of ~6s).

Rewrite the method name on the outbound ndjson stream (mirrors the existing
inbound `sanitizeAcpNotificationLine`); JSON-RPC correlates by `id`, so it's
transparent to the library. Verified against Kimi 0.11.0: the bare method is
accepted and thinking=off cuts the turn from ~50s to ~6s. +4 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huntharo huntharo merged commit 01fa6dd into main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant