From d72a0c125b881777fc0eef873058dc6b4a8ab1e1 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 8 Dec 2025 12:40:02 +0100 Subject: [PATCH] Fix failing tests for legacy auth and heartbeat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add agent_id parameter to legacy Bearer auth test (required by design) - Add last_heartbeat to test_agent_with_secret fixture 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tests/conftest.py | 3 ++- tests/routes/test_agent_auth.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1aa8666..1e62c19 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,7 +9,7 @@ import pytest import pytest_asyncio from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine -from app.models.base import Base +from app.models.base import Base, utc_now from app.models.tenant import Tenant from app.models.agent import Agent from app.models.registration_token import RegistrationToken @@ -139,6 +139,7 @@ async def test_agent_with_secret( status="online", token="", # Empty for new auth scheme secret_hash=secret_hash, + last_heartbeat=utc_now(), ) db.add(agent) await db.commit() diff --git a/tests/routes/test_agent_auth.py b/tests/routes/test_agent_auth.py index a201e27..dfccb39 100644 --- a/tests/routes/test_agent_auth.py +++ b/tests/routes/test_agent_auth.py @@ -109,6 +109,7 @@ class TestGetCurrentAgentCompat: x_agent_id=None, x_agent_secret=None, authorization=f"Bearer {test_agent_legacy.token}", + agent_id=test_agent_legacy.id, # Legacy auth requires agent_id ) assert result.id == test_agent_legacy.id