Repository navigation
feat: clarify TaskState terminal vs. non-terminal (interrupted) semantics - #2270
Merged
msampathkumar merged 1 commit intoOct 13, 2026
Merged
Conversation
… semantics Task states are terminal or non-terminal; the interrupted states INPUT_REQUIRED and AUTH_REQUIRED are non-terminal. A non-terminal task stays under the server's control: it MAY keep processing and transition to any other state (including out of an interrupted state) without a client message, and MAY keep accepting messages. Entering a non-terminal state does not necessitate closing a streaming response. Defines terminal vs. non-terminal at the TaskState level in both the proto comment and spec 4.1.3; scopes the streaming rule to 3.1.2 (a non-terminal/interrupted state SHOULD NOT by itself close the stream) and drops "or interrupted" from the 11.7 SSE close rule. Prose-only, no wire change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
vinoo999
force-pushed
the
spec/interrupted-state-semantics
branch
from
September 29, 2026 08:14
2f174ea to
8ac147e
Compare
herczyn
approved these changes
Sep 29, 2026
darrelmiller
approved these changes
Oct 6, 2026
Tehsmash
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clarifies that task states are terminal or non-terminal, and that the interrupted states
TASK_STATE_INPUT_REQUIREDandTASK_STATE_AUTH_REQUIREDare non-terminal. A non-terminal task stays under the server's control: the server MAY keep processing it and transition it to any other state — including out of an interrupted state — without a message from the client, and MAY keep accepting messages directed to it. Entering a non-terminal state does not necessitate closing a streaming response.Prose-only. No new types, fields, or enum values, and no wire change.
Motivation
The interrupted states are already labelled "interrupted" in
a2a.proto, and the streaming operations (§3.1.2, §3.1.6) already close a stream only on a terminal state. But the SSE binding prose (§11.7) said the stream closes on "a terminal or interrupted state", and the spec never stated plainly what terminal vs. non-terminal means. That left implementors inferring a stricter, client-driven model than the protocol requires — e.g. thatINPUT_REQUIREDends the turn and closes the stream.Nothing in the protocol prevents sending a message to a task in an interrupted state, or an agent moving a task out of an interrupted state on its own. The server owns the task lifecycle; sending to a running task is otherwise underspecified for interop (#1992). This PR states the rule once, at the
TaskStatelevel, so bindings have a single thing to implement against. It also unblocks the input-required discussion and complements the steering extension (#2125).Changes
specification/a2a.proto—TaskStateenum comment: define terminal vs. non-terminal/interrupted at the lifecycle level. Per-state comments unchanged.docs/specification.md§4.1.3 — matching normative definition under the enum table. Delivery-agnostic; streaming stays in the streaming operation.docs/specification.md§3.1.2 — in the Task lifecycle stream, a non-terminal/interrupted state SHOULD NOT by itself close the stream (terminal still MUST).docs/specification.md§11.7 — drop "or interrupted" from the SSE close rule; point to §3.1.2.Breaking change?
Drafted as SHOULD NOT (not MUST NOT) so no conforming implementation is invalidated. The only behavioral shift is for servers that close the SSE stream on an interrupted state today (see Appendix). Opening a vote to record whether this counts as breaking.
Non-goals
TaskStatus.message— how an agent describes the requested input is a docs concern, not this change.SendMessage/return_immediatelysemantics — unchanged.WORKINGtask — separate extension, [Extension Proposal]: Agent Steering — interruptible & steerable tasks #2125.Appendix: current SDK behavior (server side)
Which SDK server implementations end a streaming response when a task enters an interrupted state:
input-required?auth-required?DefaultRequestHandlerV2(default)active_task.py—INTERRUPTED_TASK_STATESkept disjoint fromTERMINAL_TASK_STATES; stream handler has no state-based breakLegacyRequestHandlerevent_consumer.py: consume_all()—is_final_eventset includesINPUT_REQUIRED(#167)internal/taskupdate/final.go: IsFinal()→state.Terminal() || state == TaskStateInputRequiredexecution_event_queue.ts: events()stop set =TERMINAL_STATE_LIST || INPUT_REQUIRED_STATE_LIST(AUTH excluded)TaskUpdater.cs—RequireInputAsync()andRequireAuthAsync()both calleventQueue.Complete()auth-requiredis already broadly compliant; only a2a-dotnet closes on it.input-requiredis the divergence: only a2a-python V2 (the default) keeps the stream open; go, js, python-legacy, and dotnet close.input-requiredfrom the stop predicate (IsFinalin go,events()in js,consume_allin python-legacy), and stop callingComplete()in dotnet'sRequireInputAsync/RequireAuthAsync. SHOULD NOT → MUST NOT is a candidate for a later minor once these converge.Related: #2084, #2129, #1992, #2125.
🤖 Generated with Claude Code