Skip to content

bug(api): 13 routes served at doubled /api/<prefix>/api/... paths — decorators hard-code /api inside routers already mounted under /api #18722

Closed

Description

@mrveiss

Verified on origin/main 0196c7c234 (umbrella #18717).

  • api/system.py (router mounted at /system): @router.get("/api/cache/stats") (:985), post("/api/cache/evict") (:1015), post("/api/cache/clear/{cache_name}") (:1045), served at /api/system/api/cache/... (in the generated api.ts, :2564/:2592). system.py:752 also has a normal /cache/stats.
  • api/knowledge_ownership.py (mounted at /knowledge_base): 5 routes @router.*("/api/knowledge/facts/..."), served at /api/knowledge_base/api/knowledge/facts/....
  • api/knowledge_grounding.py: APIRouter(prefix="/api") mounted at /knowledge_base, so /api/knowledge_base/api/ground-response, /verify-claim, /kb-conflicts, /kb-stats.

Not checked: whether any client calls the doubled paths (the report found none; SettingsPanel.vue calls /cache/...).

Acceptance criteria

  • Each route is served at its intended single-prefix path; callers (FE, SLM, generated types) are found by grep and updated, or shown to be absent.
  • A guard fails on a decorator path or router prefix starting with /api under a router mounted below /api (planted control).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions