Skip to content

Commit e348016

Browse files
authored
docs(schema): define AbsolutePath syntax and reject relative cwd (#2629)
1 parent 2da60af commit e348016

11 files changed

Lines changed: 25 additions & 14 deletions

File tree

‎agent-client-protocol-schema/src/v2/mod.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ use std::{
5151
};
5252

5353
/// An absolute filesystem path used by the protocol.
54+
///
55+
/// Uses the native syntax of the machine the Agent runs on, such as `/home/user/project`,
56+
/// `C:\Users\user\project`, or `\\server\share\project`. It is not a URI.
5457
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
5558
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, From)]
5659
#[serde(transparent)]

‎docs/protocol/v2/draft/overview.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Either side can send [`$/cancel_request`](/protocol/v2/draft/cancellation) to ca
214214

215215
## Argument requirements
216216

217-
- All file paths in the protocol **MUST** be absolute.
217+
- All file paths in the protocol **MUST** be absolute, in the native syntax of the machine the Agent runs on (for example `/home/user/project`, `C:\Users\user\project`, or `\\server\share\project`), and are not URIs.
218218
- Line numbers are 1-based
219219

220220
## Error Handling

‎docs/protocol/v2/draft/schema.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d
18411841

18421842
An absolute filesystem path used by the protocol.
18431843

1844+
Uses the native syntax of the machine the Agent runs on, such as `/home/user/project`,
1845+
`C:\Users\user\project`, or `\\server\share\project`. It is not a URI.
1846+
18441847
**Type:** `string`
18451848

18461849
## <span class="font-mono">AgentAuthCapabilities</span>

‎docs/protocol/v2/draft/session-list.mdx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ Clients discover existing sessions by calling the `session/list` method with opt
6161
All parameters are optional. A request with an empty `params` object returns the first page of sessions.
6262

6363
<ParamField path="cwd" type="string">
64-
Filter sessions by working directory. Must be an absolute path. Only sessions
65-
whose `cwd` is this same directory are returned; sessions in subdirectories or
66-
with it in `additionalDirectories` don't match. Agents **MAY** normalize paths
67-
when comparing, for example ignoring a trailing separator.
64+
Filter sessions by working directory. Must be an absolute path; Agents reject
65+
a relative path with `-32602`. Only sessions whose `cwd` is this same
66+
directory are returned; sessions in subdirectories or with it in
67+
`additionalDirectories` don't match. Agents **MAY** normalize paths when
68+
comparing, for example ignoring a trailing separator.
6869
</ParamField>
6970

7071
<ParamField path="cursor" type="string">

‎docs/protocol/v2/draft/session-setup.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ Clients use this ID to:
519519

520520
The `cwd` (current working directory) parameter establishes the primary file system context for the session. This directory:
521521

522-
- **MUST** be an absolute path
522+
- **MUST** be an absolute path. Agents reject a request with a relative `cwd` with `-32602`.
523523
- **MUST** be used for the session regardless of where the Agent subprocess was spawned
524524
- **MUST** remain the base for relative-path resolution
525525
- **MUST** be part of the session's effective root set

‎docs/protocol/v2/overview.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Either side can send [`$/cancel_request`](/protocol/v2/cancellation) to cancel a
204204

205205
## Argument requirements
206206

207-
- All file paths in the protocol **MUST** be absolute.
207+
- All file paths in the protocol **MUST** be absolute, in the native syntax of the machine the Agent runs on (for example `/home/user/project`, `C:\Users\user\project`, or `\\server\share\project`), and are not URIs.
208208
- Line numbers are 1-based
209209

210210
## Error Handling

‎docs/protocol/v2/schema.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e
13871387

13881388
An absolute filesystem path used by the protocol.
13891389

1390+
Uses the native syntax of the machine the Agent runs on, such as `/home/user/project`,
1391+
`C:\Users\user\project`, or `\\server\share\project`. It is not a URI.
1392+
13901393
**Type:** `string`
13911394

13921395
## <span class="font-mono">AgentAuthCapabilities</span>

‎docs/protocol/v2/session-list.mdx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ Clients discover existing sessions by calling the `session/list` method with opt
6161
All parameters are optional. A request with an empty `params` object returns the first page of sessions.
6262

6363
<ParamField path="cwd" type="string">
64-
Filter sessions by working directory. Must be an absolute path. Only sessions
65-
whose `cwd` is this same directory are returned; sessions in subdirectories or
66-
with it in `additionalDirectories` don't match. Agents **MAY** normalize paths
67-
when comparing, for example ignoring a trailing separator.
64+
Filter sessions by working directory. Must be an absolute path; Agents reject
65+
a relative path with `-32602`. Only sessions whose `cwd` is this same
66+
directory are returned; sessions in subdirectories or with it in
67+
`additionalDirectories` don't match. Agents **MAY** normalize paths when
68+
comparing, for example ignoring a trailing separator.
6869
</ParamField>
6970

7071
<ParamField path="cursor" type="string">

‎docs/protocol/v2/session-setup.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ Clients use this ID to:
450450

451451
The `cwd` (current working directory) parameter establishes the primary file system context for the session. This directory:
452452

453-
- **MUST** be an absolute path
453+
- **MUST** be an absolute path. Agents reject a request with a relative `cwd` with `-32602`.
454454
- **MUST** be used for the session regardless of where the Agent subprocess was spawned
455455
- **MUST** remain the base for relative-path resolution
456456
- **MUST** be part of the session's effective root set

‎schema/v2/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@
14311431
]
14321432
},
14331433
"AbsolutePath": {
1434-
"description": "An absolute filesystem path used by the protocol.",
1434+
"description": "An absolute filesystem path used by the protocol.\n\nUses the native syntax of the machine the Agent runs on, such as `/home/user/project`,\n`C:\\Users\\user\\project`, or `\\\\server\\share\\project`. It is not a URI.",
14351435
"type": "string"
14361436
},
14371437
"DiffPathChange": {

0 commit comments

Comments
 (0)