Skip to content

fix(server): include legacy task states in database list filters - #1337

Merged
mykytanetipa merged 2 commits into
a2aproject:mainfrom
anxkhn:fix/legacy-task-state-filter
Oct 24, 2026
Merged

mykytanetipa merged 2 commits into
a2aproject:mainfrom
anxkhn:fix/legacy-task-state-filter

Conversation

@anxkhn

@anxkhn anxkhn commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

description

DatabaseTaskStore can read v0.3 task rows, but its status filter compares their JSON state only with the 1.0 protobuf enum name. A legacy working task is readable with GetTask yet missing from ListTasks(status=WORKING), with an incorrect total.

Match both spellings using the existing compatibility converter. The filter stays in SQL before counting and pagination, with owner scoping unchanged. No schema change is needed.

The regression covers all eight concrete states, mixed modern and legacy rows, missing legacy protocol versions, owner isolation and page tokens. All eight SQLite cases failed before the fix.

validation

Rebased onto main at 799fcae. Fresh checks on that base:

  • UV_PYTHON=3.10 ./scripts/lint.sh passed Ruff, formatting and ty.
  • UV_PYTHON=3.10 uv run pytest --timeout=45: 2,277 passed, 199 skipped, 3 xfailed, 1 xpassed.
  • UV_PYTHON=3.10 uv run pytest --timeout=45 --cov=src --cov-report=term-missing --cov-fail-under=88: same test results, 93.29% coverage.

PostgreSQL/MySQL service tests skipped because their DSNs were unset. The new regressions ran on SQLite. Existing xfail/xpass cases reference #869.

@anxkhn
anxkhn requested a review from a team as a code owner October 12, 2026 13:59
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/tasks/database_task_store.py 95.16% 95.70% 🟢 +0.54%
Total 92.98% 92.99% 🟢 +0.01%

Generated by coverage-comment.yml

@mykytanetipa mykytanetipa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mykytanetipa
mykytanetipa merged commit e12d494 into a2aproject:main Oct 24, 2026
18 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