docs(agents): remove stale KV known-deviation; align openai example with credential_key - #808
Conversation
…ith credential_key AGENTS.md still claimed ModelClient reads os.environ.get(agent.api_key_env). The runtime already resolves provider keys and server tokens from the KV registry via get_credential(). Update the guidance and the example agent pool to use the modern credential_key field. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Original prompt from Automation
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Merge-gate evidence (2026-08-24): All required checks green on current head except |
Summary
AGENTS.mdstill listed a "Known deviation to migrate" claimingModelClientreads provider API keys fromos.environ.get(agent.api_key_env)andCONTEXTUAL_ORCHESTRATOR_*tokens from__main__.py. That is no longer true: runtime provider secrets and server bearer tokens are already resolved through the KV credential registry viaget_credential(). This change updates the cross-agent guidance and the example OpenAI agent pool to match the current implementation.What changed
AGENTS.md:orchestrator.pyand__main__.pyalready useget_credential.api_key_envis still accepted as a legacy field whose string value is treated as a KV credential name, never an environment variable.OPENAI_API_KEY,BYTEZ_API_KEY,NVIDIA_NIM_API_KEY,NVIDIA_NIM_API_KEY_SUB,OPENROUTER_API_KEY) that must be seeded into the KV at bootstrap for auto-discovery and routing.examples/agents.openai.json: switched from the legacyapi_key_envfield to the moderncredential_keyfield.ModelAgent.from_dictaccepts both, andcredential_nameresolves toapi_key_envwhen present, otherwisecredential_key.Why
The stale guidance in
AGENTS.mddirected every new agent to "move these to KV-backed reads", which is already done. That creates confusion and can lead to redundant or conflicting PRs. The example file should teach the preferred field name (credential_key) while the legacy field remains for backward compatibility.Verification
git diff --checkpasses.python -m compileall -qpasses on the changed source.examples/agents.openai.jsonthroughModelAgent.from_dictand confirmed each agent'scredential_nameresolves toOPENAI_API_KEYwithapi_key_envunset.Link to Devin session: https://app.devin.ai/sessions/05803abb7bbd445d96eec3961f56817a