Skip to content

fix(gateway): skip uninstalled auto-detect drivers in config preflight - #6120

Open
elezar wants to merge 4 commits into
mainfrom
fix/preflight-uninstalled-driver
Open

elezar wants to merge 4 commits into
mainfrom
fix/preflight-uninstalled-driver

Conversation

@elezar

@elezar elezar commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

With compute_driver unset, config preflight failed for an auto-detect driver table whose openshell-driver-<name> binary is not installed, while runtime detection skips that driver. This makes preflight consistent without running detection probes.

  • launcher::resolve_binary returns a typed BinaryNotFound (converts to the same config error), so a missing binary is distinguishable from an invalid table.
  • New defaulted ComputeDriverFactory::is_installed; Docker, Podman and VM override it. Other factories keep working through the default.
  • The preflight candidate loop skips an uninstalled candidate with a stderr note. A present binary with an invalid table, and an explicitly selected driver with a missing binary, still fail.

Closes #6084. Relates to #5200.

Testing

  • cargo clippy -p openshell-gateway -p openshell-server --all-targets -- -D warnings passes.
  • Added config_preflight.rs tests: uninstalled candidate skipped, explicit selection fails, installed candidate with invalid table fails. Not run locally (z3 missing prevents linking); relying on CI.

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

@elezar
elezar marked this pull request as ready for review December 1, 2026 15:19
@elezar elezar added the test:e2e Requires end-to-end coverage label Dec 1, 2026
@elezar
elezar force-pushed the fix/preflight-uninstalled-driver branch from 6528f7b to e440ca6 Compare December 2, 2026 15:34

@137137137 137137137 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on macOS arm64 at e440ca6, with the gateway binary run under env -i and an isolated HOME and PATH.

When no candidate is installed, preflight now passes (crates/openshell-server/src/cli.rs:1397). Config with [openshell.drivers.docker] and [openshell.drivers.podman], compute_driver unset, no driver binary on the search path:

$ openshell-gateway config preflight --path gateway.toml
config: merged gateway.toml
note: skipping the docker compute driver in preflight: its driver binary is not installed
note: skipping the podman compute driver in preflight: its driver binary is not installed
exit=0

The issue's case is one driver installed and one not. When every candidate is skipped, auto-detection has nothing to select at startup either. Is exit 0 intended here, or should preflight fail, or at least say that no candidate is installed?

A config with only [openshell.drivers.vm], no selection and no VM binary also exits 0, with no note. The vm registration is not an auto-detect candidate, so VmFactory::is_installed (crates/openshell-gateway/src/lib.rs:539) does not appear to be reached from this path.

With compute_driver unset, preflight validated every auto-detectable
driver table, so a missing openshell-driver-<name> binary was fatal even
though runtime detection skips that driver as unavailable.

Resolve the binary with a typed BinaryNotFound error, add a defaulted
ComputeDriverFactory::is_installed hook, and skip an uninstalled
candidate with a note on stderr. A present binary with an invalid table,
and an explicitly selected driver with a missing binary, still fail.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
…tail

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
elezar force-pushed the fix/preflight-uninstalled-driver branch from e440ca6 to 2d058d6 Compare December 4, 2026 10:31
@elezar
elezar enabled auto-merge December 5, 2026 13:30
@elezar
elezar disabled auto-merge December 5, 2026 13:38
@gator-review-bot

Copy link
Copy Markdown

gator-agent

PR Review Status

The initial review found no blocking issues. Config preflight now skips uninstalled auto-detection candidates with a diagnostic while still rejecting an explicitly selected driver whose binary is missing. Required CI, including E2E, passed.

Action required: Maintainer approval and any required CODEOWNER review must clear before merge.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None.

Non-blocking suggestions:

  • Use a fake factory for the candidate-loop test and fixture-owned paths for the missing-binary lookup test so a host-installed driver cannot affect either result.
  • Update the cluster debugging skill to document the skip diagnostic and the error when an operator explicitly selects an uninstalled driver.
Gator metadata
  • Validation: Accepted PR addressing the config preflight regression described in fix(gateway): config preflight fails for an auto-detect driver whose binary is not installed #6084.
  • Docs: Updated the Fern Gateway Configuration reference.
  • Checks: DCO, Branch Checks, Helm Lint, Frozen Paths, and Trivy Changes passed. Maintainer Approval is pending at handoff.
  • E2E: The selected test:e2e suite passed.
  • Head SHA: 2d058d6e758277ab21d96960df03e17b89dc45b0
  • Base SHA: 22c8e3584481770b802b8adba258e6308d9c83c0
  • Merge base SHA: 22c8e3584481770b802b8adba258e6308d9c83c0
  • Patch ID: caaf443dd5e1ea468bac62fc63244f7eb51af0fc
  • Gator payload: 26
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:approval-needed

@gator-review-bot gator-review-bot Bot added the gator:approval-needed Gator completed review; maintainer approval needed label Dec 5, 2026
gator-review-bot[bot]
gator-review-bot Bot previously approved these changes Dec 5, 2026

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Gator Approval

Gator review is complete and required CI has passed.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@gator-review-bot gator-review-bot Bot added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Dec 5, 2026
@elezar

elezar commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for testing this. Addressed in 7b6bbf9:

  • All candidates skipped: preflight still exits 0, because startup also detects candidates that have no table (and other registered drivers), so "every table-bearing candidate is uninstalled" does not mean startup finds nothing. It now prints note: no configured auto-detect compute driver is installed; startup auto-detects another driver or fails unless compute_driver is set, and a test covers it.
  • VM-only config: unchanged. vm is not an auto-detect candidate, so the candidate loop never reaches it, and selecting it with compute_driver = "vm" still fails on a missing binary. You were right that VmFactory::is_installed was unreachable, so I removed it along with vm::is_installed.

@gator-review-bot

Copy link
Copy Markdown

gator-agent

PR Review Status

Thanks @elezar. I checked the new diagnostic and its regression test for when every configured auto-detect driver is skipped. Preflight still succeeds in that case, since startup can detect a driver without a configuration table. I also checked that VM stays out of auto-detection and that explicit VM selection still validates the driver binary.

The follow-up review found no blocking issues. Required CI, including E2E, passed.

Action required: The Maintainer Approval check must pass before merge.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None.
Gator metadata
  • Validation: Accepted PR addressing the config preflight regression in fix(gateway): config preflight fails for an auto-detect driver whose binary is not installed #6084.
  • Docs: Fern Gateway Configuration reference updated.
  • Checks: DCO, Branch Checks, Helm Lint, Frozen Paths, and Trivy Changes passed. Maintainer Approval has yet to clear for the current head.
  • E2E: The selected test:e2e suite passed.
  • Head SHA: 7b6bbf91ea4d159dfd4215379094d289aa530ce9
  • Base SHA: 22c8e3584481770b802b8adba258e6308d9c83c0
  • Merge base SHA: 22c8e3584481770b802b8adba258e6308d9c83c0
  • Patch ID: 39d3c36275962533bfe06921573595e870803db8
  • Gator payload: 26
  • Review mode: follow_up
  • Previous reviewed SHA: 2d058d6e758277ab21d96960df03e17b89dc45b0
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:approval-needed

@gator-review-bot gator-review-bot Bot added gator:approval-needed Gator completed review; maintainer approval needed and removed gator:merge-ready labels Dec 5, 2026

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Gator Approval

Gator review is complete and required CI has passed.

@gator-review-bot gator-review-bot Bot added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:merge-ready state:accepted A maintainer decided OpenShell should pursue this issue test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(gateway): config preflight fails for an auto-detect driver whose binary is not installed

2 participants