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
5
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.
+74
−9
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
341fe98
fix(acp-registry): match registry-id basenames for copilot, kimi, and…
ndycode 8403f5e
Merge remote-tracking branch 'origin/main' into feat/acp-registry-id-…
juliusmarminge c64345c
fix(acp-registry): keep Claude basename narrow and pin Copilot to its…
juliusmarminge ba97ed8
extract local command matcher and cover kimi-code regression
ndycode ebab0f0
Merge remote-tracking branch 'fork/feat/acp-registry-id-basenames'
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 = /^(?: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", false], | ||
| ["copilotx", false], | ||
| ])("local command %s enables Copilot handling: %s", (command, expected) => { | ||
| expect(matchesLocalAgentCommand(`C:\\Tools\\${command}`, "local", COPILOT)).toBe(expected); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["claude-acp", false], | ||
| ["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
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.
The local Claude matcher and its test disagree with the stated PR scope.
adapter.ts:243matches onlyclaude-agent-acpas a local basename. A localclaude-acpcommand therefore skips the defaultCLAUDE_AGENT_ACP_EXPERIMENTAL_V2=1setting and the Claude subagent and work-state handling. The PR description says the matcher addsclaude(-agent)?-acp. The table row["claude-acp", false]inadapter.localCommands.test.ts:30asserts the opposite.Decide whether local
claude-acpis a supported name. If it is, the matcher and that test row must both accept it. If it is not, correct the PR description. The two must agree.