fix(sandbox): pass --auto-providers to sandbox create in dev script#23
Closed
maxamillion wants to merge 1 commit into
Closed
fix(sandbox): pass --auto-providers to sandbox create in dev script#23maxamillion wants to merge 1 commit into
maxamillion wants to merge 1 commit into
Conversation
The sandbox.sh script runs non-interactively from mise, so stdin is not a terminal. When the trailing command (e.g. 'claude') infers a provider type, the CLI requires either an interactive prompt or --auto-providers to handle missing providers. Without either, it hard-errors with 'missing required provider'. Add --auto-providers so the CLI auto-creates providers from local credentials when available, or gracefully skips when no credentials are found (allowing the user to configure from inside the sandbox).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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
mise run sandboxfails withmissing required provider 'claude'whenANTHROPIC_API_KEYis not set in the environment.Related Issue
None (discovered via direct reproduction).
Root Cause
The
sandbox.shscript runs non-interactively frommise, sostdinis not a terminal. When the trailing command (claude) infers a provider type, the CLI'sauto_create_providerfunction checks whether it can prompt the user. Sinceauto_providers_overrideisNone(no--auto-providersflag passed) andstdinis not a terminal, it hard-errors:Changes
Add
--auto-providersto theopenshell sandbox createcall intasks/scripts/sandbox.sh.With
--auto-providers:ANTHROPIC_API_KEYis set, the Claude provider plugin discovers it and auto-creates the provider → sandbox starts with the provider configuredANTHROPIC_API_KEYis not set,discover_existingreturnsNone, the CLI prints a warning and continues → sandbox starts without the provider (user can configure it later from inside the sandbox)Testing
Verified
mise run sandboxsucceeds both with and withoutANTHROPIC_API_KEYset:Without
ANTHROPIC_API_KEY:Checklist
mise run sandbox