fix: rich >= 14.3.0 compat and Anthropic SDK v0.82+ compat#269
Merged
fix: rich >= 14.3.0 compat and Anthropic SDK v0.82+ compat#269
Conversation
… compat Closes #268 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Anthropic SDK (v0.82+) introduced breaking changes that caused three CI failures: 1. **WebFetchBlock attribute error**: The SDK now returns proper `BetaWebFetchBlock` objects for `web_fetch_tool_result` content instead of raw dicts. Updated code to use `getattr()` for URL extraction and `model_dump()` for serialization. 2. **VCR cassette body mismatch**: The SDK added a `caller` field (serialized as `null`) to `WebSearchToolResultBlock` and `ServerToolUseBlock`. This caused VCR body matching to fail on multi-turn tests. Fixed by manually constructing the `extra` dict from known API fields (consistent with how `server_tool_use` was already handled) rather than using `model_dump()` directly. 3. **Outdated provider types**: New models (claude-opus-4-6, claude-sonnet-4-6), tool types (CodeExecutionTool, MemoryTool, WebFetchTool, etc.), and parameters (container, inference_geo, ThinkingConfigAdaptiveParam) were added. Regenerated types via `make update-types`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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.
Summary
last_render_heightproperty to chatlas's customLiveRenderclass, fixingAttributeErrorcrash inconsole()with rich >= 14.3.0. Rich 14.3.0 (Textualize/rich#3934) addedlast_render_heightto itsLiveRenderandLive.stop()now accesses it. Since chatlas monkeypatchesLive._live_renderwith its ownLiveRender, the missing property caused a crash.web_fetch_tool_resultcontent is now a properBetaWebFetchBlockobject instead of a raw dict — updated code to use attribute access instead of.get().web_search_tool_resultandweb_fetch_tool_resultblocks now include a SDK-internalcallerfield that the API doesn't accept. Switched to manually constructing theextradict from known API fields (consistent with howserver_tool_usewas already handled).Closes #268
Test plan
test_anthropic_web_fetchandtest_anthropic_web_search)chat.console()works with rich >= 14.3.0🤖 Generated with Claude Code