You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2da60af
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/protocol/v2/draft/prompt-lifecycle.mdx
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,6 +328,12 @@ The same insertion boundary applies when [closing the session](/protocol/v2/draf
328
328
329
329
`running` reports foreground work, not insertion. It may precede insertion, the prompt response, and user-message updates, for example while a foreground hook runs. It does not acknowledge a pending prompt's insertion.
330
330
331
+
#### Prompts During Active Work
332
+
333
+
Clients **MAY** send `session/prompt` in any state, including while foreground work is `running` or `requires_action`. The Agent either inserts the prompt right away or holds it and inserts it later. Held prompts are inserted in the order they were received. What inserting during active work means, such as steering the current turn or starting the next one, is up to the Agent. Agents **MUST NOT** reject a prompt only because foreground work is active.
334
+
335
+
A held prompt's response stays pending until the prompt is inserted. The Client can withdraw it with [`$/cancel_request`](/protocol/v2/draft/cancellation), and [`session/cancel`](#cancellation) and `session/close` answer prompts that haven't been inserted with `-32800`. Future capabilities may let Agents advertise steering or queueing behavior.
336
+
331
337
#### Prompts that are never inserted
332
338
333
339
If a request is rejected before insertion, including by a hook or early failure, the Agent **MUST** return a JSON-RPC error response and **MUST NOT** emit user-message updates for that submission. [Request cancellation](/protocol/v2/draft/cancellation) before insertion uses `-32800`.
@@ -1061,8 +1067,7 @@ another foreground interval then begins, it reports an active state again,
1061
1067
even when the next interval starts immediately. Consecutive completed turns
1062
1068
therefore have an idle boundary, not a continuous `running` state. Completing
1063
1069
an individual prompt, command, or tool call while other foreground activity
1064
-
continues does not require an idle boundary. This does not require Agents to
1065
-
support prompts while work is active.
1070
+
continues does not require an idle boundary. For prompts sent while work is active, see [Prompts During Active Work](#prompts-during-active-work).
1066
1071
1067
1072
Handling an accepted prompt, including a local slash command that performs no
1068
1073
model work, **MUST** use the foreground lifecycle. A local command handled from
Copy file name to clipboardExpand all lines: docs/protocol/v2/prompt-lifecycle.mdx
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,12 @@ The same insertion boundary applies when [closing the session](/protocol/v2/sess
257
257
258
258
`running` reports foreground work, not insertion. It may precede insertion, the prompt response, and user-message updates, for example while a foreground hook runs. It does not acknowledge a pending prompt's insertion.
259
259
260
+
#### Prompts During Active Work
261
+
262
+
Clients **MAY** send `session/prompt` in any state, including while foreground work is `running` or `requires_action`. The Agent either inserts the prompt right away or holds it and inserts it later. Held prompts are inserted in the order they were received. What inserting during active work means, such as steering the current turn or starting the next one, is up to the Agent. Agents **MUST NOT** reject a prompt only because foreground work is active.
263
+
264
+
A held prompt's response stays pending until the prompt is inserted. The Client can withdraw it with [`$/cancel_request`](/protocol/v2/cancellation), and [`session/cancel`](#cancellation) and `session/close` answer prompts that haven't been inserted with `-32800`. Future capabilities may let Agents advertise steering or queueing behavior.
265
+
260
266
#### Prompts that are never inserted
261
267
262
268
If a request is rejected before insertion, including by a hook or early failure, the Agent **MUST** return a JSON-RPC error response and **MUST NOT** emit user-message updates for that submission. [Request cancellation](/protocol/v2/cancellation) before insertion uses `-32800`.
@@ -935,8 +941,7 @@ another foreground interval then begins, it reports an active state again,
935
941
even when the next interval starts immediately. Consecutive completed turns
936
942
therefore have an idle boundary, not a continuous `running` state. Completing
937
943
an individual prompt, command, or tool call while other foreground activity
938
-
continues does not require an idle boundary. This does not require Agents to
939
-
support prompts while work is active.
944
+
continues does not require an idle boundary. For prompts sent while work is active, see [Prompts During Active Work](#prompts-during-active-work).
940
945
941
946
Handling an accepted prompt, including a local slash command that performs no
942
947
model work, **MUST** use the foreground lifecycle. A local command handled from
0 commit comments