Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/tasks/database_task_store.py | 96.77% | 98.39% | 🟢 +1.61% |
| src/a2a/migrations/versions/d7ef24c86b19_mysql_task_timestamp_precision.py (new) | — | 85.71% | — |
| Total | 94.11% | 94.12% | 🟢 +0.01% |
Generated by coverage-comment.yml
This branch has not been deployed
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.
Description
On MySQL,
tasks.last_updatedis created asDATETIMEwith no fractional seconds, while the SDK stamps task status with microseconds.ListTasksfilters, sorts and pages on that column, so tasks updated within the same second come back out of order, andstatus_timestamp_aftercan drop a task at its own timestamp or include one from before the cutoff.Map
last_updatedtoDATETIME(6)on MySQL and MariaDB and add Alembic revisiond7ef24c86b19for existing tables. The index, the cursor format and the list query are unchanged. PostgreSQL and SQLite already keep microseconds; the revision does nothing there.Fixes #1505
Migration
DATETIMEtoDATETIME(6)rebuilds the table (ALGORITHM=COPY) and blocks writes during the copy. The migrations README now says so. InnoDB online DDLstatusJSON could move old rows across an issued cursor, and custom converters choose their ownlast_updated.--tasks-table.a2a-dbcommand runsupgrade head, applying any pending revisions includingb5e3d1c8a2f7(which createstask_versionsandtask_eventsif missing; the defaultDatabaseTaskStoreleaves them unused, whileVersionedDatabaseTaskStoreuses them). The migrations README now documents this.b5e3d1c8a2f7. Whichever lands second needs itsdown_revisionupdated.Verification
test_list_tasks_within_one_secondfails on the unpatched base with MySQL 8.0.36 (['latest', 'z-early', 'a-middle']) and passes on SQLite 3.45.1 and PostgreSQL 16.14. With the fix it passes on all three.mysqlandmariadbin both directions on a custom table name, noALTER TABLEfor PostgreSQL and SQLite, and a SQLite upgrade and downgrade cycle.a2a-db --tasks-table. The composite index survived, an old page token resumed, new writes listed in the right order with the right cutoff counts, and downgrade restored whole seconds.mariadb+aiomysql, SQLAlchemy 2.0.48, aiomysql 0.3.2): same custom-tablea2a-db --tasks-tableupgrade/downgrade cycle passed, and all 45test_database_task_store.pyMySQL-parametrized tests passed against the live server. On a disposable copy, MariaDB 10.11.14 rejectedALGORITHM=INPLACEand suggestedCOPY.PYTHONPATHin the local environment and all 5 passed when rerun withPYTHONPATHunset (2,887 total passes).Checklist
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)AI assistance: Codex, Claude and Gemini reproduced the bug, prepared the change and ran the checks under my direction.
🤖 Generated with Claude Code