Repository navigation
fix(acp-registry): match registry-id basenames for copilot, kimi, and claude #39626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ndycode
wants to merge
4
commits into
pingdotgg:main
Choose a base branch
from
ndycode:feat/acp-registry-id-basenames
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−21
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
df6462c
fix(acp-registry): match registry-id basenames for copilot, kimi, and…
ndycode e69649d
extract local command matcher and cover kimi-code regression
ndycode 47216a3
fix(acp-registry): keep Claude basename narrow and pin Copilot to its…
juliusmarminge ee0aa1a
fix(acp-registry): accept claude-acp as a local command basename
ndycode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
packages/provider-acp-registry/src/server/adapter.localCommands.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { matchesLocalAgentCommand } from "./adapter.ts"; | ||
|
|
||
| const KIMI = /^kimi(?:-code)?(\.exe|\.cmd)?$/i; | ||
| const COPILOT = /^(?:github-)?copilot(?:-cli)?(\.exe|\.cmd)?$/i; | ||
| const CLAUDE = /^claude(?:-agent)?-acp(\.exe|\.cmd)?$/i; | ||
|
|
||
| describe("matchesLocalAgentCommand", () => { | ||
| it.each([ | ||
| ["kimi-code", true], | ||
| ["kimi", true], | ||
| ["kimi-code.exe", true], | ||
| ["kimi.cmd", true], | ||
| ["kimicode", false], | ||
| ])("local command %s enables Kimi handling: %s", (command, expected) => { | ||
| expect(matchesLocalAgentCommand(`/usr/local/bin/${command}`, "local", KIMI)).toBe(expected); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["copilot", true], | ||
| ["github-copilot-cli.exe", true], | ||
| ["copilot-cli.CMD", true], | ||
| ["copilotx", false], | ||
| ])("local command %s enables Copilot handling: %s", (command, expected) => { | ||
| expect(matchesLocalAgentCommand(`C:\\Tools\\${command}`, "local", COPILOT)).toBe(expected); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["claude-acp", true], | ||
| ["claude-agent-acp.exe", true], | ||
| ["claude", false], | ||
| ])("local command %s enables Claude handling: %s", (command, expected) => { | ||
| expect(matchesLocalAgentCommand(`/opt/bin/${command}`, "local", CLAUDE)).toBe(expected); | ||
| }); | ||
|
|
||
| it("never matches non-local sources", () => { | ||
| expect(matchesLocalAgentCommand("/usr/bin/kimi-code", "registry", KIMI)).toBe(false); | ||
| expect(matchesLocalAgentCommand("/usr/bin/kimi-code", "npx", KIMI)).toBe(false); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep non-first-party local commands on the strict ACP path.
With
source="local"and command/usr/bin/kimi-code, this new match enables the Kimi-privatewire.jsonlwatcher at Line 277. The newgithub-copilot-climatch also enables vendor metadata and extension handlers at Lines 354-358. These additions extend provider-specific workarounds in the generic adapter.Keep non-first-party local commands spec-only. Restrict permitted first-party exceptions to dedicated flavors.
As per coding guidelines, “Generic ACP Registry and local ACP commands for non-first-party agents” must “follow the ACP specification strictly” and must not add “driver-specific workarounds.”
Source: Coding guidelines