fix(admin): resolve vendor/model-shaped ids in the availability routes #42
Reference in New Issue
Block a user
Delete Branch "fix/admin-model-id-slash-routing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every OpenRouter model id contains a slash (
google/lyria-3-pro-preview). The admin frontend alreadyencodeURIComponent()s it before building the availability-toggle request URL, but Starlette decodes%2Fback into a literal/before matching a plainstrpath 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 byautorouting and broke a real dispatch with a 404).Fix: declare
model_idas: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.