mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-19 15:51:32 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb4c16f10a |
@@ -44,12 +44,25 @@ import {
|
||||
// personas, so we filter them out and only surface the Agent picker when the
|
||||
// user (or a plugin/project) has configured custom agents. Update this set if
|
||||
// the SDK's built-in roster changes.
|
||||
//
|
||||
// The set is matched by name because `AgentInfo` does not say where an agent
|
||||
// comes from. `getContextUsage().agents` lists only the agents that are not
|
||||
// built in, but session setup does not wait for that request (see
|
||||
// `readContextWindow`).
|
||||
//
|
||||
// Claude Code does not list two of them in every session: `web-fetch` only
|
||||
// where its staged rollout or `CLAUDE_CODE_WEB_FETCH_AGENT=1` turns it on, and
|
||||
// `claude-code-guide` only where the adapter's environment sets
|
||||
// `CLAUDE_CODE_ENTRYPOINT` (the SDK sets `sdk-ts` when it is unset, and Claude
|
||||
// Code leaves the agent out for that value).
|
||||
export const BUILTIN_AGENT_NAMES = new Set([
|
||||
"claude",
|
||||
"claude-code-guide",
|
||||
"general-purpose",
|
||||
"Explore",
|
||||
"Plan",
|
||||
"statusline-setup",
|
||||
"web-fetch",
|
||||
]);
|
||||
|
||||
// Value of the synthetic "Default" entry in the agent picker, which maps to the
|
||||
|
||||
@@ -11,6 +11,13 @@ import { discoverCustomAgents, BUILTIN_AGENT_NAMES } from "../session-config-opt
|
||||
// silently if the SDK changes its default roster: a newly added built-in would
|
||||
// leak into the ACP "Agent" picker as if the user had configured it. This
|
||||
// integration test runs the real SDK so the set is flagged the moment it does.
|
||||
//
|
||||
// Claude Code does not list every built-in in every session (issue #1670):
|
||||
// `web-fetch` needs its staged rollout or `CLAUDE_CODE_WEB_FETCH_AGENT=1`, and
|
||||
// `claude-code-guide` an entrypoint other than the SDK's `sdk-ts`. The test
|
||||
// sets both variables, so the roster does not depend on the account or on the
|
||||
// shell that runs it. A built-in behind a rollout with no variable set here
|
||||
// shows up only where that rollout is on.
|
||||
describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("agent discovery (SDK)", () => {
|
||||
it("BUILTIN_AGENT_NAMES exactly covers the SDK's default agent roster", async () => {
|
||||
const input = new Pushable<SDKUserMessage>();
|
||||
@@ -24,6 +31,11 @@ describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("agent discovery (SDK)", ()
|
||||
// regardless of what the developer has in ~/.claude/agents.
|
||||
settingSources: [],
|
||||
includePartialMessages: true,
|
||||
env: {
|
||||
...process.env,
|
||||
CLAUDE_CODE_WEB_FETCH_AGENT: "1",
|
||||
CLAUDE_CODE_ENTRYPOINT: "agent-roster-test",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -30656,10 +30656,12 @@ describe("agent selection config option", () => {
|
||||
const q = {
|
||||
supportedAgents: async () => [
|
||||
{ name: "claude", description: "catch-all" },
|
||||
{ name: "claude-code-guide", description: "guide" },
|
||||
{ name: "Explore", description: "search" },
|
||||
{ name: "general-purpose", description: "gp" },
|
||||
{ name: "Plan", description: "architect" },
|
||||
{ name: "statusline-setup", description: "status" },
|
||||
{ name: "web-fetch", description: "fetch" },
|
||||
{ name: "my-reviewer", description: "Reviews code" },
|
||||
{ name: "my-writer", description: "Writes docs" },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user