Skip to content

Land slate: memory-wiki user topics, bubblewrap attachments, HA deliver + cooldown, /spotify, camofox durable identity - #451

Merged
teknium1 merged 21 commits into
mainfrom
land/official-slate2-1119
Nov 20, 2026
Merged

teknium1 merged 21 commits into
mainfrom
land/official-slate2-1119

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Lands Teknium's approved Part B slate in one branch: the contributors' own commits, cherry-picked in order with authorship kept, plus our resolution and rework commits on top. No merge commits.

In plain words: Memory Wiki subjects now come only from what you raised in a chat, not from tool and system noise. The bubblewrap sandbox can open files you attach in chat. Home Assistant can send watched-entity alerts to another platform or into an existing chat's session, and says once at startup if a Hermes update breaks that routing. It also stops spending its cooldown on events that never produce a message, and words unknown/unavailable states honestly. Spotify gets one /spotify play|pause|skip|np|queue command that works today in the CLI and every gateway. Camofox can give each cron job a durable browser identity (off by default).

PR Author What the user gets Landed commits
#436 (salvage of #48) @tillstriegel, Teknium Memory Wiki subjects come only from user turns and titles. Previews, tool names and tool calls no longer create them. User-raised topics rank first, and a subject lists only snippets that mention it. 3fac9ed (Till), 3acef78, 6ab20be (carried through #49's cache, #262's per-day buckets and the Chinese subjects), da3023d
#438 Teknium The bubblewrap sandbox mounts HERMES_HOME/{attachments,images,composer-pastes} read-only, so the agent can open what you attached. A staging dir that symlinks into the rest of the home or into a writable dir is refused. 7f31136, 3e7d09b
#433 (salvage of #199/#5) + #447 + #440 @Bendak Home Assistant deliver (route alerts to another platform's home channel) and deliver_mode: session (inject into that chat's existing session). The #440/#447 fixes: home-thread routing, caller thread keys win, a refused send falls back to the HA notification, unknown silence markers send a plain alert. 225f078, 884384c, 18c961f, e1b724c, d3aee60, 432a5ef
(ours, per #433 review) Teknium One startup warning per process, only when a non-HA deliver target is configured. It names any missing gateway internal (_authorization_adapter, admit_internal_event, _profile_runtime_scope, build_session_key, lookup_by_session_key, LIVE_GATEWAY_SILENT_MARKERS) and says deliver falls back to the HA notification. bcd5fee
#240 @vortexopenclaw The HA cooldown starts only when an event produces a message. On/off domains say the real state for unknown/unavailable. Climate setpoint changes alert. Dropped: current_temperature as a trigger, because it changes on every reading. 02e474c, 0f74a0d (removal), bb0a02e
#186 (reworked) @salch-cred, Teknium One /spotify command (play [query], pause, skip, np, queue <track>) registered with ctx.register_command, clear of core /pause and /queue. An unknown subcommand prints the usage line. With no login it answers "not configured". The committed .coverage is removed. 33a242c (salch-cred), 18ab0ac, b78b645, 9790954
#386 @leonardoag2026-beep Camofox browser.camofox.durable_agent_identity: each cron job gets its own Camofox profile derived from its job id. Off by default; it ships with a CLI command. 1247046

Resolutions

Versions: memory-wiki 1.1.1 → 1.1.2 · bubblewrap 1.5.2 → 1.5.3 · homeassistant 2.0.2 → 2.0.3 · spotify 2.1.1 → 2.2.0 · camofox 1.1.1 → 1.2.0

Verification (local, core main 9f47677 and v0.23.2):

  • memory-wiki: 110 passed on both cores.
  • bubblewrap: real bwrap under env -i, 622 passed and 1 skipped on both cores.
  • homeassistant: 346 passed, 2 skipped on both cores.
    • The missing-symbol test fails with the warning removed.
  • spotify: 147 passed on both cores.
    • A scratch-home load through core's real plugin loader resolves /spotify.
  • camofox: 125 passed on both cores.
  • Install scanner: safe for all five dirs on both cores.

Supersedes #436, #438, #433, #447, #440, #240, #186, #386

Fixes #430
Fixes #18

tillstriegel and others added 21 commits November 19, 2026 19:23
The dotted-identifier scan over user text turned "e.g", "i.e" and "it.Then"
into subjects. Require 2+ char parts with no capital after a dot (snake_case
always counts).
…-day aggregation

#48 predates #49 (per-session cache), #262 (per-day buckets) and the Chinese
subject support, so its commit landed with main's side of those hunks. This
applies its rule across them:

- extraction: only user turns and the title create or score subjects; previews,
  tool names and tool calls do not. Title text (and title quotes) rank but do not
  count as user-raised. The unquoted Han phrase still comes only from the first
  non-empty user text, and the Han candidate cap stays.
- units carry `user_supported` in subject and per-day candidates; the day log
  ranks user-raised subjects first, as the subject list does.
- no fallback snippet: a subject lists only snippets that mention it. The cache
  sidecar moves to session_units-v2.json so v1 units (no user_supported, with a
  fallback) are rebuilt, not reused.
- snippet matching keeps Han characters, so Chinese subjects get their snippets.
- tests that relied on preview subjects, assistant-only sessions or tool work
  items now state the new rule.
…he agent can open what the user attached

Hermes stages file.attach uploads, pasted images and large Desktop pastes
under HERMES_HOME/{attachments,images,composer-pastes} and names the staged
file by its host path in the prompt (@file:). The sandbox hid HERMES_HOME
whole, so any attachment too large or binary to inline pointed at a path
that did not exist inside the sandbox, for terminal commands and file tools
alike, and an operator bind could not bring it back.

Each staging dir is now made if missing (as core does for docker) and bound
read-only at its own path among the late mounts, through the same bind
guard as the scratch dir: a staging dir that is a link into the rest of the
Hermes home or into a writable dir is refused with one warning. Read-only,
so a command cannot plant a file a later turn takes for an upload. The rest
of HERMES_HOME (config, .env, sessions, platform document caches) stays
hidden.

Version 1.5.2.

Fixes #430
…or watched entities

Ports the deliver/session-mode feature to the standalone plugin. Two closed
core PRs carried this work and are embedded here: #96930 (configurable deliver
target for watch_entities/watch_domains, DavidMetcalfe) and #112136
(session-mode delivery integrated on top, with silent-session markers and
identifier hardening). Both were closed as no-longer-applicable when Home
Assistant left hermes-agent core in #132469 and the bundled adapter moved to
this standalone plugin (the plugin's adapter predates both).

- deliver: per-entity/domain cross-platform target override (tag grammar
  ha_events:<platform>[;session]); default target configurable
- deliver_mode: broadcast (default) or session — session injects the EVENT
  into the target chat's session via admit_internal_event (one agent turn
  inside that chat's history) instead of broadcast-shipping the reply
- never-mint invariant: derived keys must match an existing session
  (lookup, never get_or_create); unresolvable chat shapes fail closed
- chat-type resolution: persisted chat_type -> platform chat-id formats
  -> None (fail closed)
- injection budget: per-CHAT rolling-window cap, slot spent only on admission
- canonical silence-marker strip + untrusted-data framing on injected payloads
- fail-safe broadcast routing: private core APIs used only inside guarded
  blocks; any incompatibility degrades to the HA notification
- backport #71206 (_connect_error_detail) + NOTIFICATION_TITLE from the
  plugin extraction
- tests/test_homeassistant_adapter_ported.py: the full adapter suite (82
  tests) ported to the plugin layout (homeassistant_plugin imports);
  mutation-verified: never-mint, budget, and marker-strip mutations each
  flip specific tests to failed
- README documents deliver/deliver_mode and the dict-form watch entries

Co-authored-by: DavidMetcalfe <80915+DavidMetcalfe@users.noreply.github.com>
The ported suite asserts PlatformConfig.token == "env-token", but that
credential propagation row left core with the Home Assistant extraction
(NousResearch/hermes-agent#132469). The plugin's adapter reads the token
from the environment itself, so assert it at the layer that owns it now.

Platform and extra["url"] assertions are unchanged. No production code
changes.
…nd refusals

- broadcast: forward the home channel's thread_id in the send metadata, so a
  home pinned inside a forum topic receives the alert in that topic instead of
  the root chat (core does exactly this in gateway/delivery.py)
- session mode: derive the session key with the home channel's thread_id; the
  key layout carries the thread slot, so omitting it targeted the root chat's
  conversation while a topic session existed
- send: inspect SendResult.success - adapters report a transport refusal by
  returning success=False instead of raising, so an unchecked return dropped
  the event with no HA fallback and no warning from this plugin
- read gateway_runner with getattr so a core rename degrades to the HA
  notification instead of raising outside the compatibility wrapper
- warn when the gateway's silence-marker import fails: it silently disabled
  marker stripping on injected payloads for the module's lifetime

Tests: 5 new cases (thread routing, metadata pass-through control, refused
send, topic session key, missing gateway_runner attribute, marker-import
warning); each behavioural one fails with adapter.py reverted.
…s are unknown

Review findings on 6c332f4:

- broadcast: the home-thread default shadowed caller routing aliases. Core treats
  thread_id, message_thread_id, direct_messages_topic_id and
  telegram_direct_messages_topic_id as the same routing decision and only adds
  its default when NONE is present (gateway/delivery.py:30,340-344); adding
  thread_id beside a caller's message_thread_id diverted the alert. The same key
  set is now checked.
- markers: a failed import returned (), which reads as "no markers exist" and let
  injection proceed with an entity value's own marker intact - an entity could
  suppress its own alert once the model echoed it. It now returns None ("unknown")
  and session-mode injection degrades to broadcast, which never routes the text
  through the model.

Tests: 2 added (caller alias preserved; injection degrades on unknown markers).
Both fail with the adapter reverted; 303 passed, 2 skipped otherwise.
…known

Round 3 finding: returning False from the injection path does not avoid the model.
The caller falls through to the source-session turn, which hands the unsanitized
text to the agent - so an entity value carrying a marker could still suppress its
own alert. With unknown markers the text now goes out through the same tested
cross-platform broadcast arm (home thread preserved, SendResult inspected, HA
fallback on failure) and no turn is dispatched in the source session.

Test: the marker-unknown case now asserts the plain delivery happened and that
handle_message was never called; it fails on 8bf9c99.
…cated

Both parents introduced `self._last_event_time`; the merge kept both, at
adapter.py:214 (main) and :341 (salvage). Nothing reads the map between them, so
the second assignment was redundant. Keep main's, drop the salvage duplicate.
…er uses is missing

Cross-platform deliver and deliver_mode: session call six gateway internals
that are not in the published plugin API (_authorization_adapter,
admit_internal_event, _profile_runtime_scope, build_session_key,
SessionStore.lookup_by_session_key, LIVE_GATEWAY_SILENT_MARKERS). Each call
already falls back to the HA notification, so a core rename read as deliver
quietly stopping. connect() now checks them once per process, only when a
deliver target other than homeassistant is configured, and logs one warning
naming every missing symbol and the fallback.

Suggested by @Bendak on #433.
…t an event

#240 made current_temperature an attribute-only climate trigger. A thermostat
reports it on every reading, so a watched climate entity would wake the agent
over and over. Setpoint changes (temperature, target_temp_low/high) still
trigger.
…ions

Five terse gateway commands without a full agent turn: /play [query], /pause, /skip, /nowplaying (alias /np), /queue <query>. The handlers call the same tools the model does and format one line, so state handling and Premium/device restrictions behave identically.

Handlers and formatting only; dispatch lives in core and is a follow-up, and availability gating needs core's gateway_availability_fn hook (toolset enabled AND a stored login). Search picks the top result; no interactive pickers.
…not configured'

spotify/.coverage was a 53 KB coverage database committed by accident; it is
removed and ignored. SpotifyClient() raises SpotifyAuthRequiredError outside
the tool's error boundary, so every handler raised instead of returning the
'Spotify not configured' line the issue asks for.
So the handler tests stay green once the active-device guard (#142) or the
default device (#145) makes playback calls list devices first.
Reworks #186's handlers into a single command registered through the
documented plugin API (ctx.register_command), so it works in the CLI and every
messaging gateway now instead of waiting on a core dispatch change:

  /spotify play [query] | pause | skip | np | queue <track>

One /spotify name keeps clear of core's own /pause and /queue (register_command
skips a name that clashes with a built-in). np is now playing. An unknown or
missing subcommand prints the usage line. Sync handler: core runs it on the
gateway pool, not the event loop.

Version 2.2.0 (plugin.yaml now matches pyproject).

Fixes #18
A cron job outlives one run, but its browser identity did not: cron sessions
run under cron:<job_id>:<execution_id> and the execution id is new on every
fire, so each fire minted a different userId — the tab the previous fire left
was unreachable and its cookies were gone. With managed_persistence the job
instead fell back to the profile-scoped jar, sharing cookies with every other
task in the profile.

With browser.camofox.durable_agent_identity (default off) the identity comes
from the job id — the stable half of the task id — so every fire resolves to
the same Camofox profile with the logins the previous fire left:

  cron:<job_id>:<execution_id>  ->  agent key  cron:<job_id>
                                ->  user_id    hermes_ag_<uuid5(...)[:12]>
                                ->  session_key agent_<uuid5(...)[:16]>

Derived, not stored, so it cannot drift or duplicate across processes.
Opt-in because it puts a job's cookies on disk and those profiles outlive the
job; one-off tasks (interactive chats, subagents) never join a job's profile,
and tab adoption stays the user's own choice (adopt_existing_tab).

Teardown is `hermes camofox identity <job_id>`, after `hermes cron remove`:
it closes the live session through DELETE /sessions/<userId>. The on-disk
profile belongs to the Camofox server, which exposes no route that deletes
one, so Hermes no longer rebuilds and removes the server's private
sha256(user_id)[:32] directory; the README documents the manual cleanup.

Rebased onto #255, which makes the ephemeral identity reproducible per task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

6 participants