Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/custom-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,30 @@ Only enable capabilities Paseo should execute. When the agent and Paseo run in
different environments, configure equivalent absolute workspace paths before
delegating filesystem or terminal operations to Paseo.

Some ACP agents publish slash commands asynchronously after `session/new`.
Enable initial command waiting for those providers so the new-agent composer
does not read an empty command list before the update arrives:

```json
{
"agents": {
"providers": {
"my-agent": {
"extends": "acp",
"label": "My Agent",
"command": ["my-agent", "acp"],
"params": {
"waitForInitialCommands": true,
"initialCommandsWaitTimeoutMs": 1500
}
}
}
}
}
```

Keep the default timeout unless the provider documents a longer command-discovery delay.

### Generic ACP diagnostics

Paseo diagnostics for `extends: "acp"` providers report the configured command, resolved launcher binary, version output, ACP `initialize`, ACP `session/new`, model count, modes, and final status.
Expand Down
5 changes: 3 additions & 2 deletions packages/server/src/server/agent/providers/acp-agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,7 @@ describe("ACPAgentSession slash commands", () => {
{
name: "research_codebase",
description: "Search the workspace for relevant files",
input: { hint: "query" },
},
{
name: "create_plan",
Expand All @@ -2375,7 +2376,7 @@ describe("ACPAgentSession slash commands", () => {
{
name: "research_codebase",
description: "Search the workspace for relevant files",
argumentHint: "",
argumentHint: "query",
kind: "command",
},
{
Expand All @@ -2390,7 +2391,7 @@ describe("ACPAgentSession slash commands", () => {
{
name: "research_codebase",
description: "Search the workspace for relevant files",
argumentHint: "",
argumentHint: "query",
kind: "command",
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/server/agent/providers/acp-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,7 @@ export class ACPAgentSession implements AgentSession, ACPClient {
this.cachedCommands = update.availableCommands.map((command) => ({
name: command.name,
description: command.description,
argumentHint: "",
argumentHint: command.input?.hint ?? "",
kind: "command",
}));
this.settleCommandsReady();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,21 @@ describe("GenericACPAgentClient", () => {
},
});
});

test("uses provider params to wait for asynchronously published slash commands", () => {
const _client = new GenericACPAgentClient({
logger: createTestLogger(),
command: ["zcode-acp-server"],
providerParams: {
waitForInitialCommands: true,
initialCommandsWaitTimeoutMs: 2_000,
},
});
void _client;

expect(mockState.superConstructorOptions.at(-1)).toMatchObject({
waitForInitialCommands: true,
Comment on lines +85 to +98

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test asserts constructor internals

This test only inspects captured ACPAgentClient constructor options instead of creating a session and observing listCommands(), coupling coverage to implementation details without verifying that provider parameters produce the caller-facing asynchronous-command behavior.

Rule Used: # Code Review Pattern Reference: Slop, Tests, Feat... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

initialCommandsWaitTimeoutMs: 2_000,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
export const GenericACPProviderParamsSchema = z
.object({
supportsMcpServers: z.boolean().optional(),
waitForInitialCommands: z.boolean().optional(),
initialCommandsWaitTimeoutMs: z.number().int().positive().optional(),
clientCapabilities: z
.object({
fs: z
Expand Down Expand Up @@ -69,8 +71,10 @@ export class GenericACPAgentClient extends ACPAgentClient {
},
defaultCommand: options.command,
capabilities: buildGenericACPCapabilities(providerParams),
waitForInitialCommands: options.waitForInitialCommands,
initialCommandsWaitTimeoutMs: options.initialCommandsWaitTimeoutMs,
waitForInitialCommands:
options.waitForInitialCommands ?? providerParams.waitForInitialCommands,
initialCommandsWaitTimeoutMs:
options.initialCommandsWaitTimeoutMs ?? providerParams.initialCommandsWaitTimeoutMs,
clientCapabilities: providerParams.clientCapabilities,
clientCapabilityMeta: options.clientCapabilityMeta,
configFeatureOptions: options.configFeatureOptions,
Expand Down