Repository navigation
fix: report an empty provider key variable as unavailable in the model status - #51
Open
leninworld wants to merge 1 commit into
Open
leninworld wants to merge 1 commit into
leninworld wants to merge 1 commit into
Conversation
…l status Config::status reported credentials_available for a profile whose key_env names a variable that is set but empty, so GET /api/models listed the model as ready while environment_credential rejected the empty key on every call. It now asks environment_credential, so an empty variable is unavailable and a non-empty value is available, as every call and the workspace status already do. Signed-off-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
This branch has not been deployed
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
model::Config::status(served atGET /api/models) setcredentials_availabletotruewhenever the variable a profile'skey_envnames was set, even when it was empty. A model withOPENAI_API_KEY=""exported was therefore listed as having credentials, while every call to it then failed inenvironment_credentialwith "Provider credential unavailable", which ignores an empty value.Config::statusnow asksenvironment_credential, the same check every model call makes, so an empty variable is unavailable, as the workspace status already says, and a non-empty value is still available.Not changed:
Config::statusstill looks a saved-in-app reference (secret:ID,oauth:ID) up as a variable name; the workspace status resolves those.Test plan
backends::model_status_treats_empty_environment_credentials_as_unavailableruns itself again as a child process with one provider key variable set to""and another set to a fixture key (the parent's environment is not changed, as inobserver.rs), and checksConfig::statusfor both profiles. Onmainthe child fails (assertion failed: !available("empty")); with this change it passes.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo clippy --locked --all-targets --features local-inference -- -D warningsandcargo test --locked --all-targetsincrates/graphicle(Rust 1.95.0, macOS). Linux and Windows run in CI.