Skip to content

Framework agents require OPENAI_API_KEY on the server even when the model is Anthropic #482

Description

@ambiorix2099

Files: examples/agents/93_openai_runner_hello_world.py, 94_openai_runner_tools.py, 95_openai_runner_handoffs.py, 96_openai_runner_streaming.py (the conductor.ai Runner / framework-agent path)

Symptom: With no OPENAI_API_KEY in the server process's environment:

$ CONDUCTOR_AGENT_LLM_MODEL=anthropic/claude-sonnet-4-6 python examples/agents/93_openai_runner_hello_world.py
Framework agent 'Assistant' execution FAILED
None

96 is worse — it exits 0 having printed only an execution id, so exit-code-based tooling scores it green.

Cause: The framework-agent path needs an OpenAI key server-side regardless of the configured model. Confirmed by controlled comparison on one server, changing only the server's environment:

Server env model result
no OPENAI_API_KEY anthropic/claude-sonnet-4-6 FAILED
no OPENAI_API_KEY anthropic/claude-opus-4-6 FAILED
OPENAI_API_KEY present anthropic/claude-sonnet-4-6 pass
OPENAI_API_KEY present anthropic/claude-opus-4-6 pass

Ruled out: the client's environment (passes with the client key unset), and langchain-anthropic being installed (passes with it uninstalled). Only the server's env matters.

Fix: Either drop the OpenAI dependency when the target model is not OpenAI, or fail with a message naming the missing key. Silent failure with None is the worst outcome.

Verify: Start the server with no OPENAI_API_KEY, run 93 with an Anthropic model — it should either work or say why.

Note: These examples document CONDUCTOR_AGENT_LLM_MODEL=openai/gpt-4o (or anthropic/claude-opus-4-6), so a user following the Anthropic option with an Anthropic-only server hits this immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions