Repository navigation
Conversation
…trator under Isaac omni A Claude launch with an explicit --model now keeps subagent routing when first prompt routing is off, so Omnigent sessions started through Isaac and ug get routed subagents while the main session stays on the chosen model. Explicit models still skip routing for Codex and in first prompt mode. Smart Router Orchestrator no longer turns itself off under ISAAC_LAUNCH_MODE=omni. Co-authored-by: Isaac <no-reply@databricks.com>
An explicit --model now keeps Claude subagent routing only when the Omnigent runner's OMNIGENT=1 session marker is set and first prompt routing is off. Every other launch with an explicit model skips routing again, as on main. Co-authored-by: Isaac <no-reply@databricks.com>
db39106 to
7c8f026
Compare
…unches Adds an Omnigent row with a workspace managed config instead of a preset, a headless -p variant of the explicit model unit test, and a routed Claude launch test that checks a forwarded --model reaches Claude exactly once with no first prompt routing. Co-authored-by: Isaac <no-reply@databricks.com>
Moves the nested double negative in _should_launch_smart_routing into _omnigent_keeps_subagent_routing, and separates OMNIGENT_SESSION_ENV_VAR from the routing env keys it is not part of. No behavior change. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
| def _omnigent_keeps_subagent_routing(tool: str) -> bool: | ||
| """Omnigent always pins the root model, so its Claude sessions still route subagents.""" | ||
| return ( | ||
| tool == "claude" | ||
| and env_bool(OMNIGENT_SESSION_ENV_VAR) | ||
| and not smart_routing_v2.first_prompt_routing_enabled(agent=tool) | ||
| ) |
There was a problem hiding this comment.
we can just do this for all sessions, not just omnigent
There was a problem hiding this comment.
Done in a520485. I dropped the OMNIGENT check, so an explicit --model now keeps Claude subagent routing in any session with first prompt routing off. Two cases still skip routing with --model: first prompt routing, since it would replace the pinned model, and Codex, since its routed launch drops the pinned model.
One side effect to confirm: headless ug claude -p ... --model X under a subagent routing version now routes subagents too, and gets the orchestrator when the version turns it on. Fine with that, or should print mode stay out?
There was a problem hiding this comment.
yes let's keep subagent routing for headless mode too. if users don't want it, they can do ug claude -p ... --model X --disable-smart-routing. we should have the cost savings for headless mode as well and also reduces the branching logic for simplification
An explicit --model now keeps Claude subagent routing whenever first prompt routing is off, not only under Omnigent's OMNIGENT=1 marker. First prompt routing and Codex still skip routing with an explicit model: the first would replace the pinned model, and Codex's routed launch drops it. Removes OMNIGENT_SESSION_ENV_VAR and its test cleanup. Co-authored-by: Isaac <no-reply@databricks.com>
What did you change, and why?
Change: two changes so ug can route Claude subagents when the main model is pinned, as in every Omnigent session.
--modelkeeps Claude subagent routing. A Claude launch with--modelstill routes subagents, as long as first prompt routing is off. The main session stays on the chosen model. With first prompt routing on, or for Codex,--modelstill turns routing off, as on main: routing the first prompt would replace the pinned model, and Codex's routed launch drops it.isaac omni. Smart Router Orchestrator no longer turns itself off whenISAAC_LAUNCH_MODE=omni.Why: Omnigent always passes
--modelwhen it starts Claude, so today ug never routes Omnigent sessions. This is the first step of moving Omnigent's smart routing into ug.Behavior
--model X--enable-smart-routing, or a workspace config)--disable-smart-routingCodex is unchanged. Launches without
--modelroute as on main, except that underisaac omnithe orchestrator now also runs when the routing version turns it on (change 2).This PR is part 2 of the following change diagram:

Worth knowing
--model, not only Omnigent's, headless-pincluded. Launches with a subagent routing version,--enable-smart-routing, or a workspace config that turns smart routing on now get routed subagents, plus the orchestrator when the version turns it on, where--modelused to turn routing off. The main model stays pinned.How do you know it works?
Testing:
test_cli.pycover both ways to pass the model, both routing modes, headless-p, and Codex. A CLI test uses Omnigent's launch shape (claude -- --model system.ai.claude-opus-5-5) with either a subagent routing version or a workspace config that turns smart routing on, and checks that--disable-smart-routingand a first prompt version both turn routing off.test_claude_smart_routing_v2.pytest checks that a routed launch passes the forwarded--modelto Claude exactly once, without first prompt routing.--modelrows intest_claude_options_allow_smart_routing_except_modelnow run with first prompt routing on, where--modelstill skips routing. The shared Claude and Codex policy test drops its two--modelrows, since the agents now differ there; the new tests cover both.test_skills.pyruns the orchestrator test with and withoutISAAC_LAUNCH_MODE=omni.--modelunder a subagent routing version that shows a routed subagent is still needed.Manual end to end test with Isaac (2026-10-27):
Setup:
0.1.0+77638b6) with an earlier revision of this PR's--modelchange, and installed it in place of the stock ug. That revision keeps Claude subagent routing with--modelwhenever first prompt routing is off, the same rule as the current head.ISAAC_LAUNCH_MODE=omni ... isaac --model opus, as a user with thesubagent_orch_v0_claude_onlypreset.ENABLE_SMART_ROUTING_OMNI=1) and off.UCODE_SESSION_ENV_FILE, which it does only when it starts a smart routed session. In the routed run, a subagent was spawned and checked in ug's decision log.--model)claude-haiku-5-5byr9296-quality-20261008What this doesn't cover: the build was that earlier revision on top of Isaac's pinned ug, not this branch's head. The routing rule is the same.
This pull request and its description were written by Isaac.