Skip to content

fix(cron): keep homeassistant toolset enabled when HASS_TOKEN is set#16208

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-cb5df63e
Apr 26, 2026
Merged

fix(cron): keep homeassistant toolset enabled when HASS_TOKEN is set#16208
teknium1 merged 1 commit into
mainfrom
hermes/hermes-cb5df63e

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Restores Home Assistant for cron (and any other platform that relies on _get_platform_tools() defaults) when the user has HASS_TOKEN configured. Norbert's HA cron reports regressed after #14798 silently stripped homeassistant via _DEFAULT_OFF_TOOLSETS.

Root cause

#14798 made cron honor per-platform hermes tools config via _get_platform_tools(cfg, "cron"). That resolver applies _DEFAULT_OFF_TOOLSETS = {moa, homeassistant, rl, spotify, discord, discord_admin} when the platform has no explicit saved toolset list. For existing HA-using cron users, that silently dropped homeassistant from the cron toolset — the agent never saw ha_list_entities / ha_get_state tools and fell back to bash+curl (which also fails because the env blocklist strips HASS_TOKEN from subprocess env).

Telegram kept working because the user's saved platform_toolsets.telegram explicitly lists homeassistant.

Fix

The HA toolset's check_fn already gates registration on HASS_TOKEN. When the token is set, the user has explicitly opted in — _DEFAULT_OFF_TOOLSETS is redundant and harmful. When HASS_TOKEN is missing, check_fn keeps it off anyway.

Drop homeassistant from _DEFAULT_OFF_TOOLSETS application iff HASS_TOKEN is set. moa and rl stay off by default (original #14798 goal preserved).

Changes

  • hermes_cli/tools_config.py: conditionally remove homeassistant from the default_off set when HASS_TOKEN is set
  • tests/hermes_cli/test_tools_config.py: two regression tests (token-set → HA on for cron/cli; token-missing → HA off)

Validation

Scenario Before After
cron, HASS_TOKEN set, no saved config HA stripped → 401 via bash curl HA registered ✓
cron, HASS_TOKEN unset HA off HA off (unchanged)
cron, HASS_TOKEN set, moa moa off moa off (unchanged)
telegram, explicit HA in saved config HA on HA on (unchanged)
homeassistant gateway platform HA on HA on (unchanged)

Targeted test results: tests/hermes_cli/test_tools_config.py 50/50 pass, tests/cron/test_scheduler.py 91/91 pass.

After #14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original #14798 goal preserved).

Fixes HA cron regression reported by Norbert.
@teknium1 teknium1 merged commit 4921b26 into main Apr 26, 2026
11 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-cb5df63e branch April 26, 2026 19:56
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management comp/tools Tool registry, model_tools, toolsets area/config Config system, migrations, profiles labels Apr 26, 2026
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ousResearch#16208)

After NousResearch#14798 made cron honor per-platform `hermes tools` config, the
`_DEFAULT_OFF_TOOLSETS` filter silently stripped `homeassistant` from
cron jobs for users who'd been relying on the previous blanket toolset.
Norbert's HA cron reports regressed as a result.

The HA toolset is already runtime-gated by its `check_fn` (requires
HASS_TOKEN to register any tools). When HASS_TOKEN is set the user has
explicitly opted in — `_DEFAULT_OFF_TOOLSETS` adds nothing in that case,
so stop double-gating and restore HA for cron / cli / other platforms
without an explicit saved toolset list.

moa and rl stay off by default (original NousResearch#14798 goal preserved).

Fixes HA cron regression reported by Norbert.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cron Cron scheduler and job management comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants