ucode: add --no-preflight to skip per-launch auth/gateway re-validation#195
Open
Edwinhe03 wants to merge 1 commit into
Open
ucode: add --no-preflight to skip per-launch auth/gateway re-validation#195Edwinhe03 wants to merge 1 commit into
Edwinhe03 wants to merge 1 commit into
Conversation
Every `ucode <agent>` launch re-runs configure_shared_state, which does an auth login check, a token fetch, an AI Gateway v2 probe, and per-launch model discovery — ~5-10s of network round-trips — even when a prior `ucode configure` already validated all of it. Managed/headless launchers (e.g. omnigent) that run configure once and then launch repeatedly pay this cost on every turn. Add a launch-only `--no-preflight` flag (distinct from the configure-only `--skip-validate`, which skips the post-configure model smoke test). It threads through _launch_tool as configure_shared_state(no_preflight=True), which skips the auth+gateway block and model discovery entirely — the PAT/bearer is already exported by apply_pat_environment and the gateway was verified by the earlier configure. The local profile resolution, base-URL rebuild, and state persistence still run, and previously-discovered model lists are preserved rather than clobbered with empties. Wired into every launch command (codex/claude/gemini/opencode/copilot/pi). Co-authored-by: Isaac
ddf72cd to
2ef7d98
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.
What
Every
ucode <agent>launch re-runsconfigure_shared_state, which does an auth login check, a token fetch, an AI Gateway v2 probe, and (outside provider mode) model discovery — ~5–10s of network round-trips — even when a priorucode configurealready validated all of it. Managed/headless launchers (e.g. omnigent) that runconfigureonce and then launch repeatedly pay this on every turn.Change
Add a launch-only
--no-preflightflag (distinct from the configure-only--skip-validate, which skips the post-configure model smoke test). It threads through_launch_toolasconfigure_shared_state(no_preflight=True), which skips the auth+gateway block and model discovery entirely:apply_pat_environment, and the AI Gateway was verified by the earlierconfigure, so the re-checks are redundant.Wired into every launch command (
codex/claude/gemini/opencode/copilot/pi). Default off — behavior is unchanged unless a caller opts in.Verification
ruff+tyclean.configure_shared_state(no_preflight=True)does not callensure_databricks_auth/ensure_ai_gateway_v2, still rebuildsbase_urls+ persists state;--no-preflighton a launch command threads through to_launch_tool.This pull request and its description were written by Isaac.