From b92e72b685e767b412f17c2d70cab8803c98ef05 Mon Sep 17 00:00:00 2001 From: Roberto Date: Sat, 16 May 2026 00:00:07 +0200 Subject: [PATCH] refactor(routes): rename /agents and /agent-setup to /scouts and /scout-setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename routes/agents.py → routes/scouts.py and routes/agent_setup.py → routes/scout_setup.py. Update APIRouter prefix/tags in scouts.py to /scouts and scouts. Update main.py router registration, device_ws.py import, and test_journey_v2.py import/patch paths to use scout_setup. Co-Authored-By: Claude Sonnet 4.6 --- app/api/routes/device_ws.py | 2 +- app/api/routes/{agent_setup.py => scout_setup.py} | 0 app/api/routes/{agents.py => scouts.py} | 14 +++++++------- app/main.py | 4 ++-- tests/test_journey_v2.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) rename app/api/routes/{agent_setup.py => scout_setup.py} (100%) rename app/api/routes/{agents.py => scouts.py} (95%) diff --git a/app/api/routes/device_ws.py b/app/api/routes/device_ws.py index 943a496..1260702 100644 --- a/app/api/routes/device_ws.py +++ b/app/api/routes/device_ws.py @@ -39,7 +39,7 @@ from fastapi import APIRouter, WebSocket, WebSocketDisconnect from jose import JWTError, jwt from sqlalchemy import update -from app.api.routes.agent_setup import handle_journey_message, handle_journey_start +from app.api.routes.scout_setup import handle_journey_message, handle_journey_start from app.config.settings import settings from app.core.agent_runner import trigger_pending_runs from app.core.agent_session_buffer import session_buffer diff --git a/app/api/routes/agent_setup.py b/app/api/routes/scout_setup.py similarity index 100% rename from app/api/routes/agent_setup.py rename to app/api/routes/scout_setup.py diff --git a/app/api/routes/agents.py b/app/api/routes/scouts.py similarity index 95% rename from app/api/routes/agents.py rename to app/api/routes/scouts.py index 20426cb..95de491 100644 --- a/app/api/routes/agents.py +++ b/app/api/routes/scouts.py @@ -1,12 +1,12 @@ -"""Agent routes. +"""Scout routes. Backend responsibilities are intentionally minimal: - GET /agents/catalog — static catalog for UI display - POST /agents/can-create — billing eligibility check - POST /agents/trigger — trigger a local agent run + GET /scouts/catalog — static catalog for UI display + POST /scouts/can-create — billing eligibility check + POST /scouts/trigger — trigger a local scout run -Agent configuration is owned by the Electron app and is not persisted -in backend agent-config tables. +Scout configuration is owned by the Electron app and is not persisted +in backend scout-config tables. """ from __future__ import annotations @@ -40,7 +40,7 @@ from app.schemas import ( logger = logging.getLogger(__name__) -router = APIRouter(prefix="/agents", tags=["agents"]) +router = APIRouter(prefix="/scouts", tags=["scouts"]) # ── Datetime helpers ────────────────────────────────────────────────── diff --git a/app/main.py b/app/main.py index c35e020..cd3c0dd 100644 --- a/app/main.py +++ b/app/main.py @@ -124,12 +124,12 @@ def create_app() -> FastAPI: app.add_middleware(SanitizerMiddleware) app.add_middleware(TierRateLimitMiddleware) - from app.api.routes import agents, auth, billing, chat, device_ws, memory + from app.api.routes import scouts, auth, billing, chat, device_ws, memory app.include_router(auth.router, prefix="/api/v1") app.include_router(chat.router, prefix="/api/v1") app.include_router(billing.router, prefix="/api/v1") - app.include_router(agents.router, prefix="/api/v1") + app.include_router(scouts.router, prefix="/api/v1") app.include_router(device_ws.router, prefix="/api/v1") app.include_router(memory.router, prefix="/api/v1") diff --git a/tests/test_journey_v2.py b/tests/test_journey_v2.py index 9c09f6c..6076de9 100644 --- a/tests/test_journey_v2.py +++ b/tests/test_journey_v2.py @@ -37,7 +37,7 @@ from unittest.mock import patch import pytest import yaml -from app.api.routes.agent_setup import ( +from app.api.routes.scout_setup import ( _CONFIG_END, _CONFIG_START, _MAX_TURNS, @@ -230,7 +230,7 @@ async def test_4_6f_nudge_uses_new_markers(): # Return plain text — no markers — to trigger the nudge path. return "I still need more information from you." - from app.api.routes.agent_setup import JourneySession + from app.api.routes.scout_setup import JourneySession fake_session = JourneySession( session_id=session_id, @@ -248,7 +248,7 @@ async def test_4_6f_nudge_uses_new_markers(): _sessions[session_id] = fake_session try: - with patch("app.api.routes.agent_setup._call_llm_with_tools", side_effect=_mock_llm): + with patch("app.api.routes.scout_setup._call_llm_with_tools", side_effect=_mock_llm): await handle_journey_message(_USER_ID, { "session_id": session_id, "message": "one more message to trigger nudge",