Skip to content

fix: always offer HassTurnOn on an actuation request (#795) - #796

Merged
goruck merged 2 commits into
mainfrom
fix/bind-hass-turn-on
Oct 18, 2026
Merged

goruck merged 2 commits into
mainfrom
fix/bind-hass-turn-on

Conversation

@goruck

@goruck goruck commented Oct 18, 2026

Copy link
Copy Markdown
Owner

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 guessed cover__HassCoverOpen (does not exist) or homeassistant__HassTurnOn and 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_safety accepts, 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 typecheck clean.

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

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
@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Code review

No 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
goruck merged commit be9f3cb into main Oct 18, 2026
11 checks passed
@goruck
goruck deleted the fix/bind-hass-turn-on branch October 18, 2026 07:24
goruck added a commit that referenced this pull request Oct 18, 2026
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.

Agent can't open a cover by voice: HassTurnOn is not offered when other actuation tools outscore it

1 participant