Upgrade expression summaries to sonnet 5 and add fallback model to handle refusals - #314
Open
bobular wants to merge 2 commits into
Open
Upgrade expression summaries to sonnet 5 and add fallback model to handle refusals#314bobular wants to merge 2 commits into
bobular wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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