diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 16052ba1..7dee3e0a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,7 +2,7 @@ name: Run Unit Tests on: pull_request: - branches: [main] + branches: [main, 1.0-dev] permissions: contents: read jobs: diff --git a/src/a2a/server/tasks/database_task_store.py b/src/a2a/server/tasks/database_task_store.py index 2ec02831..1605c601 100644 --- a/src/a2a/server/tasks/database_task_store.py +++ b/src/a2a/server/tasks/database_task_store.py @@ -189,8 +189,10 @@ async def list( count_stmt = select(func.count()).select_from(base_stmt.alias()) total_count = (await session.execute(count_stmt)).scalar_one() + # Use coalesce to treat NULL timestamps as empty strings, + # which sort last in descending order stmt = base_stmt.order_by( - timestamp_col.desc().nulls_last(), + func.coalesce(timestamp_col, '').desc(), self.task_model.id.desc(), )