Skip to content

fix: rich >= 14.3.0 compat and Anthropic SDK v0.82+ compat#269

Merged
cpsievert merged 3 commits intomainfrom
fix/live-render-last-render-height
Feb 24, 2026
Merged

fix: rich >= 14.3.0 compat and Anthropic SDK v0.82+ compat#269
cpsievert merged 3 commits intomainfrom
fix/live-render-last-render-height

Conversation

@cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Feb 19, 2026

Summary

  • Adds the last_render_height property to chatlas's custom LiveRender class, fixing AttributeError crash in console() with rich >= 14.3.0. Rich 14.3.0 (Textualize/rich#3934) added last_render_height to its LiveRender and Live.stop() now accesses it. Since chatlas monkeypatches Live._live_render with its own LiveRender, the missing property caused a crash.
  • Fixes Anthropic web fetch/search tool handling for SDK v0.82+:
    • web_fetch_tool_result content is now a proper BetaWebFetchBlock object instead of a raw dict — updated code to use attribute access instead of .get().
    • web_search_tool_result and web_fetch_tool_result blocks now include a SDK-internal caller field that the API doesn't accept. Switched to manually constructing the extra dict from known API fields (consistent with how server_tool_use was already handled).

Closes #268

Test plan

  • All 452 existing tests pass (including test_anthropic_web_fetch and test_anthropic_web_search)
  • Manual test: chat.console() works with rich >= 14.3.0

🤖 Generated with Claude Code

cpsievert and others added 2 commits February 19, 2026 12:06
… 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>
@cpsievert cpsievert changed the title fix: add last_render_height to custom LiveRender for rich >= 14.3.0 fix: rich >= 14.3.0 compat and Anthropic SDK v0.82+ compat Feb 20, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpsievert cpsievert merged commit dfcb82e into main Feb 24, 2026
8 checks passed
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.

AttributeError in console() with rich >= 14.3.0: LiveRender missing 'last_render_height'

1 participant