Add web fetch tool support for Anthropic#167405
Open
Shulyaka wants to merge 18 commits intohome-assistant:devfrom
Open
Add web fetch tool support for Anthropic#167405Shulyaka wants to merge 18 commits intohome-assistant:devfrom
Shulyaka wants to merge 18 commits intohome-assistant:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for Anthropic’s web fetch server tool to the Anthropic conversation agent, including configuration options, runtime tool wiring, and tests/snapshots to validate the new behavior.
Changes:
- Add new config options (
web_fetch,web_fetch_max_uses) to the subentry config flow and UI strings. - Implement web fetch tool handling in the Anthropic conversation entity (tool selection + tool result conversion).
- Add test coverage and update snapshots for web fetch success and error cases.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/anthropic/entity.py |
Adds web fetch tool support (tool selection + stream/tool-result conversion) and broadens citation serialization. |
homeassistant/components/anthropic/config_flow.py |
Exposes web fetch options in the model options step and validates numeric inputs as positive ints. |
homeassistant/components/anthropic/const.py |
Introduces new constants/defaults for web fetch configuration. |
homeassistant/components/anthropic/strings.json |
Adds UI labels and descriptions for web fetch settings (conversation + AI task subentries). |
tests/components/anthropic/__init__.py |
Adds a helper to generate streamed web fetch tool result blocks for tests. |
tests/components/anthropic/test_conversation.py |
Adds new conversation tests covering web fetch success and error flows. |
tests/components/anthropic/test_config_flow.py |
Updates config flow tests to include the new web fetch options in expected data. |
tests/components/anthropic/snapshots/test_conversation.ambr |
Adds/updates snapshots for web fetch-related conversation flows and history conversion. |
8 tasks
Xirt
reviewed
Apr 4, 2026
silamon
approved these changes
Apr 19, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Member
|
there are merge conflicts, could you take a look? |
Contributor
Author
|
Done! |
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.
Proposed change
Add web fetch server tool support for Anthropic
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: