Skip to content

Support claude-sonnet-5 extended thinking in ChatSnowflake - #431

Draft
cpsievert wants to merge 3 commits into
mainfrom
fix/snowflake-anthropic-thinking-delta
Draft

Support claude-sonnet-5 extended thinking in ChatSnowflake#431
cpsievert wants to merge 3 commits into
mainfrom
fix/snowflake-anthropic-thinking-delta

Conversation

@cpsievert

Copy link
Copy Markdown
Collaborator

Summary

claude-sonnet-5 on Snowflake Cortex streams extended thinking as a new "anthropic" delta type — separate thinking and signature fragments attached to the same content item — which ChatSnowflake() previously rejected with ValueError: Unexpected streaming delta type: anthropic.

This PR teaches the provider to accumulate those fragments (concatenating repeated thinking/signature pieces into a single item) and to surface them as ContentThinking, with the signature preserved in extra so it can be round-tripped on subsequent requests. Both the streaming and non-streaming paths are handled.

Verification

Adds two tests that chat and stream with claude-sonnet-5 via ChatSnowflake() and assert the final turn contains a ContentThinking block. pytest tests/test_provider_snowflake.py — 8 passed (requires live Snowflake credentials).

cpsievert and others added 3 commits September 11, 2026 18:24
claude-sonnet-5 on Snowflake Cortex streams thinking/signature deltas
under a new 'anthropic' delta type, which previously raised
'Unexpected streaming delta type'. Accumulate these deltas into
ContentThinking (with the signature preserved in extra) for both
streaming and non-streaming responses.
CI's pyright resolves pillow_heif's stubs and flags register_heif_opener
as a private re-export; this failure is present on main as well.
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