Skip to content

feat: clarify TaskState terminal vs. non-terminal (interrupted) semantics - #2270

Merged
msampathkumar merged 1 commit into
a2aproject:dev-1.1from
vinoo999:spec/interrupted-state-semantics
Oct 13, 2026
Merged

msampathkumar merged 1 commit into
a2aproject:dev-1.1from
vinoo999:spec/interrupted-state-semantics

Conversation

@vinoo999

@vinoo999 vinoo999 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clarifies that task states are terminal or non-terminal, and that the interrupted states TASK_STATE_INPUT_REQUIRED and TASK_STATE_AUTH_REQUIRED are 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. that INPUT_REQUIRED ends 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 TaskState level, 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 — TaskState enum 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

Appendix: current SDK behavior (server side)

Which SDK server implementations end a streaming response when a task enters an interrupted state:

SDK Closes on input-required? Closes on auth-required? Where
a2a-python DefaultRequestHandlerV2 (default) No No active_task.py — INTERRUPTED_TASK_STATES kept disjoint from TERMINAL_TASK_STATES; stream handler has no state-based break
a2a-python LegacyRequestHandler Yes No event_consumer.py: consume_all() — is_final_event set includes INPUT_REQUIRED (#167)
a2a-go Yes No internal/taskupdate/final.go: IsFinal() → state.Terminal() || state == TaskStateInputRequired
a2a-js Yes No execution_event_queue.ts: events() stop set = TERMINAL_STATE_LIST || INPUT_REQUIRED_STATE_LIST (AUTH excluded)
a2a-dotnet Yes Yes TaskUpdater.cs — RequireInputAsync() and RequireAuthAsync() both call eventQueue.Complete()
  • auth-required is already broadly compliant; only a2a-dotnet closes on it.
  • input-required is the divergence: only a2a-python V2 (the default) keeps the stream open; go, js, python-legacy, and dotnet close.
  • Bringing an SDK in line is small and wire-neutral: drop input-required from the stop predicate (IsFinal in go, events() in js, consume_all in python-legacy), and stop calling Complete() in dotnet's RequireInputAsync/RequireAuthAsync. SHOULD NOT → MUST NOT is a candidate for a later minor once these converge.

Related: #2084, #2129, #1992, #2125.

🤖 Generated with Claude Code

@vinoo999
vinoo999 requested a review from a team as a code owner September 29, 2026 08:12
… 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
vinoo999 force-pushed the spec/interrupted-state-semantics branch from 2f174ea to 8ac147e Compare September 29, 2026 08:14
@Tehsmash Tehsmash changed the title docs(spec): clarify TaskState terminal vs. non-terminal (interrupted) semantics docs: clarify TaskState terminal vs. non-terminal (interrupted) semantics Oct 13, 2026
@Tehsmash Tehsmash changed the title docs: clarify TaskState terminal vs. non-terminal (interrupted) semantics feat: clarify TaskState terminal vs. non-terminal (interrupted) semantics Oct 13, 2026
@msampathkumar
msampathkumar merged commit 3a7f6e2 into a2aproject:dev-1.1 Oct 13, 2026
5 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants