Skip to content

Commit 80e7af9

Browse files
committed
Remove run_command
1 parent a1501a6 commit 80e7af9

10 files changed

Lines changed: 16 additions & 172 deletions

File tree

docs/protocol/schema.mdx

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,9 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp
146146
<a id="session-list_commands"></a>
147147
### <span class="font-mono">session/list_commands</span>
148148

149-
Lists available custom commands for a session.
149+
**UNSTABLE**
150150

151-
Returns all commands available in the agent's `.claude/commands` directory
152-
or equivalent command registry. Commands can be executed via `run_command`.
151+
This method is not part of the spec, and may be removed or changed at any point.
153152

154153
#### <span class="font-mono">ListCommandsRequest</span>
155154

@@ -370,36 +369,6 @@ See protocol docs: [Check for Completion](https://agentclientprotocol.com/protoc
370369
Indicates why the agent stopped processing the turn.
371370
</ResponseField>
372371

373-
<a id="session-run_command"></a>
374-
### <span class="font-mono">session/run_command</span>
375-
376-
Executes a custom command within a session.
377-
378-
Runs the specified command with optional arguments. The agent should
379-
stream results back via session update notifications.
380-
381-
#### <span class="font-mono">RunCommandRequest</span>
382-
383-
Request parameters for executing a command.
384-
385-
**Type:** Object
386-
387-
**Properties:**
388-
389-
<ResponseField name="args" type={"string | null"}>
390-
Optional arguments for the command.
391-
</ResponseField>
392-
<ResponseField name="command" type={"string"} required>
393-
Name of the command to execute.
394-
</ResponseField>
395-
<ResponseField
396-
name="sessionId"
397-
type={<a href="#sessionid">SessionId</a>}
398-
required
399-
>
400-
The session ID to execute the command in.
401-
</ResponseField>
402-
403372
## Client
404373

405374
Defines the interface that ACP-compliant clients must implement.
@@ -620,7 +589,7 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol
620589

621590
</ResponseField>
622591
<ResponseField name="supportsCommands" type={"boolean"} >
623-
Agent supports commands via `list_commands` and `run_command`.
592+
Agent supports commands via `list_commands`.
624593

625594
- Default: `false`
626595

rust/acp.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,6 @@ impl Agent for ClientSideConnection {
228228
)
229229
.await
230230
}
231-
232-
async fn run_command(&self, arguments: RunCommandRequest) -> Result<(), Error> {
233-
self.conn
234-
.request(
235-
SESSION_RUN_COMMAND,
236-
Some(ClientRequest::RunCommandRequest(arguments)),
237-
)
238-
.await
239-
}
240231
}
241232

242233
/// Marker type representing the client side of an ACP connection.
@@ -533,9 +524,6 @@ impl Side for AgentSide {
533524
SESSION_LIST_COMMANDS => serde_json::from_str(params.get())
534525
.map(ClientRequest::ListCommandsRequest)
535526
.map_err(Into::into),
536-
SESSION_RUN_COMMAND => serde_json::from_str(params.get())
537-
.map(ClientRequest::RunCommandRequest)
538-
.map_err(Into::into),
539527
_ => Err(Error::method_not_found()),
540528
}
541529
}
@@ -582,10 +570,6 @@ impl<T: Agent> MessageHandler<AgentSide> for T {
582570
let response = self.list_commands(args).await?;
583571
Ok(AgentResponse::ListCommandsResponse(response))
584572
}
585-
ClientRequest::RunCommandRequest(args) => {
586-
self.run_command(args).await?;
587-
Ok(AgentResponse::AuthenticateResponse) // No specific response type for run_command
588-
}
589573
}
590574
}
591575

rust/agent.rs

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,13 @@ pub trait Agent {
106106
/// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
107107
fn cancel(&self, args: CancelNotification) -> impl Future<Output = Result<(), Error>>;
108108

109-
/// Lists available custom commands for a session.
109+
/// **UNSTABLE**
110110
///
111-
/// Returns all commands available in the agent's `.claude/commands` directory
112-
/// or equivalent command registry. Commands can be executed via `run_command`.
111+
/// This method is not part of the spec, and may be removed or changed at any point.
113112
fn list_commands(
114113
&self,
115114
arguments: ListCommandsRequest,
116115
) -> impl Future<Output = Result<ListCommandsResponse, Error>>;
117-
118-
/// Executes a custom command within a session.
119-
///
120-
/// Runs the specified command with optional arguments. The agent should
121-
/// stream results back via session update notifications.
122-
fn run_command(&self, arguments: RunCommandRequest) -> impl Future<Output = Result<(), Error>>;
123116
}
124117

125118
// Initialize
@@ -355,7 +348,7 @@ pub struct AgentCapabilities {
355348
#[serde(default)]
356349
pub prompt_capabilities: PromptCapabilities,
357350

358-
/// Agent supports commands via `list_commands` and `run_command`.
351+
/// Agent supports commands via `list_commands`.
359352
#[serde(default)]
360353
pub supports_commands: bool,
361354
}
@@ -421,19 +414,6 @@ pub struct CommandInfo {
421414
pub requires_argument: bool,
422415
}
423416

424-
/// Request parameters for executing a command.
425-
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
426-
#[schemars(extend("x-side" = "agent", "x-method" = "session/run_command"))]
427-
#[serde(rename_all = "camelCase")]
428-
pub struct RunCommandRequest {
429-
/// The session ID to execute the command in.
430-
pub session_id: SessionId,
431-
/// Name of the command to execute.
432-
pub command: String,
433-
/// Optional arguments for the command.
434-
pub args: Option<String>,
435-
}
436-
437417
// Method schema
438418

439419
/// Names of all methods that agents handle.
@@ -455,8 +435,6 @@ pub struct AgentMethodNames {
455435
pub session_cancel: &'static str,
456436
/// Method for listing available commands.
457437
pub session_list_commands: &'static str,
458-
/// Method for running a command.
459-
pub session_run_command: &'static str,
460438
}
461439

462440
/// Constant containing all agent method names.
@@ -468,7 +446,6 @@ pub const AGENT_METHOD_NAMES: AgentMethodNames = AgentMethodNames {
468446
session_prompt: SESSION_PROMPT_METHOD_NAME,
469447
session_cancel: SESSION_CANCEL_METHOD_NAME,
470448
session_list_commands: SESSION_LIST_COMMANDS,
471-
session_run_command: SESSION_RUN_COMMAND,
472449
};
473450

474451
/// Method name for the initialize request.
@@ -484,9 +461,7 @@ pub(crate) const SESSION_PROMPT_METHOD_NAME: &str = "session/prompt";
484461
/// Method name for the cancel notification.
485462
pub(crate) const SESSION_CANCEL_METHOD_NAME: &str = "session/cancel";
486463
/// Method name for listing custom commands in a session.
487-
pub const SESSION_LIST_COMMANDS: &str = "session/list_commands";
488-
/// Method name for running a custom command in a session.
489-
pub const SESSION_RUN_COMMAND: &str = "session/run_command";
464+
pub(crate) const SESSION_LIST_COMMANDS: &str = "session/list_commands";
490465

491466
/// All possible requests that a client can send to an agent.
492467
///
@@ -504,7 +479,6 @@ pub enum ClientRequest {
504479
LoadSessionRequest(LoadSessionRequest),
505480
PromptRequest(PromptRequest),
506481
ListCommandsRequest(ListCommandsRequest),
507-
RunCommandRequest(RunCommandRequest),
508482
}
509483

510484
/// All possible responses that an agent can send to a client.

rust/example_agent.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ impl acp::Agent for ExampleAgent {
110110
}],
111111
})
112112
}
113-
114-
async fn run_command(&self, arguments: acp::RunCommandRequest) -> Result<(), acp::Error> {
115-
log::info!("Received run_command request {arguments:?}");
116-
Ok(())
117-
}
118113
}
119114

120115
#[tokio::main(flavor = "current_thread")]

rust/markdown_generator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ impl SideDocs {
635635
"session/prompt" => self.agent_methods.get("prompt").unwrap(),
636636
"session/cancel" => self.agent_methods.get("cancel").unwrap(),
637637
"session/list_commands" => self.agent_methods.get("list_commands").unwrap(),
638-
"session/run_command" => self.agent_methods.get("run_command").unwrap(),
639638
_ => panic!("Introduced a method? Add it here :)"),
640639
}
641640
}

rust/rpc_tests.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ impl Agent for TestAgent {
167167
) -> Result<ListCommandsResponse, Error> {
168168
Ok(ListCommandsResponse { commands: vec![] })
169169
}
170-
171-
async fn run_command(&self, _arguments: RunCommandRequest) -> Result<(), Error> {
172-
Ok(())
173-
}
174170
}
175171

176172
// Helper function to create a bidirectional connection

schema/meta.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"session_list_commands": "session/list_commands",
77
"session_load": "session/load",
88
"session_new": "session/new",
9-
"session_prompt": "session/prompt",
10-
"session_run_command": "session/run_command"
9+
"session_prompt": "session/prompt"
1110
},
1211
"clientMethods": {
1312
"fs_read_text_file": "fs/read_text_file",

schema/schema.json

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"supportsCommands": {
2121
"default": false,
22-
"description": "Agent supports commands via `list_commands` and `run_command`.",
22+
"description": "Agent supports commands via `list_commands`.",
2323
"type": "boolean"
2424
}
2525
},
@@ -260,10 +260,6 @@
260260
{
261261
"$ref": "#/$defs/ListCommandsRequest",
262262
"title": "ListCommandsRequest"
263-
},
264-
{
265-
"$ref": "#/$defs/RunCommandRequest",
266-
"title": "RunCommandRequest"
267263
}
268264
],
269265
"description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Agent`] trait.\n\nThis enum encompasses all method calls from client to agent.",
@@ -1121,27 +1117,6 @@
11211117
"enum": ["assistant", "user"],
11221118
"type": "string"
11231119
},
1124-
"RunCommandRequest": {
1125-
"description": "Request parameters for executing a command.",
1126-
"properties": {
1127-
"args": {
1128-
"description": "Optional arguments for the command.",
1129-
"type": ["string", "null"]
1130-
},
1131-
"command": {
1132-
"description": "Name of the command to execute.",
1133-
"type": "string"
1134-
},
1135-
"sessionId": {
1136-
"$ref": "#/$defs/SessionId",
1137-
"description": "The session ID to execute the command in."
1138-
}
1139-
},
1140-
"required": ["sessionId", "command"],
1141-
"type": "object",
1142-
"x-method": "session/run_command",
1143-
"x-side": "agent"
1144-
},
11451120
"SessionId": {
11461121
"description": "A unique identifier for a conversation session between a client and agent.\n\nSessions maintain their own context, conversation history, and state,\nallowing multiple independent interactions with the same agent.\n\n# Example\n\n```\nuse agent_client_protocol::SessionId;\nuse std::sync::Arc;\n\nlet session_id = SessionId(Arc::from(\"sess_abc123def456\"));\n```\n\nSee protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)",
11471122
"type": "string"

typescript/acp.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,11 @@ export class ClientSideConnection implements Agent {
454454
);
455455
}
456456

457-
// todo!()
457+
/**
458+
* @internal **UNSTABLE**
459+
*
460+
* This method is not part of the spec, and may be removed or changed at any point.
461+
*/
458462
async listCommands(
459463
params: schema.ListCommandsRequest,
460464
): Promise<schema.ListCommandsResponse> {
@@ -463,14 +467,6 @@ export class ClientSideConnection implements Agent {
463467
params,
464468
);
465469
}
466-
467-
// todo!()
468-
async runCommand(params: schema.RunCommandRequest): Promise<void> {
469-
return await this.#connection.sendRequest(
470-
schema.AGENT_METHODS.session_run_command,
471-
params,
472-
);
473-
}
474470
}
475471

476472
type AnyMessage = AnyRequest | AnyResponse | AnyNotification;
@@ -963,6 +959,4 @@ export interface Agent {
963959
listCommands(
964960
params: schema.ListCommandsRequest,
965961
): Promise<schema.ListCommandsResponse>;
966-
967-
runCommand(params: schema.RunCommandRequest): Promise<void>;
968962
}

typescript/schema.ts

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const AGENT_METHODS = {
66
session_load: "session/load",
77
session_new: "session/new",
88
session_prompt: "session/prompt",
9-
session_run_command: "session/run_command",
109
};
1110

1211
export const CLIENT_METHODS = {
@@ -227,8 +226,7 @@ export type AgentRequest =
227226
| NewSessionRequest
228227
| LoadSessionRequest
229228
| PromptRequest
230-
| ListCommandsRequest
231-
| RunCommandRequest;
229+
| ListCommandsRequest;
232230
/**
233231
* Content blocks represent displayable information in the Agent Client Protocol.
234232
*
@@ -761,37 +759,6 @@ export interface ListCommandsRequest {
761759
*/
762760
sessionId: string;
763761
}
764-
/**
765-
* Request parameters for executing a command.
766-
*/
767-
export interface RunCommandRequest {
768-
/**
769-
* Optional arguments for the command.
770-
*/
771-
args?: string | null;
772-
/**
773-
* Name of the command to execute.
774-
*/
775-
command: string;
776-
/**
777-
* A unique identifier for a conversation session between a client and agent.
778-
*
779-
* Sessions maintain their own context, conversation history, and state,
780-
* allowing multiple independent interactions with the same agent.
781-
*
782-
* # Example
783-
*
784-
* ```
785-
* use agent_client_protocol::SessionId;
786-
* use std::sync::Arc;
787-
*
788-
* let session_id = SessionId(Arc::from("sess_abc123def456"));
789-
* ```
790-
*
791-
* See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
792-
*/
793-
sessionId: string;
794-
}
795762
/**
796763
* Response from the initialize method.
797764
*
@@ -823,7 +790,7 @@ export interface AgentCapabilities {
823790
loadSession?: boolean;
824791
promptCapabilities?: PromptCapabilities;
825792
/**
826-
* Agent supports commands via `list_commands` and `run_command`.
793+
* Agent supports commands via `list_commands`.
827794
*/
828795
supportsCommands?: boolean;
829796
}
@@ -1188,13 +1155,6 @@ export const listCommandsRequestSchema = z.object({
11881155
sessionId: z.string(),
11891156
});
11901157

1191-
/** @internal */
1192-
export const runCommandRequestSchema = z.object({
1193-
args: z.string().optional().nullable(),
1194-
command: z.string(),
1195-
sessionId: z.string(),
1196-
});
1197-
11981158
/** @internal */
11991159
export const annotationsSchema = z.object({
12001160
audience: z.array(roleSchema).optional().nullable(),
@@ -1599,7 +1559,6 @@ export const agentRequestSchema = z.union([
15991559
loadSessionRequestSchema,
16001560
promptRequestSchema,
16011561
listCommandsRequestSchema,
1602-
runCommandRequestSchema,
16031562
]);
16041563

16051564
/** @internal */

0 commit comments

Comments
 (0)