Skip to content

Missing provider validation during first initialization #46

Description

@pnevyk

First initialization:

$ openlock sandbox
openlock supports multiple container runtimes. Pick one to use.

Detected runtimes:
  - podman  (recommended — rootless default)
  - docker

This will be saved to your global config (~/.config/openlock/config.yaml).
Override per-invocation with OPENLOCK_RUNTIME=docker|podman.
Choice [podman]:
Saved default_runtime: podman
Select a provider:
  1. anthropic  (Anthropic (Claude))
  2. openrouter  (OpenRouter)
> 1

Later in the process of sandbox creation:

Created .openlock/. Review and commit before sharing.
5780 |   const explicit = args.cliFlag ?? args.env.OPENLOCK_PROVIDER ?? args.readGlobalConfig()?.defaultProvider;
5781 |   if (explicit) {
5782 |     const id = validateProviderId(explicit);
5783 |     ensureCompatible(id, args.harness);
5784 |     return id;
5785 |   throw new Error(`No provider selected for harness '${args.harness}'. Pass --provider, set OPENLOCK_PROVIDER, ` + `or set default_provider: in ~/.config/openlock/config.yaml.`);
               ^
error: No provider selected for harness 'claude_code'. Pass --provider, set OPENLOCK_PROVIDER, or set default_provider: in ~/.config/openlock/config.yaml.
      at resolveProvider (/$bunfs/root/openlock:5785:9)
      at runSandbox (/$bunfs/root/openlock:7633:37)

Bun v1.3.14 (Linux x64)

When I was asked about the provider, I specified 1 expecting that it will choose anthropic. It probably expects the name (e.g., anthropic), but there should be a validation. From the prompt, it's not clear what the user should specify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions