Skip to content

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

Open
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/legacy-task-state-filter
Open

anxkhn wants to merge 1 commit 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

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/tasks/database_task_store.py 92.47% 93.01% 🟢 +0.54%
Total 93.10% 93.11% 🟢 +0.01%

Generated by coverage-comment.yml

This branch has not been deployed

No deployments
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.

1 participant