Repository navigation
fix: always offer HassTurnOn on an actuation request (#795) - #796
Merged
Merged
Conversation
The actuation safety leg ranks tools by similarity and keeps three, so for "open the study shade" vacuum and media tools that scored higher crowded out HassTurnOn, the only tool HA gives an assistant to open a cover. The model guessed a tool that does not exist and was refused. Bind HassTurnOn outside the limit on any query the actuation safety net accepts (the on/off partner step then binds HassTurnOff), unless the user excluded it. Fixes #795 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFM2hXVUELSh13U7FEKGJu
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
…795) Review follow-ups: a "Yes" to "Want me to open the Study Shade?" carries no action word, so the agent's offer is checked too. The exclusion is checked by base name before the fetch, so a namespaced exclusion also blocks the bare pre-2026.9 index row when the live filter is off. Steps renumbered 3h/3i. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFM2hXVUELSh13U7FEKGJu
goruck
added a commit
that referenced
this pull request
Oct 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFM2hXVUELSh13U7FEKGJu
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
Fixes #795. On the box, "Open the study shade" and "Turn on Everything" failed with "I couldn't find a suitable tool": tool retrieval offered vacuum and media tools (scores 0.59/0.57) but not
intent__HassTurnOn, so the model guessedcover__HassCoverOpen(does not exist) orhomeassistant__HassTurnOnand the call was rejected as not retrieved. Home Assistant offers no cover-specific open/close tool to LLMs, so HassTurnOn is the only way to open a cover.Fix
_append_turn_on_tool(step 3i in_retrieve_tools): on any query_query_needs_actuation_safetyaccepts, bind HassTurnOn if neither HassTurnOn nor HassTurnOff is bound, outside the limit like GetLiveContext and add_automation. Step 3h then binds HassTurnOff. Respects per-tool exclusions; read-only open-state questions and non-actuation queries are unchanged.Cost: up to two extra tool schemas on actuation turns that ranking didn't already cover.
Tests
test_tool_retrieval.py: the box's ranking reproduced for three cover phrasings (HassTurnOn and HassTurnOff bound, the ranked vacuum tool kept), a non-actuation and a read-only open-state query (not bound), and an exclusion (not bound). The three positive cases fail on main.make lint,make test(5169 passed),make typecheckclean.Release
Bundles with the monthly release unless you want it out sooner: the failure is visible (the agent says it has no tool), not silent.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SFM2hXVUELSh13U7FEKGJu