feat(inference): verify endpoints before saving routes#291
Merged
Conversation
|
Collaborator
Author
Updated the PR per follow-up discussion:
This keeps existing scripts on the current default behavior while still supporting explicit validation and richer success reporting. |
Closes #273 Verify inference endpoints synchronously on the server during set/update, expose a --no-verify escape hatch in the CLI and Python helper, and return actionable failures when validation does not pass.
cbb55be to
1fa174f
Compare
drew
approved these changes
Mar 16, 2026
drew
pushed a commit
that referenced
this pull request
Mar 16, 2026
Closes #273 Verify inference endpoints synchronously on the server during set/update, expose a --no-verify escape hatch in the CLI and Python helper, and return actionable failures when validation does not pass.
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.
Closes #273
Summary
Verify inference endpoints by default during
openshell inference setandopenshell inference updateso invalid routes are rejected before persistence. Keep an explicit--no-verifyopt-out for endpoints that are not up yet, and return structured validation details when verification succeeds.Why This Shape
--no-verifyis the single explicit escape hatch for rollouts where the endpoint is expected to come up later.--no-verifywhen validation fails and the route still needs to be saved.Changes Made
proto/inference.proto: keepno_verifyonSetClusterInferenceRequestso clients can disable the default verification pass when needed.crates/openshell-server/src/inference.rs: verify by default unlessno_verifyis set, raise timeout to 15 seconds, and map validation failures to actionable next steps.crates/openshell-router/src/backend.rsandcrates/openshell-router/src/lib.rs: own provider-specific validation request shaping, auth/header behavior, and structured validation failure classification in the router/shared backend layer.crates/openshell-cli/src/main.rs: remove the explicit--verifyflag and keep--no-verifyas the user-facing opt-out oninference set/inference update.crates/openshell-cli/src/run.rs: send theno_verifyoverride and print validated endpoints in a grouped list format.python/openshell/sandbox.pyandpython/openshell/sandbox_test.py: simplify Python helper support tono_verify=Trueonly.docs/inference/configure.mdandarchitecture/inference-routing.md: document verify-by-default behavior and the--no-verifyopt-out.Deviations from Plan
e2e/tests were added; coverage stays in focused server, CLI, router, and Python tests.Tests Added
RUSTC_WRAPPER= cargo test -p openshell-router backend::tests -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-server inference::tests -- --nocapture,RUSTC_WRAPPER= cargo test -p openshell-cli inference_ -- --nocaptureuv run pytest python/openshell/sandbox_test.py -k inference -vDocumentation Updated
architecture/inference-routing.md: document default verification, router-owned validation logic, and theno_verifyoverride.docs/inference/configure.md: explain verify-by-default behavior and when to retry with--no-verify.Verification
mise run pre-commitgreen in this checkoutVerification Notes
I rebased this branch onto current
origin/mainand re-ran focused verification. Fullmise run pre-commitis still not included here because the checkout has unrelated untracked local directories (.worktrees/,.agents/skills/debug-inference/) outside this PR scope.