-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Bug description
The dev UI frontend fetches runtime-config.json to discover the backendUrl (url_prefix). The current implementation (_setup_runtime_config in adk_web_server.py) writes this file into the installed package directory at startup:
src/google/adk/cli/browser/assets/config/runtime-config.json
In containerized environments where .venv is read-only, this write fails silently — the IOError is caught and logged but execution continues. The frontend then loads the static default {"backendUrl": ""} and makes all API calls without the url_prefix, resulting in 404s.
Steps to reproduce
- Install
google-adkinto a read-only virtualenv (e.g. a container image where.venvis baked into a read-only layer) - Run
adk web --url_prefix /my-prefix - Open the dev UI in a browser
- Observe that API calls go to
/api/...instead of/my-prefix/api/..., returning 404
Expected behavior
The dev UI should correctly use the configured url_prefix for all API calls regardless of whether the package directory is writable.
Actual behavior
The IOError when writing runtime-config.json is caught and logged:
Failed to write runtime config file .../runtime-config.json: [Errno 30] Read-only file system: '...'
The frontend falls back to {"backendUrl": ""} and all API requests 404.
Environment
- OS: Linux (Docker container with read-only
.venv) - Python version: 3.11+
- ADK version: latest main
Proposed fix
Serve runtime-config.json dynamically via a FastAPI endpoint instead of writing to the filesystem. See #4600.