Skip to content

Make --skip-preflight skip the Databricks CLI version check - #293

Open
max-rozen-oss-db wants to merge 3 commits into
mainfrom
skip-preflight-cli-version
Open

Make --skip-preflight skip the Databricks CLI version check#293
max-rozen-oss-db wants to merge 3 commits into
mainfrom
skip-preflight-cli-version

Conversation

@max-rozen-oss-db

@max-rozen-oss-db max-rozen-oss-db commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

--skip-preflight is the launch-only escape hatch that trusts a prior ucode configure and 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> runs ensure_bootstrap_dependenciesinstall_databricks_cliensure_databricks_cli_version, which enforces a floor of v1.0.0 (the release that ships databricks aitools). A public-preview Databricks CLI like v0.299.2 works fine, but the gate rejects it:

! Databricks CLI v0.299.2 is too old (need v1.0.0 or newer).

That's a false positive, and it fires even on a --skip-preflight launch that was told to trust the existing setup.

Change

Thread a skip_version_check flag from --skip-preflight through ensure_bootstrap_dependencies into install_databricks_cli:

  • Under --skip-preflight, an already-installed databricks is trusted without re-running ensure_databricks_cli_version.
  • A missing CLI is still installed; only the version check is bypassed.
  • Updated the flag's help text and the surrounding comments. The normal launch path and ucode bootstrap keep the version gate.

Testing

  • uv run pytest tests/test_databricks.py tests/test_cli.py — passing.
  • uv run ruff check . and uv run ruff format --check src/ tests/ — clean.
  • Coverage: install_databricks_cli(skip_version_check=True) bypasses the gate but still installs a missing CLI; ucode claude --skip-preflight calls bootstrap with skip_cli_version_check=True.
$ echo '=== error ===' ; ucode claude -p 'say hi in 5 words' ; echo '=== fix ==='; ucode claude --skip-preflight -p 'say hi in 5 words'
=== error ===
! Databricks CLI v0.299.2 is too old (need v1.0.0 or newer). Upgrading...
Target path /usr/local/bin/databricks already exists.
If you have an existing Databricks CLI installation, please first remove it using
  sudo rm '/usr/local/bin/databricks'
ERROR Failed to install/upgrade Databricks CLI automatically.
=== fix ===

╭────────────────────────╮
│ ucode with Claude Code │
╰────────────────────────╯
  Model: databricks-claude-opus-5
✔ Starting Claude Code
Hi there, good to meet you!

`--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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant