Skip to content

Commit 018c0c2

Browse files
authored
fix(unstable): Update additionalDirectories guidance (#1227)
In the implementation phase it has become clear most agents treat this as optional data in their persistence, and it is ok to change on resume/load. Given this, loosening the requirements of the RFD. Remove additional-root filter from session list as well, since it is best-effort anyway, and probably more of a footgun than not.
1 parent b47f900 commit 018c0c2

11 files changed

Lines changed: 109 additions & 228 deletions

File tree

docs/protocol/draft/file-system.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ authorize those paths against the session's effective root set.
1313
- by default, the effective root set is just `cwd`
1414
- if the unstable `sessionCapabilities.additionalDirectories` capability is in use, the effective root set becomes `[cwd, ...additionalDirectories]`
1515
- `cwd` remains the base for relative paths; additional roots only expand filesystem scope
16-
- when a Client discovers a session through `session/list`, it SHOULD treat `cwd` plus `SessionInfo.additionalDirectories` as the authoritative current root set until a later lifecycle request changes it
16+
- when a Client discovers a session through `session/list`, it SHOULD use `SessionInfo.additionalDirectories` together with `cwd` as the current root set when the field is present; if omitted, the Agent is not reporting additional-root state, and any later `session/load` or `session/resume` request establishes the root set explicitly
1717

1818
Because ACP filesystem methods are client-mediated, the Client remains
1919
responsible for enforcing those root boundaries.

docs/protocol/draft/schema-v2.mdx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,17 +1164,6 @@ these keys.
11641164

11651165
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
11661166

1167-
</ResponseField>
1168-
<ResponseField name="additionalDirectories" type={<><span>"string"</span><span>[]</span></>} >
1169-
**UNSTABLE**
1170-
1171-
This capability is not part of the spec yet, and may be removed or changed at any point.
1172-
1173-
Filter sessions by the exact ordered additional workspace roots. Each path must be absolute.
1174-
1175-
This filter applies only when the field is present and non-empty. When
1176-
omitted or empty, no additional-root filter is applied.
1177-
11781167
</ResponseField>
11791168
<ResponseField name="cursor" type={"string | null"} >
11801169
Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
@@ -1251,7 +1240,8 @@ Additional workspace roots to activate for this session. Each path must be absol
12511240

12521241
When omitted or empty, no additional roots are activated. When non-empty,
12531242
this is the complete resulting additional-root list for the loaded
1254-
session.
1243+
session. It may differ from any previously used or reported list as long as
1244+
the request `cwd` matches the session's `cwd`.
12551245

12561246
</ResponseField>
12571247
<ResponseField name="cwd" type={"string"} required>
@@ -1544,7 +1534,8 @@ Additional workspace roots to activate for this session. Each path must be absol
15441534

15451535
When omitted or empty, no additional roots are activated. When non-empty,
15461536
this is the complete resulting additional-root list for the resumed
1547-
session.
1537+
session. It may differ from any previously used or reported list as long as
1538+
the request `cwd` matches the session's `cwd`.
15481539

15491540
</ResponseField>
15501541
<ResponseField name="cwd" type={"string"} required>
@@ -6530,8 +6521,10 @@ This capability is not part of the spec yet, and may be removed or changed at an
65306521

65316522
Capabilities for additional session directories support.
65326523

6533-
By supplying `\{\}` it means that the agent supports the `additionalDirectories` field on
6534-
supported session lifecycle requests and `session/list`.
6524+
By supplying `\{\}` it means that the agent supports the `additionalDirectories`
6525+
field on supported session lifecycle requests. Agents that also support
6526+
`session/list` may return `SessionInfo.additionalDirectories` when they track
6527+
that state.
65356528

65366529
**Type:** Object
65376530

@@ -6575,7 +6568,10 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
65756568

65766569
This capability is not part of the spec yet, and may be removed or changed at any point.
65776570

6578-
Whether the agent supports `additionalDirectories` on supported session lifecycle requests and `session/list`.
6571+
Whether the agent supports `additionalDirectories` on supported session lifecycle requests.
6572+
6573+
Agents that also support `session/list` may return
6574+
`SessionInfo.additionalDirectories` when they track that state.
65796575

65806576
</ResponseField>
65816577
<ResponseField name="close" type={<><span><a href="#sessionclosecapabilities">SessionCloseCapabilities</a></span><span> | null</span></>} >
@@ -6933,9 +6929,11 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
69336929

69346930
This capability is not part of the spec yet, and may be removed or changed at any point.
69356931

6936-
Authoritative ordered additional workspace roots for this session. Each path must be absolute.
6932+
Additional workspace roots for this session, if the Agent reports them. Each path must be absolute.
69376933

6938-
When omitted or empty, there are no additional roots for the session.
6934+
Agents may omit this field when they do not track or surface additional-root
6935+
state. When present, this is the complete additional-root list known to
6936+
the Agent for the session.
69396937

69406938
</ResponseField>
69416939
<ResponseField name="cwd" type={"string"} required>

docs/protocol/draft/schema.mdx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,17 +1164,6 @@ these keys.
11641164

11651165
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
11661166

1167-
</ResponseField>
1168-
<ResponseField name="additionalDirectories" type={<><span>"string"</span><span>[]</span></>} >
1169-
**UNSTABLE**
1170-
1171-
This capability is not part of the spec yet, and may be removed or changed at any point.
1172-
1173-
Filter sessions by the exact ordered additional workspace roots. Each path must be absolute.
1174-
1175-
This filter applies only when the field is present and non-empty. When
1176-
omitted or empty, no additional-root filter is applied.
1177-
11781167
</ResponseField>
11791168
<ResponseField name="cursor" type={"string | null"} >
11801169
Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
@@ -1251,7 +1240,8 @@ Additional workspace roots to activate for this session. Each path must be absol
12511240

12521241
When omitted or empty, no additional roots are activated. When non-empty,
12531242
this is the complete resulting additional-root list for the loaded
1254-
session.
1243+
session. It may differ from any previously used or reported list as long as
1244+
the request `cwd` matches the session's `cwd`.
12551245

12561246
</ResponseField>
12571247
<ResponseField name="cwd" type={"string"} required>
@@ -1544,7 +1534,8 @@ Additional workspace roots to activate for this session. Each path must be absol
15441534

15451535
When omitted or empty, no additional roots are activated. When non-empty,
15461536
this is the complete resulting additional-root list for the resumed
1547-
session.
1537+
session. It may differ from any previously used or reported list as long as
1538+
the request `cwd` matches the session's `cwd`.
15481539

15491540
</ResponseField>
15501541
<ResponseField name="cwd" type={"string"} required>
@@ -6530,8 +6521,10 @@ This capability is not part of the spec yet, and may be removed or changed at an
65306521

65316522
Capabilities for additional session directories support.
65326523

6533-
By supplying `\{\}` it means that the agent supports the `additionalDirectories` field on
6534-
supported session lifecycle requests and `session/list`.
6524+
By supplying `\{\}` it means that the agent supports the `additionalDirectories`
6525+
field on supported session lifecycle requests. Agents that also support
6526+
`session/list` may return `SessionInfo.additionalDirectories` when they track
6527+
that state.
65356528

65366529
**Type:** Object
65376530

@@ -6575,7 +6568,10 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
65756568

65766569
This capability is not part of the spec yet, and may be removed or changed at any point.
65776570

6578-
Whether the agent supports `additionalDirectories` on supported session lifecycle requests and `session/list`.
6571+
Whether the agent supports `additionalDirectories` on supported session lifecycle requests.
6572+
6573+
Agents that also support `session/list` may return
6574+
`SessionInfo.additionalDirectories` when they track that state.
65796575

65806576
</ResponseField>
65816577
<ResponseField name="close" type={<><span><a href="#sessionclosecapabilities">SessionCloseCapabilities</a></span><span> | null</span></>} >
@@ -6933,9 +6929,11 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
69336929

69346930
This capability is not part of the spec yet, and may be removed or changed at any point.
69356931

6936-
Authoritative ordered additional workspace roots for this session. Each path must be absolute.
6932+
Additional workspace roots for this session, if the Agent reports them. Each path must be absolute.
69376933

6938-
When omitted or empty, there are no additional roots for the session.
6934+
Agents may omit this field when they do not track or surface additional-root
6935+
state. When present, this is the complete additional-root list known to
6936+
the Agent for the session.
69396937

69406938
</ResponseField>
69416939
<ResponseField name="cwd" type={"string"} required>

docs/protocol/draft/session-list.mdx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ If `sessionCapabilities.list` is not present, the Agent does not support listing
5555

5656
<Note>
5757
If the Agent also advertises the unstable
58-
`sessionCapabilities.additionalDirectories` capability, `session/list`
59-
supports filtering by `additionalDirectories`, and any returned
60-
`SessionInfo.additionalDirectories` value is the authoritative additional-root
61-
list for that session.
58+
`sessionCapabilities.additionalDirectories` capability, returned `SessionInfo`
59+
objects may include `additionalDirectories` when the Agent tracks that state.
6260
</Note>
6361

6462
<Note>
@@ -90,13 +88,6 @@ All parameters are optional. A request with an empty `params` object returns the
9088
with a matching `cwd` are returned.
9189
</ParamField>
9290

93-
<ParamField path="additionalDirectories" type="string[]">
94-
If the Agent advertises `sessionCapabilities.additionalDirectories`, filter
95-
sessions by the exact ordered additional-root list when this field is present
96-
and non-empty. Omitting the field or providing an empty array means no
97-
additional-root filter is applied.
98-
</ParamField>
99-
10091
<ParamField path="cursor" type="string">
10192
Opaque cursor token from a previous response's `nextCursor` field for
10293
cursor-based pagination. See [Pagination](#pagination).
@@ -148,10 +139,12 @@ The Agent **MUST** respond with a list of sessions and optional pagination metad
148139
Working directory for the session. Always an absolute path.
149140
</ResponseField>
150141
<ResponseField name="additionalDirectories" type="string[]">
151-
If the Agent advertises `sessionCapabilities.additionalDirectories`, this
152-
is the authoritative ordered additional-root list for the session when
153-
present. Omitting the field or returning an empty array means there are no
154-
additional roots.
142+
If the Agent advertises `sessionCapabilities.additionalDirectories`, it
143+
MAY include this field when it tracks additional-root state for the
144+
session. When present, this is the complete ordered additional-root list
145+
known to the Agent for that session. Omitting the field means the Agent is
146+
not reporting additional-root state; an explicit empty array means the
147+
Agent is reporting no additional roots.
155148
</ResponseField>
156149

157150
<ResponseField name="title" type="string">

docs/protocol/draft/session-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ When present, `additionalDirectories` has the following behavior:
367367
- `cwd` remains the primary working directory and the base for relative paths
368368
- each `additionalDirectories` entry **MUST** be an absolute path
369369
- omitting the field or providing an empty array activates no additional roots for the resulting session
370-
- on `session/load` and `session/resume`, Clients must send the full intended additional-root list again because omitting the field or providing an empty array does not restore stored roots implicitly
370+
- on `session/load` and `session/resume`, Clients must send the full intended additional-root list again; that list may differ from any previous or reported list as long as the request `cwd` matches the session's `cwd`, and omitting the field or providing an empty array does not restore stored roots implicitly
371371

372372
## Session ID
373373

0 commit comments

Comments
 (0)