Prefer OpenHarness-scoped API key env vars over provider globals#93
Open
siaochuan wants to merge 1 commit into
Open
Prefer OpenHarness-scoped API key env vars over provider globals#93siaochuan wants to merge 1 commit into
siaochuan wants to merge 1 commit into
Conversation
tjb-tech
pushed a commit
that referenced
this pull request
May 24, 2026
Prefer OPENHARNESS_<PROVIDER>_API_KEY variables over provider-native globals while resolving API-key auth. Keep provider-native variables as fallback and avoid applying unrelated native keys across active profiles. Forward the OpenHarness-scoped auth/provider environment variables to spawned teammates. Based-on: #93
Collaborator
|
已将这个 PR 的核心修复手动抽取到 main:63ac368。当前 PR 与最新 main 有冲突,所以没有直接 merge;新提交保留了原作者署名,并补齐了更多 provider 的 OPENHARNESS__API_KEY 覆盖与子 agent env 继承测试。 |
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
OPENHARNESS_*provider-scoped API key env vars over provider-native globalsWhy
When multiple provider integrations are tested in the same shell, broad global env vars like
ANTHROPIC_API_KEYandOPENAI_API_KEYare easy to mix up. This makes it too easy for OpenHarness to pick up the wrong credential from shared shell state.This change gives OpenHarness a safer default path:
OPENHARNESS_*provider keysRelated to #84.
Testing
python -m pytest tests/test_config/test_settings.py tests/test_swarm/test_spawn_utils.pypython -m pytest tests/test_auth/test_external.py -k third_party_base_url_for_claude_subscription