Skip to content

Commit 5fea479

Browse files
authored
docs(schema): define session/list cwd matching (#2609)
1 parent 76ff0e4 commit 5fea479

7 files changed

Lines changed: 17 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,9 @@ crate::serde_util::default_on_null! {
17431743
pub struct ListSessionsRequest {
17441744
/// Filter sessions by working directory. Must be an absolute path.
17451745
///
1746+
/// Only sessions whose `cwd` is this same directory match; subdirectories and
1747+
/// `additionalDirectories` don't. Agents MAY normalize paths when comparing.
1748+
///
17461749
/// Omitted and `null` are equivalent and mean sessions are not filtered by working directory.
17471750
#[serde(default)]
17481751
pub cwd: Option<AbsolutePath>,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,9 @@ Omitted and `null` are equivalent and mean the first page is requested.
743743
<ResponseField name="cwd" type={<><span><a href="#absolutepath">AbsolutePath</a></span><span> | null</span></>} >
744744
Filter sessions by working directory. Must be an absolute path.
745745

746+
Only sessions whose `cwd` is this same directory match; subdirectories and
747+
`additionalDirectories` don't. Agents MAY normalize paths when comparing.
748+
746749
Omitted and `null` are equivalent and mean sessions are not filtered by working directory.
747750

748751
</ResponseField>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ All parameters are optional. A request with an empty `params` object returns the
6262

6363
<ParamField path="cwd" type="string">
6464
Filter sessions by working directory. Must be an absolute path. Only sessions
65-
with a matching `cwd` are returned.
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.
6668
</ParamField>
6769

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

‎docs/protocol/v2/schema.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ Omitted and `null` are equivalent and mean the first page is requested.
413413
<ResponseField name="cwd" type={<><span><a href="#absolutepath">AbsolutePath</a></span><span> | null</span></>} >
414414
Filter sessions by working directory. Must be an absolute path.
415415

416+
Only sessions whose `cwd` is this same directory match; subdirectories and
417+
`additionalDirectories` don't. Agents MAY normalize paths when comparing.
418+
416419
Omitted and `null` are equivalent and mean sessions are not filtered by working directory.
417420

418421
</ResponseField>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ All parameters are optional. A request with an empty `params` object returns the
6262

6363
<ParamField path="cwd" type="string">
6464
Filter sessions by working directory. Must be an absolute path. Only sessions
65-
with a matching `cwd` are returned.
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.
6668
</ParamField>
6769

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

‎schema/v2/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6792,7 +6792,7 @@
67926792
"type": "object",
67936793
"properties": {
67946794
"cwd": {
6795-
"description": "Filter sessions by working directory. Must be an absolute path.\n\nOmitted and `null` are equivalent and mean sessions are not filtered by working directory.",
6795+
"description": "Filter sessions by working directory. Must be an absolute path.\n\nOnly sessions whose `cwd` is this same directory match; subdirectories and\n`additionalDirectories` don't. Agents MAY normalize paths when comparing.\n\nOmitted and `null` are equivalent and mean sessions are not filtered by working directory.",
67966796
"anyOf": [
67976797
{
67986798
"$ref": "#/$defs/AbsolutePath"

‎schema/v2/schema.unstable.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8040,7 +8040,7 @@
80408040
"type": "object",
80418041
"properties": {
80428042
"cwd": {
8043-
"description": "Filter sessions by working directory. Must be an absolute path.\n\nOmitted and `null` are equivalent and mean sessions are not filtered by working directory.",
8043+
"description": "Filter sessions by working directory. Must be an absolute path.\n\nOnly sessions whose `cwd` is this same directory match; subdirectories and\n`additionalDirectories` don't. Agents MAY normalize paths when comparing.\n\nOmitted and `null` are equivalent and mean sessions are not filtered by working directory.",
80448044
"anyOf": [
80458045
{
80468046
"$ref": "#/$defs/AbsolutePath"

0 commit comments

Comments
 (0)