Skip to content

Upgrade expression summaries to sonnet 5 and add fallback model to handle refusals - #314

Open
bobular wants to merge 2 commits into
masterfrom
expr-summs-sonnet-5-and-fallback
Open

Upgrade expression summaries to sonnet 5 and add fallback model to handle refusals#314
bobular wants to merge 2 commits into
masterfrom
expr-summs-sonnet-5-and-fallback

Conversation

@bobular

@bobular bobular commented Aug 27, 2026

Copy link
Copy Markdown
Member

Sonnet 4.5 only has a month or so left to live.
The fallback thing is untested because the toxo genes that were failing with sonnet 4.5 are no longer refused by sonnet 5.
Using Haiku 4.5 as a fallback is undocumented (docs suggest fall-up to Opus 4.8) and untested.

I decided not to add the fallback model ID to the cache key hash fodder. It would likely require a bunch of argument passing and touch a few files. Can revisit later if needed.

See ApiCommonModel documentation change with the same branch name -> VEuPathDB/ApiCommonModel#231

bobular and others added 2 commits August 14, 2026 19:28
claude-sonnet-4-5-20250929 returned stop_reason=refusal (bio safety
classifier) on some ToxoDB transcriptomics prompts, failing the summary
with a generic 500. Two changes:

- Primary model -> claude-sonnet-5 (id string; anthropic-java 2.33.0 has
  no constant for it). Fixes the observed refusals and drops the
  retiring dated snapshot for the non-retiring alias.
- On stop_reason=refusal, re-send the identical request once on a
  fallback model, default claude-haiku-4-5. Override via WDK property
  CLAUDE_FALLBACK_MODEL; "none" disables the hop. callApiForJson split
  into sendMessage / isRefusal / logRefusal / extractJsonText.

The enhanced "no text content" logging from the previous commit stays;
it now also fires only after the fallback is exhausted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant