Skip to content

bug: model picker uses shell credentials even when own environment is passed #40

@w3joe

Description

@w3joe

actual behavior
list_models_for_provider accepts an env argument that's supposed to be the sole source of credentials. The docstring says so explicitly. But internally, _key() always falls back to os.getenv() — so passing env={} doesn't actually isolate you from the process environment.
expected behavior
When env is explicitly passed, only that dict is used for credential lookups. os.environ is not consulted. Passing env={} should return None for any provider regardless of what's in the shell environment.
why it matters
overmind init passes a snapshot env of whatever the user has typed so far. If there's a stale ANTHROPIC_API_KEY sitting in their shell from a previous project, the model picker will silently hit the Anthropic API and show models they never meant to configure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions