You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That 400 is misclassified as ModelNotFoundError because isModelNotFoundMessage() treats any message containing both "model" and "invalid" as a missing model. opencommit then opens the interactive model picker behind the spinner, which looks like a forever hang.
Additionally, the built-in Anthropic model list and fallback picker only offer retired models (as of June 15, 2026), so every suggested alternative also fails.
npm i -g opencommit@latest
oco config set OCO_AI_PROVIDER=anthropic OCO_API_KEY=<key> OCO_MODEL=claude-sonnet-4-6
git add .
oco
Observed: Spinner stays on "Generating the commit message" indefinitely (or shows model picker with only retired models).
Root cause 1: top_p still sent for Claude 4.6+
src/engine/anthropic.ts (master as of 2026-06-22):
// add top_p for non-4.5 modelsif(!/claude.*-4-5/.test(params.model)){params.top_p=0.1;}
For claude-sonnet-4-6, this adds top_p: 0.1 alongside temperature: 0. Anthropic returns:
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "`temperature` and `top_p` cannot both be specified for this model. Please use only one."
}
}
Root cause 2: 400 misclassified → spinner + hidden model picker
src/utils/engineErrorHandler.ts:
functionisModelNotFoundMessage(message: string): boolean{constlowerMessage=message.toLowerCase();return((lowerMessage.includes('model')&&(lowerMessage.includes('not found')||lowerMessage.includes('does not exist')||lowerMessage.includes('invalid')||// ← matches the 400 abovelowerMessage.includes('pull')))||lowerMessage.includes('does_not_exist'));}
The temperature/top_p error message contains "model" and the JSON type is "invalid_request_error", so it is treated as model-not-found. handleModelNotFoundError() then prompts for an alternative model while the spinner is still running.
Root cause 3: outdated default / fallback model list
src/commands/config.ts still lists retired Anthropic models:
claude-sonnet-4-20250514 (retired 2026-06-15)
claude-opus-4-20250514 (retired 2026-06-15)
claude-3-7-sonnet-20250219 (retired 2026-02-19)
claude-3-5-sonnet-20241022 (retired)
claude-3-5-haiku-20241022 (retired)
oco models --provider anthropic shows only these. Users upgrading from an old config get stuck in a retry loop with dead models.
Expected behavior
claude-sonnet-4-6, claude-opus-4-8, claude-haiku-4-5, etc. should work out of the box.
Invalid-parameter 400s should surface as a clear error, not trigger the model picker.
1. src/engine/anthropic.ts — stop sending top_p for all recent Claude models (simplest: remove top_p entirely when temperature is set, or broaden the exemption):
// Don't send both temperature and top_p — unsupported on Claude 4.5+if(!/claude.*-4-(5|[6-9])/.test(params.model)){params.top_p=0.1;}
Or just drop top_p for all Anthropic requests since temperature: 0 is already set.
# Option A: use a 4.5 model (exempt from top_p via #521)
oco config set OCO_MODEL=claude-sonnet-4-5-20250929
# Option B: patch global install — broaden regex in out/cli.cjs / src/engine/anthropic.ts
Environment details
opencommit: 3.3.2
Node: v24.11.1
Provider: anthropic
Model tested: claude-sonnet-4-6
Direct API call with same key + model works; only opencommit's dual-parameter request fails
Bug report
opencommit version: 3.3.2 (
npm i -g opencommit@latest)Environment: macOS, Node v24,
OCO_AI_PROVIDER=anthropicSummary
Using current Anthropic models with opencommit fails in two ways that together look like an infinite hang on "Generating the commit message":
claude-sonnet-4-6(and other 4.6+ models) still send bothtemperatureandtop_p— PR fix(anthropic): removetop_pparameter for Claude 4.5 models #521 only exempts models matchingclaude.*-4-5, so 4.6+ still hit Anthropic's 400 error.ModelNotFoundErrorbecauseisModelNotFoundMessage()treats any message containing both"model"and"invalid"as a missing model. opencommit then opens the interactive model picker behind the spinner, which looks like a forever hang.Additionally, the built-in Anthropic model list and fallback picker only offer retired models (as of June 15, 2026), so every suggested alternative also fails.
Related: #520 / PR #521 (fixed 4.5 only)
Steps to reproduce
Observed: Spinner stays on "Generating the commit message" indefinitely (or shows model picker with only retired models).
Root cause 1:
top_pstill sent for Claude 4.6+src/engine/anthropic.ts(master as of 2026-06-22):For
claude-sonnet-4-6, this addstop_p: 0.1alongsidetemperature: 0. Anthropic returns:{ "type": "error", "error": { "type": "invalid_request_error", "message": "`temperature` and `top_p` cannot both be specified for this model. Please use only one." } }Root cause 2: 400 misclassified → spinner + hidden model picker
src/utils/engineErrorHandler.ts:The temperature/
top_perror message contains "model" and the JSON type is "invalid_request_error", so it is treated as model-not-found.handleModelNotFoundError()then prompts for an alternative model while the spinner is still running.Root cause 3: outdated default / fallback model list
src/commands/config.tsstill lists retired Anthropic models:claude-sonnet-4-20250514(retired 2026-06-15)claude-opus-4-20250514(retired 2026-06-15)claude-3-7-sonnet-20250219(retired 2026-02-19)claude-3-5-sonnet-20241022(retired)claude-3-5-haiku-20241022(retired)oco models --provider anthropicshows only these. Users upgrading from an old config get stuck in a retry loop with dead models.Expected behavior
claude-sonnet-4-6,claude-opus-4-8,claude-haiku-4-5, etc. should work out of the box.Suggested fixes
1.
src/engine/anthropic.ts— stop sendingtop_pfor all recent Claude models (simplest: removetop_pentirely whentemperatureis set, or broaden the exemption):Or just drop
top_pfor all Anthropic requests sincetemperature: 0is already set.2.
src/utils/engineErrorHandler.ts— tightenisModelNotFoundMessage():invalidcheck, orinvalidwhen status is 404, orinvalid_request_error/temperature/top_pparameter errors3.
src/commands/config.ts— updateMODEL_LIST.anthropicandRECOMMENDED_MODELS:Workaround (confirmed)
Until a release ships:
Environment details
claude-sonnet-4-6