Skip to content

refactor: define terminal and interrupted task states in one place - #1396

Merged
Iwaniukooo11 merged 1 commit into
a2aproject:mainfrom
mykytanetipa:refactor/shared-task-state-sets
Oct 27, 2026
Merged

Iwaniukooo11 merged 1 commit into
a2aproject:mainfrom
mykytanetipa:refactor/shared-task-state-sets

Conversation

@mykytanetipa

@mykytanetipa mykytanetipa commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

The set of terminal task states was copied in four places (ActiveTask, the legacy request handler, VersionedDatabaseTaskStore and TaskUpdater), and DefaultRequestHandlerV2 imported the state sets from the ActiveTask module. This moves TERMINAL_TASK_STATES and INTERRUPTED_TASK_STATES into a2a.utils.constants and re-uses them everywhere.

Notes

  • No behavior change or import cycle introduced.
  • The old names on active_task and default_request_handler still point to the shared sets, so existing external imports keep working.
  • TaskUpdater still sets its own _terminal_states (now a copy of the shared set), since TaskUpdater is public API and subclasses may read or customize it.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/agent_execution/active_task.py 95.81% 95.79% 🔴 -0.02%
src/a2a/server/cluster/database_event_stream.py 96.94% 92.86% 🔴 -4.08%
src/a2a/server/cluster/database_task_store.py 99.30% 99.30% ⚪️ -0.00%
src/a2a/server/request_handlers/default_request_handler.py 97.99% 97.99% 🔴 -0.01%
Total 93.41% 93.37% 🔴 -0.04%

Generated by coverage-comment.yml

@mykytanetipa
mykytanetipa force-pushed the refactor/shared-task-state-sets branch from 93cc81c to 96e2501 Compare October 27, 2026 14:55
@mykytanetipa
mykytanetipa force-pushed the refactor/shared-task-state-sets branch from 96e2501 to 4e75d94 Compare October 27, 2026 15:02
@mykytanetipa
mykytanetipa marked this pull request as ready for review October 27, 2026 15:07
@mykytanetipa
mykytanetipa requested a review from a team as a code owner October 27, 2026 15:07
@Iwaniukooo11 Iwaniukooo11 self-assigned this Oct 27, 2026

@Iwaniukooo11 Iwaniukooo11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 43d1eff into a2aproject:main Oct 27, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants