Skip to content

fix(sandbox): pass --auto-providers to sandbox create in dev script#23

Closed
maxamillion wants to merge 1 commit into
midstreamfrom
fix/sandbox-auto-providers
Closed

fix(sandbox): pass --auto-providers to sandbox create in dev script#23
maxamillion wants to merge 1 commit into
midstreamfrom
fix/sandbox-auto-providers

Conversation

@maxamillion

Copy link
Copy Markdown

Summary

mise run sandbox fails with missing required provider 'claude' when ANTHROPIC_API_KEY is not set in the environment.

Related Issue

None (discovered via direct reproduction).

Root Cause

The sandbox.sh script runs non-interactively from mise, so stdin is not a terminal. When the trailing command (claude) infers a provider type, the CLI's auto_create_provider function checks whether it can prompt the user. Since auto_providers_override is None (no --auto-providers flag passed) and stdin is not a terminal, it hard-errors:

Missing provider: claude
Error: × missing required provider 'claude'. Create it first with `openshell
  │ provider create --type claude --name claude --from-existing`, pass --auto-
  │ providers to auto-create, or set it up manually from inside the sandbox

Changes

Add --auto-providers to the openshell sandbox create call in tasks/scripts/sandbox.sh.

With --auto-providers:

  • If ANTHROPIC_API_KEY is set, the Claude provider plugin discovers it and auto-creates the provider → sandbox starts with the provider configured
  • If ANTHROPIC_API_KEY is not set, discover_existing returns None, 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 sandbox succeeds both with and without ANTHROPIC_API_KEY set:

Without ANTHROPIC_API_KEY:

Creating sandbox 'dev'...
Missing provider: claude
! No existing local credentials/config found for 'claude'. You can configure it from inside the sandbox.
Created sandbox: dev

Checklist

  • Code follows existing conventions
  • Change is minimal and focused
  • Tested locally with mise run sandbox

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).
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 952c0113-94fc-427b-acdc-dea26f1c1912

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sandbox-auto-providers

Comment @coderabbitai help to get the list of available commands and usage tips.

@maxamillion maxamillion closed this Apr 7, 2026
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