fix(agent-acp): send session/set_config_option without the _ extension prefix#5
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Config options aren't a typed method in
@zed-industries/agent-client-protocol, soAcpConnection.requestroutessession/set_config_optionthrough the library'sextMethod— 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'sextMethod.Fix
Rewrite the method name on the outbound ndjson stream:
_session/set_config_option→session/set_config_option(mirrors the existing inboundsanitizeAcpNotificationLine). JSON-RPC correlates responses byid, 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 helperrewriteOutboundAcpLine.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:boundariesall green.🤖 Generated with Claude Code