research_trait: alias EDISON_PLATFORM_API_KEY → EDISON_API_KEY#117
Merged
Conversation
TraitMech's research path (this script + deep-research-client) reads EDISON_API_KEY, but the Edison platform credential is provisioned in the environment as EDISON_PLATFORM_API_KEY (the name the edison_client SDK reads). With no load_dotenv here, any run outside `just` (whose dotenv-load injects the per-repo .env) saw no EDISON_API_KEY → "missing Edison key", even though the credential was present under the platform name. research_env now aliases EDISON_PLATFORM_API_KEY → EDISON_API_KEY when the latter is unset (mirroring the existing FutureHouse/Falcon alias), so research authenticates on every invocation path. A .env-provided EDISON_API_KEY still wins (alias only fills an unset value). Verified empirically that both the .env key and the platform key authenticate against Edison (culturebotai-claw scripts/check_edison_keys.py). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
TraitMech reported a missing Edison key. Root cause is a var-name / loading gap, not a bad key:
research_trait.py+deep-research-clientreadEDISON_API_KEY.EDISON_PLATFORM_API_KEY(the name theedison_clientSDK reads by default).research_trait.pyhas noload_dotenv(), soEDISON_API_KEYonly exists when run throughjust(dotenv-load). Any other invocation saw neither name it reads → "missing key".Verified with
culturebotai-claw/scripts/check_edison_keys.py: both the.envEDISON_API_KEYand the shellEDISON_PLATFORM_API_KEYauthenticate (200 + access_token) — so the credential was fine; TraitMech just couldn't see it.Fix
research_env()now aliasesEDISON_PLATFORM_API_KEY → EDISON_API_KEYwhen the latter is unset (mirrors the existing FutureHouse/Falcon alias). Research now authenticates regardless of invocation path; a.env-providedEDISON_API_KEYstill takes precedence (alias only fills an unset value).Verification
Three cases checked:
EDISON_API_KEYpopulated ✓.envkey present → not overridden ✓🤖 Generated with Claude Code