Repository navigation
Commit 8ad88db
committed
fix(templates): map LITELLM_API_KEY to OPENAI_API_KEY in Temporal workers
The temporal-openai-agents and temporal-pydantic-ai templates' .env.example
only set LITELLM_API_KEY. The OpenAI Agents template's acp.py copies it into
OPENAI_API_KEY, the Pydantic AI template never does, and in both the model
call runs in the Temporal worker, a separate process started by
agentex agents run, which never got the mapping. Following either template's
own instructions fails in the worker with openai.OpenAIError: Missing
credentials after the activity's retries, while the ACP process looks
healthy. (temporal-langgraph is fine: graph.py, imported by the worker,
already does the mapping.)
Apply the same three-line mapping in both run_worker.py templates and add a
parametrized test asserting the worker entrypoints carry it.
Reproduced and verified on scaffolded agents against a local backend with
only LITELLM_API_KEY set: before, no reply and Missing credentials in the
worker log; after, the turn completes (gpt-5-nano).
Claude-Session: https://claude.ai/code/session_01HCVKnA7LeJZ44nxZz1uzF31 parent 0db6037 commit 8ad88db
3 files changed
Lines changed: 37 additions & 0 deletions
File tree
- src/agentex/lib/cli/templates
- temporal-openai-agents/project
- temporal-pydantic-ai/project
- tests/lib/cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
1 | 11 | | |
2 | 12 | | |
3 | 13 | | |
| |||
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
| |||
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
| 33 | + | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
0 commit comments