Repository navigation
Conversation
…s.jsonl Debug aid for inspecting the exact route menu ug sends to the AI Gateway router. select_route is the single call site for the Claude first prompt, Claude subagent, and Codex menus, so each call appends one JSON line with the URL and request body. The bearer token is not recorded. Output goes to a file because stdout belongs to the TUI and the hook protocol. Co-authored-by: Isaac <no-reply@databricks.com>
xsh310
force-pushed
the
debug-log-routing-requests
branch
from
October 18, 2026 03:00
3cb7f50 to
84c6636
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Debug aid: every
routes:selectcall ug makes now appends one JSON line to~/.ucode/routing-requests.jsonlwith the URL and the exact request body (route_options,task.prompt,route_selector.router_name). This shows the real menu ug sends for the Claude first prompt, Claude subagents, and Codex, so it can be replayed against an AI Gateway LiteSwap (testing databricks-eng/universe#2807774).{"at": 1792089748.1, "url": "https://<workspace>/ai-gateway/routing/v1/routes:select", "body": {"route_options": [{"model": "claude-opus-4-8", "harness": "claude"}], "task": {"prompt": "..."}, "route_selector": {"router_name": "task_v3"}}}routing.select_routeis the single call site for all three menus, so the log lives there.config_io.APP_DIRper call, so the test suite's autouse fixture keeps it in a tmp dir.Draft and not meant to merge as is: logging is always on, unbounded, and writes prompt text to disk.
Try it locally
Revert with
uv tool install --force --python 3.12 git+https://github.com/databricks/unity-gateway. The--python 3.12pin avoids a hatchling build failure when uv picks an older default interpreter.Testing
test_routing_request_is_logged: the logged URL and body equal what was sent, and the token is absent.test_claude_routing,test_codex_routing,test_*_smart_routing_v2): 132 passed.ruff checkandruff format --checkclean.test_skills.py::test_orchestrator_injects_the_installed_agent_instructionscases fail identically on unmodifiedmainin this environment.This pull request and its description were written by Isaac.