Skip to content

research_trait: alias EDISON_PLATFORM_API_KEY → EDISON_API_KEY#117

Merged
realmarcin merged 1 commit into
mainfrom
fix/edison-platform-key-alias
Jun 17, 2026
Merged

research_trait: alias EDISON_PLATFORM_API_KEY → EDISON_API_KEY#117
realmarcin merged 1 commit into
mainfrom
fix/edison-platform-key-alias

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Problem

TraitMech reported a missing Edison key. Root cause is a var-name / loading gap, not a bad key:

  • research_trait.py + deep-research-client read EDISON_API_KEY.
  • The live Edison credential is provisioned as EDISON_PLATFORM_API_KEY (the name the edison_client SDK reads by default).
  • research_trait.py has no load_dotenv(), so EDISON_API_KEY only exists when run through just (dotenv-load). Any other invocation saw neither name it reads → "missing key".

Verified with culturebotai-claw/scripts/check_edison_keys.py: both the .env EDISON_API_KEY and the shell EDISON_PLATFORM_API_KEY authenticate (200 + access_token) — so the credential was fine; TraitMech just couldn't see it.

Fix

research_env() now aliases EDISON_PLATFORM_API_KEY → EDISON_API_KEY when the latter is unset (mirrors the existing FutureHouse/Falcon alias). Research now authenticates regardless of invocation path; a .env-provided EDISON_API_KEY still takes precedence (alias only fills an unset value).

Verification

Three cases checked:

  • only-platform-key env → EDISON_API_KEY populated ✓
  • .env key present → not overridden ✓
  • falcon-only → FutureHouse alias still applies ✓

🤖 Generated with Claude Code

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>
@realmarcin realmarcin merged commit 9135712 into main Jun 17, 2026
@realmarcin realmarcin deleted the fix/edison-platform-key-alias branch June 17, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant