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.
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 initpasses a snapshot env of whatever the user has typed so far. If there's a staleANTHROPIC_API_KEYsitting in their shell from a previous project, the model picker will silently hit the Anthropic API and show models they never meant to configure.