Repository navigation
Conversation
| if ( | ||
| pinned | ||
| and smart_routing_v2.first_prompt_routing_enabled(agent=tool) | ||
| and os.environ.get(ISAAC_LAUNCH_MODE_ENV_VAR) != "omni" |
There was a problem hiding this comment.
@lilly-luo , let me know if you prefer to use OMNIGENT =1 env var instead if we don't want to add isaac specific env var check here.
| if ( | ||
| pinned | ||
| and smart_routing_v2.first_prompt_routing_enabled(agent=tool) | ||
| and os.environ.get(ISAAC_LAUNCH_MODE_ENV_VAR) != "omni" |
| [(["--model", "system.ai.claude-opus-5-5"], None), ([], "system.ai.claude-opus-5-5")], | ||
| ids=["forwarded-model", "ug-model"], | ||
| ) | ||
| def test_first_prompt_launch_starts_on_a_pinned_model( |
| assert launched["argv"].count("--model") == 1 | ||
| assert launched["settings"]["env"][v2.ENABLE_SUBAGENT_ROUTING_ENV_VAR] == "1" |
There was a problem hiding this comment.
can we assert the --model value is still opus? the name says "keeps the model", but the count check still passes if routing swaps in the routed model.
Suggestion:
| assert launched["argv"].count("--model") == 1 | |
| assert launched["settings"]["env"][v2.ENABLE_SUBAGENT_ROUTING_ENV_VAR] == "1" | |
| argv = launched["argv"] | |
| assert argv.count("--model") == 1 | |
| assert argv[argv.index("--model") + 1] == "opus" | |
| assert launched["settings"]["env"][v2.ENABLE_SUBAGENT_ROUTING_ENV_VAR] == "1" |
UG review recommendationRECOMMENDATION: APPROVE Reasons:
Complete review of 4 files; no findings. Advisory only: this recommendation never approves or merges the pull request. The |
|
/ug-review |
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). |
Polly AI ReviewBlocking issuesNone confirmed in the changed code. Security vulnerabilitiesNone identified. Non-blocking notes
ApproachThe approach is sound: change the existing launch-policy gate and reuse Claude’s first-prompt hook and Codex’s interposer. A separate routing mechanism is unnecessary. The tradeoff is intentional: under SummaryDiff size (computed): 6 files; +130 / -15 lines (145 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesAllows first-prompt routing with an explicit model when The size is proportional to the outcome. The concrete reduction opportunity is the overlapping TestsTest-by-test assessmentStatic assessment only; no tests or lint were executed. The author-reported results are not independently verified. Both trusted policy files were read in full, and the saved diff’s checksum matches. Neither supplied revision exists in the trusted checkout, so surrounding-code checks use default-branch context rather than an exact-head checkout.
Existing Claude restoration/fallback and Codex interposer tests cover downstream routing boundaries; another broad failure matrix is unnecessary. The new tests establish launch eligibility, arguments, and hook registration—not a completed native model switch. Live omni inference, routing request/response evidence, and downstream telemetry remain unverified. For manual verification on an authorized exact-head installation: select the first-prompt preset, launch with ScopeAll changes support the stated omni-pinned first-prompt routing outcome. No unrelated changes or unresolved scope questions were found in the frozen diff. Automated review by Polly · workflow run |
ba65ae3 to
07f6280
Compare
…der isaac omni An explicit --model turns smart routing off when the version routes the first prompt, since that routing would replace the pinned model. Isaac's Omnigent launches (ISAAC_LAUNCH_MODE=omni) always pin the model, so a first-prompt version could never route them. Under omni the pinned model is now the starting model: Claude starts on it and the first prompt may route to another. Outside omni nothing changes, --disable-smart-routing still wins, and headless -p keeps the model and routes only subagents. The test isolation clears ISAAC_LAUNCH_MODE so a suite run from an Omnigent pane matches CI. Co-authored-by: Isaac <no-reply@databricks.com>
aae00c4 to
da0422e
Compare
|
Closing this: the design changed so that Isaac drops |
What and why
Under
ISAAC_LAUNCH_MODE=omni, an explicit--modelno longer turns smart routing off when the version routes the first prompt. The pinned model becomes the starting model: Claude starts on it, and the first prompt hold may switch to the routed model.Today (#1268) an explicit model allows only subagent only routing, since first prompt routing would replace it. Omnigent passes
--modelon every Claude launch, so a first prompt version such asfirst_prompt_and_subagent_orch_v0(#1848) can never route an Omnigent session. Omnigent automation runs need it: they launch with the owner's model or a default, and should route from the first prompt (Isaac companion: https://1.gitspoke.cloud.databricks.com/databricks-eng-ghes/universe/pull/10011231).Stacked on #1848; #1860 sits on top of this PR (stack: #1848, #1887, #1860).
Behavior
Launch with
--model X(forwarded or ug's own) and a first prompt version:isaac omniISAAC_LAUNCH_MODE=omni, interactiveISAAC_LAUNCH_MODE=omni, headless-p--disable-smart-routingSubagent only versions keep today's behavior everywhere: routed, with the main session on X.
Codex follows the same rule. Omnigent's Codex launch passes the model as
-c model=…, which isn't a pin, so it is unaffected; only a Codex launch with--modelunderomniwould now route its first turn.Worth knowing
ISAAC_LAUNCH_MODE=omni, like the Codex toggle check incli.pyand the feedback rule. Isaac's toggle still decides whether routing reaches ug at all.conftest.pynow clearsISAAC_LAUNCH_MODE, so a suite run inside an Omnigent pane matches CI.--modelroutes nothing, which fails closed.Tests
tests/test_cli.py:test_isaac_omni_explicit_model_keeps_first_prompt_routing: for every pinned launch shape (forwarded--model, headless-p, ug--model, Codex), first prompt routing launches routed underomniand stays off underdirect. The shapes are shared withtest_explicit_model_keeps_only_subagent_routing, which is otherwise unchanged.test_isaac_omni_forwarded_model_keeps_first_prompt_routing: Omnigent's launch shape (<tool> -- --model X) withfirst_prompt_and_subagent_orch_v0underomniis routed for Claude and Codex, and--disable-smart-routingstill turns it off.tests/test_claude_smart_routing_v2.py:test_first_prompt_launch_starts_on_a_pinned_model: with a forwarded or ug--model, the first prompt launch runs the PTY path, passes the model once, and installs the first prompt hook.test_explicit_model_skips_routingis renamedtest_explicit_model_keeps_the_model_and_routes_only_subagentsand now also checks that headless-pkeeps subagent routing on.cli.pychange reverted, the 6omnicases fail.ISAAC_LAUNCH_MODE=omniset in the shell, the CLI, routing and skills files still pass (1722).ruff check src/ tests/andruff format --check src/ tests/pass.ty check src/reports only the 8 OpenTelemetry import errors of my local venv, the same as onmain./integration-test) and a live Omnigent run.Checklist before requesting review
/ug-reviewand address the comments./integration-testand address any failures.This pull request and its description were written by Isaac.