Make --skip-preflight skip the Databricks CLI version check - #293
Open
max-rozen-oss-db wants to merge 3 commits into
Open
Make --skip-preflight skip the Databricks CLI version check#293max-rozen-oss-db wants to merge 3 commits into
max-rozen-oss-db wants to merge 3 commits into
Conversation
`--skip-preflight` trusts a prior `ucode configure` and skips the per-launch auth + AI Gateway re-validation. It did not, however, skip the Databricks CLI minimum-version gate: launch still ran `ensure_bootstrap_dependencies` -> `install_databricks_cli` -> `ensure_databricks_cli_version`, whose `databricks aitools` floor of v1.0.0 rejects a perfectly usable public-preview build (e.g. v0.299.2) as "too old" — a false positive on a launch that was explicitly told to trust the existing setup. Thread a `skip_version_check` flag from `--skip-preflight` through `ensure_bootstrap_dependencies` into `install_databricks_cli`, so the version check is bypassed while a genuinely missing CLI is still installed. Update the flag's help/comments and add coverage for the new bypass. Co-authored-by: Isaac
The launch commands set `ignore_unknown_options=True` so an agent's own flags pass straight through. That also meant a *mistyped* ucode flag — e.g. `--skip-preflight-checks` instead of `--skip-preflight` — was silently handed to the agent, where it does nothing, so `--skip-preflight` appeared not to work. Add a guard that runs before launch and rejects any passthrough arg whose bare name is a near-miss of a known ucode launch flag (a superstring like `--skip-preflight-checks`, or a near-complete truncation), with an error naming the intended flag. Unrelated agent flags (`--model`, `-r`, `--dangerously-skip-permissions`, …) are left untouched and still pass through. Co-authored-by: Isaac
Removes the `_reject_mistyped_ucode_flag` guard and its tests so this PR does one thing: skip the Databricks CLI version check under `--skip-preflight`. The mistyped-flag handling can land separately. Also apply `ruff format` to tests/test_databricks.py (line-wrap the new monkeypatch calls) so `ruff format --check` passes in CI. Co-authored-by: Isaac
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
--skip-preflightis the launch-only escape hatch that trusts a priorucode configureand skips the per-launch Databricks auth + AI Gateway re-validation. It didn't skip the Databricks CLI minimum-version gate, though.On every launch,
ucode <agent>runsensure_bootstrap_dependencies→install_databricks_cli→ensure_databricks_cli_version, which enforces a floor of v1.0.0 (the release that shipsdatabricks aitools). A public-preview Databricks CLI like v0.299.2 works fine, but the gate rejects it:That's a false positive, and it fires even on a
--skip-preflightlaunch that was told to trust the existing setup.Change
Thread a
skip_version_checkflag from--skip-preflightthroughensure_bootstrap_dependenciesintoinstall_databricks_cli:--skip-preflight, an already-installeddatabricksis trusted without re-runningensure_databricks_cli_version.ucode bootstrapkeep the version gate.Testing
uv run pytest tests/test_databricks.py tests/test_cli.py— passing.uv run ruff check .anduv run ruff format --check src/ tests/— clean.install_databricks_cli(skip_version_check=True)bypasses the gate but still installs a missing CLI;ucode claude --skip-preflightcalls bootstrap withskip_cli_version_check=True.