refactor(routes): rename /agents and /agent-setup to /scouts and /scout-setup
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 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ from fastapi import APIRouter, WebSocket, WebSocketDisconnect
|
|||||||
from jose import JWTError, jwt
|
from jose import JWTError, jwt
|
||||||
from sqlalchemy import update
|
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.config.settings import settings
|
||||||
from app.core.agent_runner import trigger_pending_runs
|
from app.core.agent_runner import trigger_pending_runs
|
||||||
from app.core.agent_session_buffer import session_buffer
|
from app.core.agent_session_buffer import session_buffer
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
"""Agent routes.
|
"""Scout routes.
|
||||||
|
|
||||||
Backend responsibilities are intentionally minimal:
|
Backend responsibilities are intentionally minimal:
|
||||||
GET /agents/catalog — static catalog for UI display
|
GET /scouts/catalog — static catalog for UI display
|
||||||
POST /agents/can-create — billing eligibility check
|
POST /scouts/can-create — billing eligibility check
|
||||||
POST /agents/trigger — trigger a local agent run
|
POST /scouts/trigger — trigger a local scout run
|
||||||
|
|
||||||
Agent configuration is owned by the Electron app and is not persisted
|
Scout configuration is owned by the Electron app and is not persisted
|
||||||
in backend agent-config tables.
|
in backend scout-config tables.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -40,7 +40,7 @@ from app.schemas import (
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
router = APIRouter(prefix="/agents", tags=["agents"])
|
router = APIRouter(prefix="/scouts", tags=["scouts"])
|
||||||
|
|
||||||
|
|
||||||
# ── Datetime helpers ──────────────────────────────────────────────────
|
# ── Datetime helpers ──────────────────────────────────────────────────
|
||||||
@@ -124,12 +124,12 @@ def create_app() -> FastAPI:
|
|||||||
app.add_middleware(SanitizerMiddleware)
|
app.add_middleware(SanitizerMiddleware)
|
||||||
app.add_middleware(TierRateLimitMiddleware)
|
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(auth.router, prefix="/api/v1")
|
||||||
app.include_router(chat.router, prefix="/api/v1")
|
app.include_router(chat.router, prefix="/api/v1")
|
||||||
app.include_router(billing.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(device_ws.router, prefix="/api/v1")
|
||||||
app.include_router(memory.router, prefix="/api/v1")
|
app.include_router(memory.router, prefix="/api/v1")
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ from unittest.mock import patch
|
|||||||
import pytest
|
import pytest
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from app.api.routes.agent_setup import (
|
from app.api.routes.scout_setup import (
|
||||||
_CONFIG_END,
|
_CONFIG_END,
|
||||||
_CONFIG_START,
|
_CONFIG_START,
|
||||||
_MAX_TURNS,
|
_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 plain text — no markers — to trigger the nudge path.
|
||||||
return "I still need more information from you."
|
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(
|
fake_session = JourneySession(
|
||||||
session_id=session_id,
|
session_id=session_id,
|
||||||
@@ -248,7 +248,7 @@ async def test_4_6f_nudge_uses_new_markers():
|
|||||||
_sessions[session_id] = fake_session
|
_sessions[session_id] = fake_session
|
||||||
|
|
||||||
try:
|
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, {
|
await handle_journey_message(_USER_ID, {
|
||||||
"session_id": session_id,
|
"session_id": session_id,
|
||||||
"message": "one more message to trigger nudge",
|
"message": "one more message to trigger nudge",
|
||||||
|
|||||||
Reference in New Issue
Block a user