Repository navigation
dev-ui 404s with url_prefix behind a prefix-stripping proxy since 2.11.0聽#7439
Description
Activity
I鈥檓 interested in investigating and fixing this, if nobody has already started. I would first reproduce the reported /dev-ui/ regression, then keep the change focused on mounted static-route handling while preserving the OpenAPI/root_path behavior introduced in #7071. Validation would cover no prefix, a prefix-stripping proxy, and the existing API/docs routes.
I found no public claim or matching PR for this issue. If you or another contributor already have work in progress, please let me know so I can avoid duplication. Maintainers: is this a suitable contribution to take on?
I plan to use Codex assistance. This is an interest/coordination request; I鈥檓 prioritizing one contribution at a time rather than promising simultaneous delivery.
I鈥檓 starting work on this issue now. My plan is to:
- Reproduce the 404 with a prefix-stripping proxy and add a failing regression test.
- Trace how root_path reaches the mounted dev-UI StaticFiles app, then make the smallest fix that preserves the Swagger/OpenAPI behavior from fix(cli): propagate url_prefix to FastAPI root_path聽#7071.
- Validate dev-UI HTML/assets, API routes, and docs with and without a prefix, including a prefix-preserving request path.
I rechecked the issue and open PRs and found no public competing claim or fix. If someone has already started privately, please flag it so we can coordinate. I鈥檓 using Codex assistance and will include the reproduction and test results in the PR.
Hello @MihailRussu,
Thank you for raising this issue. #7440 should resolve it, could you please take a look and test it and let us know your feedback?
- addedweb[Component] This issue will be transferred to adk-web[Component] This issue will be transferred to adk-webrequest clarification[Status] The maintainer need clarification or more information from the author[Status] The maintainer need clarification or more information from the author
on Oct 9, 2026
馃敶 Required Information
Describe the Bug:
Since 2.11.0, which derives FastAPI's
root_pathfromurl_prefix(#7071), the dev UI returns 404 when the app runs behind a proxy that strips the prefix, the setup #7071 was aimed at. API routes such as/list-appsstill work, only/dev-ui/breaks.Steps to Reproduce:
get_fast_api_app(agents_dir=..., web=True, url_prefix="/adk")(oradk web --url_prefix /adk)./dev-ui/, which is what a proxy forwards forhttps://host/adk/dev-ui/after stripping the prefix.Expected Behavior:
The dev UI's
index.htmlis served, as on 2.10.0.Observed Behavior:
/dev-ui/returns 404, while/list-appsreturns 200.Environment Details:
Model Information:
馃煛 Optional Information
Regression:
Yes, works on 2.10.0.
Additional Context:
As far as I can tell, Starlette expects
scope["path"]to includeroot_path. Top-level routes tolerate a path without it, which is why/list-appsstill matches, butMountbuilds the child scope'sroot_pathasroot_path + "/dev-ui"(/adk/dev-ui).StaticFilesthen can't strip that from/dev-ui/, so it looks updev-ui/inside the assets directory and 404s.Resetting
app.root_path = ''afterget_fast_api_app()restores the 2.10 behaviour as a workaround, at the cost of the/docsfix from #7071.Minimal Reproduction Code:
uv run --with google-adk==2.11.0 --with httpx python repro.pyHow often has this issue occurred?: