fix(admin): resolve vendor/model-shaped ids in the availability routes #42

Merged
alee merged 1 commits from fix/admin-model-id-slash-routing into main 2026-09-06 21:04:51 +00:00
Owner

Every OpenRouter model id contains a slash (google/lyria-3-pro-preview). The admin frontend already encodeURIComponent()s it before building the availability-toggle request URL, but Starlette decodes %2F back into a literal / before matching a plain str path parameter against the route -- so the request splits into extra path segments and 404s.

Confirmed live: every availability-override click on an OpenRouter model has been silently failing since #39 shipped (nobody had exercised these routes against a slash-containing id until today, when google/lyria-3-pro-preview -- a music-generation model -- got picked by auto routing and broke a real dispatch with a 404).

Fix: declare model_id as :path (Starlette's standard way to admit a slash mid-route) on all three affected routes -- GET detail, POST availability, DELETE availability.

New regression tests confirmed failing (404) on the unfixed code, passing after. Full suite: 1466 passed, 0 failures.

Every OpenRouter model id contains a slash (`google/lyria-3-pro-preview`). The admin frontend already `encodeURIComponent()`s it before building the availability-toggle request URL, but Starlette decodes `%2F` back into a literal `/` before matching a plain `str` path parameter against the route -- so the request splits into extra path segments and 404s. **Confirmed live**: every availability-override click on an OpenRouter model has been silently failing since #39 shipped (nobody had exercised these routes against a slash-containing id until today, when `google/lyria-3-pro-preview` -- a music-generation model -- got picked by `auto` routing and broke a real dispatch with a 404). Fix: declare `model_id` as `:path` (Starlette's standard way to admit a slash mid-route) on all three affected routes -- GET detail, POST availability, DELETE availability. New regression tests confirmed failing (404) on the unfixed code, passing after. Full suite: 1466 passed, 0 failures.
alee added 1 commit 2026-09-06 21:03:01 +00:00
Every OpenRouter model id contains a slash (google/lyria-3-pro-preview),
and the frontend already encodeURIComponent()s it before building the
request URL -- but Starlette decodes %2F back into a literal '/' before
matching a plain `str` path parameter, so the request splits into extra
path segments and 404s. Declaring model_id as `:path` on all three
routes (GET detail, POST/DELETE availability) fixes it the standard way.

Confirmed live: every availability-override click on an OpenRouter
model has been silently failing since #39 shipped, because nobody had
exercised these routes against a slash-containing id until now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRQXz5SYZYVWscxS1QqF6U
alee merged commit 9009adafb6 into main 2026-09-06 21:04:51 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alee/6krrt#42