Skip to content

Commit 0ec2e0f

Browse files
committed
feat(action): reject the litellm 'openrouter/' model prefix early
The engine calls OpenRouter natively (langchain ChatOpenAI), so the model must be a bare slug; the litellm 'openrouter/...' form 400s deep inside the engine. Fail fast in the verify step with a one-line actionable error instead, the same early-validation the API key already gets.
1 parent 016df69 commit 0ec2e0f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ runs:
266266
AGENT_MODEL="$(_strip "$RAW_AGENT_MODEL")"
267267
PARSING_MODEL="$(_strip "$RAW_PARSING_MODEL")"
268268
269+
# Catch the most common model-id mistake early: the engine calls OpenRouter
270+
# natively (langchain ChatOpenAI), so a model must be a BARE slug like
271+
# anthropic/claude-sonnet-4 — NOT the litellm 'openrouter/...' form.
272+
for M in "$AGENT_MODEL" "$PARSING_MODEL"; do
273+
case "$M" in
274+
openrouter/*)
275+
echo "::error::Invalid model '$M': drop the 'openrouter/' prefix and use a bare OpenRouter slug, e.g. anthropic/claude-sonnet-4."
276+
exit 1 ;;
277+
esac
278+
done
279+
269280
# Mask the cleaned value (it may differ from the registered secret).
270281
echo "::add-mask::$KEY"
271282

0 commit comments

Comments
 (0)