Commit Graph

37 Commits

Author SHA1 Message Date
kshitijk4poor
c91bd232c0 fix(kanban): drop the worker.adopt handshake retry from the lost-worker salvage
The salvaged commit raised the managed worker's owner-link open timeout from 5 s to 60 s
(with a HERMES_WORKER_RPC_OPEN_TIMEOUT override) and retried a timed-out handshake three
times. Those retries cannot succeed against a real owner: WorkerRPC._connection mints ONE
worker-adoption ticket and every attempt resent it, while the gateway's bootstrap tickets
are single-use and expire after 30 s (gateway/runtime_bootstrap.py TTL_SECONDS, redeem()
deletes the entry). An attempt past 30 s, or any retry, is refused, and the same path
serves every idle redial during a turn, so a failing redial now took about 3 minutes
instead of 5 s while holding WorkerRPC.lock. The env knob also went against the
repo's no-new-HERMES_*-config rule.

The lost-worker disposition (worker_lost event, settled-admission reclaim) does not depend
on the handshake budget: a worker that dies in worker.adopt is now booked within one tick
either way. Sizing the handshake needs a fresh ticket per attempt and a budget within the
ticket TTL, which is its own change.
2026-10-28 17:06:43 +05:30
SanLuis-AI-Solutions
2432f9c29a fix(kanban): dispose of a lost managed worker within one tick
A managed worker that dies in the worker.adopt handshake writes no
worker_bound/worker_result: the gateway logged "Managed worker lost" and
returned, nothing failed the run, and the card said "running" for 49
minutes on a corpse (2026-10-22, t_f5fad63f, run 730: claim_expires 2067 s
past, last_heartbeat_at NULL, consecutive_failures 0).

D1 detection without disposition: gateway/session_kanban.record_worker_loss
writes a run-scoped worker_lost event on the board (dropped when the card
moved past that run) and session_managed_worker calls it on every loss
except a deliberate stop / stale generation.

D2 an elapsed claim lock read as "still running":
- owner_attempt_provably_over treats a SETTLED owner admission as proof the
  attempt ended, instead of demanding the owner PROCESS be gone (the owner
  is the live gateway, alive by design) - the reason every reclaim path
  declined for 49 minutes;
- the reclaim's kill step reads a bare OSError on an absent pid as Windows
  does (WinError 87), so "already gone" no longer means "termination not
  proven";
- reclaims/reaps name the loss in the run error via owner_attempt_note;
- a loss charges consecutive_failures like any other crash (A3), so the
  failure_limit breaker covers this class.

D3 adopt handshake budget: 60 s default, HERMES_WORKER_RPC_OPEN_TIMEOUT
override, and a TimeoutError is retried with backoff (auth/protocol errors
never are).

Tests: tests/hermes_cli/test_kanban_managed_worker_loss.py (A1-A3, D1
write side, kill-step semantics) and tests/agent/test_worker_rpc_adopt_timeout.py
(A4). 16 passed under the production interpreter.
2026-10-28 17:06:43 +05:30
Teknium
1bc291ab30 fix(delegation): managed workers accept the tool pin's delegation_backend
The worker store validated a tools[] pin as exactly {version, tools}, so a pin
carrying delegation_backend raised invalid_params and left the worker's store
failed for the rest of the turn (every managed-worker test timed out).
2026-10-23 00:37:14 -07:00
Teknium
bf2b3713ab fix(managed-worker): delegate_task works in Kanban workers through owner-reserved children
Since #106742 every Kanban card runs in a gateway managed worker, and
ef52a09a55 removed the delegation toolset there: a delegated child needs
its own owner-registered execution (review r4224751560 / r4230769955), and
_open_child_session_db refused with worker_child_registration_required.

The rule stays; the missing owner side is built:

- child.reserve (gateway/session_worker_child.py): a worker asks on its own
  fenced receipt stream. The owner verifies the parent's claim, mints the
  child's session row (source subagent, parent lineage, parent profile,
  _delegate_from marker) and a kind='child' execution bound to the parent's
  verified pid/birth, the worker's fresh secret and the connection
  principal, under the parent's id prefix. Caps come from the root
  session's frozen policy (delegation.max_concurrent_children,
  max_spawn_depth); a refusal or draining owner is a receipt, so the
  parent's journal never sticks.
- ChildSessionStore (agent/runtime_session_child.py): the child persists
  through ordinary worker.persist under its own claim, writes only its own
  row, never binds the process delegation ledger, finishes on close.
- Retirement: every terminal transition of an execution (finish, loss,
  settlement) retires its live children and ends their rows; an owner
  restart retires old-epoch children (never adoptable) while the root alone
  becomes unknown.

WORKER_DISABLED_TOOLSETS is gone because the only child path in a worker
now goes through the reservation.

Fixes #141793
2026-10-20 03:22:11 -07:00
Teknium
441c3bd18d fix(worker): persist activity and aux usage off Relay's event loop
Relay drives Hermes' provider and tool callbacks synchronously on its
private asyncio loop. In a managed worker, _touch_activity inside those
callbacks reached RuntimeSessionStore -> WorkerRPC on that loop, and the
#139472 guard refused it (synchronous_rpc_on_event_loop). The refusal is
sticky on the store, so later append_message / finalize writes of the
turn failed the same way and the worker died as managed_worker_failed.

The reporter's caller diagnostic on #139029 names two stacks:
relay_llm.run_callback -> interruptible_api_call -> _emit_wait_notice ->
_touch_activity, and concurrent tool dispatch -> _begin_tool_execution ->
_touch_activity. Both end in _persist_session_activity_if_due.

call_off_event_loop() (runtime_session_store) runs a synchronous write on
a one-shot worker thread when the current thread is running a loop, with
the context copied and errors re-raised. The callback already blocks that
loop, so waiting costs it nothing. The guard is unchanged. Callers:
- _persist_session_activity_if_due (both reported stacks)
- _reset_activity_labels_after_turn (same mixin, same shape)
- record_aux_usage: a sync auxiliary call inside a managed tool callback
  (the async aux path already hops with asyncio.to_thread)

Tests drive the real Relay pipeline (relay_llm.execute,
relay_tools.execute), the real RuntimeSessionStore and the real guard.
Only the owner's socket is replaced.

Refs #139029
Refs #134889 (KB-2)
Refs #141321
2026-10-18 18:47:43 -07:00
Teknium
1237193f46 fix(windows): dirs made while elevated stay usable; an unusable token-lock dir parks once
An elevated Hermes (install, `hermes update` as admin, a gateway started from an
admin prompt) creating a dir with mode=0o700 gets CPython's protected
SYSTEM + Administrators + OWNER RIGHTS DACL, owned by Administrators. The same
user's non-elevated Desktop/gateway/CLI then gets WinError 5 inside it (#139845).

- hermes_dir_acl.make_user_dir: Path.mkdir that, only when the process is
  elevated on Windows, adds an inheriting full-control ACE for the token's user
  SID to every dir it created and to an existing leaf (repairs a dir an earlier
  elevated run left). No-op off Windows / unelevated. Routed through it: the
  gateway lock dir (scoped token locks, host rendezvous, update host
  obligation), bot mailbox, gateway.lock homes, pending_messages, media/attachment
  roots, process logs, spill dirs, vault, outbox, backups, home skeleton and
  mkdir_under_hermes_home (logs).
- W2: acquire_scoped_lock raises ScopedLockDirUnusable when this token may not
  use gateway-locks (or read a stale lock in it), logged WARNING once per dir with
  the repair (`icacls DIR /reset /t`). _acquire_platform_lock parks the adapter
  as non-retryable `lock_dir_unusable` naming the dir and the fix, instead of a
  raw PermissionError that Telegram retried forever.
- Builds on @KoNit-K's update-time ACL repair (#139870), which re-grants the
  whole home after an elevated update.

No Windows host was available: the ACL behavior is covered by
tests/test_hermes_dir_acl_windows.py (Windows CI) and needs a live retest.

Refs #134889 (W8, W2)
Refs #139845
Refs #140337
2026-10-17 08:03:52 -07:00
unsupportedpastels
e06087d9d2 fix(worker): redial once when the owner closes an idle link before the send
An owner close landing after the idle check (reader.is_alive()) but before ws.send() made send itself raise ConnectionClosed, and the caller got an outcome-unknown error for a request that never left. websockets 15 raises ConnectionClosed from send only before a complete frame is written (closed on entry, or the socket write failed), so the call now drops the link, redials with a fresh ticket and sends once more. Any error after a successful send (reply wait, timeout, mid-flight close) still drops the link and propagates unchanged, never resent; a failing resend is not retried again.

Refs #134889 (KB-3)
Refs #139162
Refs #139011
2026-10-15 23:59:19 -04:00
unsupportedpastels
58e2b5472a test(worker): wait for the observed idle close, not the clock
Code-health follow-up to the owner-connection reader: the reconnect test
waits for the reader thread to exit instead of sleeping; the reader's
catch-all (handed to the calling thread, which raises it) and the flood
fixture's 5 ms spacing (separate broadcasts are the behaviour under test)
carry reviewed health waivers.

Refs #134889 (KB-3)
Refs #139162
Refs #139011
2026-10-15 23:59:19 -04:00
unsupportedpastels
13a8c2cc97 fix(worker): read the owner connection continuously and drop the library keepalive
The retained owner WebSocket was only read during a call. The owner
registers every worker connection as a live transport and broadcasts
sessions.changed to it, so a worker busy in a model call or tool piled up
more than websockets' 16-frame receive high-water mark, the library paused
socket reads, and pings and the close handshake stalled with them. The
next persistence call was then sent into a connection the owner was
already closing and failed with an unknown outcome, which the store
latches. Separately, the default 20 s client keepalive ran its own pong
deadline, so a short owner stall could close the connection inside a
call's 20 s receipt budget.

A reader thread now owns the socket for its lifetime: it discards pushed
events as they arrive and hands the reply for the one outstanding request
id (or the close exception) to the waiting caller. ping_interval=None
leaves the per-call receipt budget and the observed close as the only
liveness checks. Buffering stays bounded (library queue, at most one reply
plus a close in the hand-off queue); calls stay serialized under the lock
with per-request ids; an idle close observed before a send still redials
with a fresh ticket; any error after a send drops the connection and
propagates without a resend. Server checks still run per request.

Alternatives not taken: stopping broadcasts to worker connections would
need a new transport rule in the owner (it does not tell worker
connections apart today) and still leaves the client keepalive; an idle
timeout would add a redial per quiet stretch and still pause reads inside
the window.

Refs #134889 (KB-3)
Refs #139162
Refs #139011
2026-10-15 23:59:19 -04:00
unsupportedpastels
ba23bd22f2 fix(worker): reuse one owner connection per managed worker
WorkerRPC dialed a fresh WebSocket for every persistence call: a new
discovery, identify, single-use worker-adoption ticket and WS accept on
the owner loop each time, so a busy worker multiplied every owner stall
into owner_unavailable failures.

Keep one authenticated connection per WorkerRPC. It is discovered,
identified (self-RPC guard) and ticketed on connect exactly as each
call was; requests stay serialized by the existing lock and are now
correlated by an increasing id. Events the owner broadcast between
calls are drained before a send, which also surfaces a close the owner
sent while idle, so that case redials before anything is written. Any
error once a request may have been sent drops the connection and
propagates unchanged (ConnectionClosed / worker_receipt_timeout); it is
never resent, so the store latches it and its journal replays the
same sequence as before. No server or protocol change.

Refs #134889 (KB-3)
Refs #139162
Refs #139011
2026-10-15 23:59:19 -04:00
unsupportedpastels
f15d719ffd fix(agent): name the caller when the worker RPC guard fires on a loop
A managed worker that reaches the synchronous persistence RPC on a thread
with a running event loop gets WorkerPersistenceError
('synchronous_rpc_on_event_loop'), which the store keeps as a sticky
failure. When a best-effort writer (aux usage, the tools pin) swallows
that first raise at debug, the logs only show the later sticky failures
(append_message, flush_token_counts, turn.cleanup) and never the code
that tripped the guard.

The guard stays as it is. Before it raises, it now logs a WARNING with
the RPC method, the thread name and a module:function:line summary of the
frames above the store. The store's own frames are left out, and no
locals or argument values are logged.

A static pass over the worker's loop owners did not confirm a trigger,
so this commit only adds the diagnostic. Checked: async tool handlers via
_run_async, async aux calls (accounting is already off-loop), MCP
sampling and list_changed, the periodic lease/liveness scheduler, the
process registry, deadline helpers and smart approvals.

Refs #139029
Refs #134889 (KB-2)
Refs #139162
2026-10-15 23:59:19 -04:00
Teknium
efd57c8c10 fix(agent): a managed worker's session store offers main's two model_config calls
Main's onboarding run record (agent/onboarding_record.py) calls SessionDB.update_conversation_model_
config_value and session_ids_with_model_config_key on the agent's session_db; a managed worker's agent
gets a RuntimeSessionStore there, which lacked both (release run 38569922181:
test_store_offers_every_core_session_db_call_with_its_keywords). The worker owns exactly its session
row: the read-modify-write patches that row through the owner (None removes the key, as on SessionDB),
and the key scan answers with its own session.
2026-10-14 06:22:10 -07:00
Teknium
8376dc7614 fix(gateway): worker.register accepts only the owner's launched worker
Mechanism: worker.register needed only session:control, which every default
interactive ticket carries, so any local client could insert a 'registered'
compute execution for a session. Its pid/birth live only inside the hashed
adoption_digest, nothing in the live owner reaps the row, and while it stays
registered claim_session_input returns None: the drain pauses session_busy and
API/webhook/Bot observers wait on queued work until a restart turns the row
unknown (then the session refuses claims until a reset). The repo has no
interactive caller; managed workers reserve through the private
reserve_admission_worker path.

Fix (maintainer ruling: restrict to the managed worker's own launch, fail
closed): register now requires the worker-adoption capability (worker:adopt),
the same grant adopt/persist use, and the registrant pid must be this owner's
child (at most MAX_LAUNCHER_HOPS launchers below it). The worker RPC client
mints a worker-adoption ticket for register too. No new grant type.

Red on r13-base2: tests/gateway/test_worker_register_restriction.py (real
SessionAuthority + SQLite, real child process): an interactive ticket
registered a row; after the fix it and a foreign same-user pid are refused and
the owner's own child still registers.

Review: ahrazzle B1-14
2026-10-11 19:31:35 -07:00
Teknium
3c34e12465 fix(agent): the managed worker's store answers every session_db read the agent core makes
A managed worker's AIAgent holds a RuntimeSessionStore as its session_db. The store is new
in this PR and was built call by call, so reviewers found the gaps one at a time (the lease
refresh's patience_s keyword, d93039f5b4a). A mechanical sweep of every <x>._session_db /
session_db / lease-facade db call in run_agent.py and agent/*.py against the store found two
more SessionDB methods the store lacked:

- latest_conversation_role: _close_durable_failed_turn's idempotence probe. The
  AttributeError was swallowed by its best-effort guard, so a failed managed turn never got
  its Hermes-authored boundary and the next prompt merged into the failed request.
- get_message_role: in-place compaction's held-row liveness checks
  (held_archive_watermark, the absorbed-row tail count). The AttributeError aborted the
  in-place commit, so a managed worker's in-place compaction always rolled back.

Both are closed, read-only receipt operations on the owner's transaction
(session.tail_role, session.row_role), scoped to the worker's own transcript like every
other worker read.

Test: tests/agent/test_runtime_session_store_surface_parity.py parametrizes over every core
call site (fails on r11-base for get_message_role, latest_conversation_role and
refresh_session_turn_lease), plus an owner-parity check of the two reads.

Review: Adolanium reg-1 (class sweep)
(cherry picked from commit 4e7b4ff8cfc23a01c6dc98f33fca64cee626b423)
2026-10-10 22:49:18 -07:00
Teknium
315ce9a412 fix(agent): a managed worker's lease refresh accepts the refresher's patience
DurableTurnLease.refresh_tick renews through the agent's session_db with
patience_s=min(write patience, remaining authority). In a managed worker that
session_db is RuntimeSessionStore, whose refresh_session_turn_lease had no
patience_s keyword, so the first renewal (after refresh_interval, 60s) raised
TypeError, the refresher treated it as a non-lock failure and interrupted the
turn with "Session turn lease could not be refreshed". Every managed-worker
turn longer than one refresh interval died.

Accept patience_s like try_acquire_session_turn_lease already does: the RPC
renewal is one gateway-side write, so the local write-lock patience does not
apply; the payload sent to the gateway is unchanged.

Test (red on r11-base: TypeError -> interrupt):
tests/agent/test_runtime_session_store_lease_refresh.py::test_managed_worker_turn_survives_lease_refresh_tick

Review: Adolanium reg-1
(cherry picked from commit d93039f5b4a746af4c031e08833daa067dbc0895)
2026-10-10 22:49:18 -07:00
Teknium
14dd2b98fe fix(worker-outbox): reconcile a retained outbox under the verified successor's adoption
RuntimeSessionStore refused any on-disk journal whose scope differed from
the constructor scope, before adopt() could ever see the authenticated
replacement assignment. After owner replacement a lost-ACK receipt
(sequence 1) therefore stayed stranded: the old epoch was fenced
(stale_epoch) and the verified new epoch was refused (outbox_scope_mismatch).

The constructor now takes the separately authenticated worker.adopt result
(adopted=). A differing journal is reconciled only when that proof names the
same execution/generation/target and the requested epoch, every other scope
field is identical, the epoch only moves forward, and a target change is
explained by a pending compression.publish. The pending entries replay
under the journal's own target with the adopted epoch, so the owner resolves
the original receipt (exact digest) instead of writing a second one, and the
constructor then requires the replayed scope to equal the adopted scope.
Without a matching proof the outbox is refused exactly as before.
agent.managed_worker.execute passes the adoption it already verified.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4230769936
(cherry picked from commit 7995f199993375ec1b99af16da51f2412ebf4590)
2026-10-09 17:31:25 -07:00
Teknium
6b616486c1 refactor(gateway): build the owner WebSocket target in one helper
The canonical owner dial (api_origin -> ws(s)://.../api/ws plus the
['hermes-gateway-v1', 'hermes-gateway-ticket.<ticket>'] subprotocol pair)
was spelled out in agent/runtime_session_store.py (WorkerRPC),
hermes_cli/gateway_client.py (connect_gateway), gateway/session_a2a.py
(forward_to_owner), and also tools/bot_live_delivery.py and
ui-tui/scripts/gateway_bootstrap.py.

hermes_cli.gateway_client already owns the ticket mint (_session_ticket) and the
viewer client, so it now owns gateway_ws_target(endpoint, ticket) and
GATEWAY_WS_PROTOCOL (re-exported from gateway.session_contract's
CANONICAL_GATEWAY_PROTOCOL, a dependency-free module). Every caller uses it and
checks the negotiated subprotocol against the constant. Same URL, same
subprotocols, same proxy=None / timeouts at each call site.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5456384314
2026-10-08 09:10:49 -07:00
Teknium
3996bf69cc refactor(storage): publish worker outbox, hosted blobs and media dirs via utils
Three hand-rolled temp+fsync+rename / directory-fsync copies duplicated
utils.atomic_write_bytes / utils.fsync_directory and lost their behaviour:
the Windows contended-rename retry, the EXDEV/EBUSY copy fallback for
bind-mounted or cross-device dirs, and symlink-preserving replace.

- agent/runtime_session_store.py _save: atomic_write_bytes(mode=0o600,
  fsync_dir=True, tmp_prefix='.pending-'). Same owner-only bits (mkstemp 0600
  fchmod'd before the rename) and the same file + directory-entry fsync.
- gateway/hosted_room_attachments.py _write_blob: atomic_write_bytes(mode=0o600,
  fsync_dir=True, tmp_prefix='.tmp-'); the orphan sweep still reclaims the
  '.tmp-' staging names after a crash.
- gateway/session_ingress_media.py: the private _sync_directory -> utils.fsync_directory.

Behaviour note: a failing directory fsync is now best-effort in all three
(utils policy; the file fsync and the rename still raise), matching what
_write_blob already did.

Red/green: test_outbox_journal_survives_a_cross_device_rename fails on the
parent (OSError EXDEV from the bare os.replace) and passes here.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5456384314
2026-10-08 09:10:49 -07:00
David Dudok de Wit
e32a886e1d fix(worker): retain persistence and ownership through physical shutdown
Keep reserved workers able to persist during drain, join actual in-process writers before releasing a profile, and reap children created after cancelled process acquisition. Reopening a worker outbox reconciles its pending receipt; managed results retain per-turn usage and bounded live tool details.

This commit contains the physical-worker foundation only. Mutation-task and Bot mailbox lifetime tracking are separate follow-ups. The existing zero-second restart drain default is unchanged.

Validation: scripts/run_tests.sh -j 4 across 10 worker/runtime files: 26 passed, 1 POSIX-only skip on native Windows. Includes a real managed child completing its durable receipt during a configured restart drain. The unchanged upstream one-second retirement test missed its deadline once under parallel load and passed the runner retry; an isolated rerun passed both cases without retries. Logs: split-W-tests.log, split-W-retirement-rerun.log.

Review-source: helix4u, https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6024687448
Review-source: greptile-apps, https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4211047305
Review-source: greptile-apps, https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4211047387
Review-source: greptile-apps, https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4213427126
Review-source: dokterdok, https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4211144039
Source-base: NousResearch/hermes-agent#106742 at 0b815190b2
(cherry picked from commit 6156b21c5e3fa5e9295a13d5e02caa9b959ada82)
2026-10-08 09:10:26 -07:00
Teknium
16585ffe2f fix(agent): managed turns reach their owner when an HTTPS proxy is configured
WorkerRPC dialed the owner's loopback /api/ws with the websockets
default proxy=True, so a managed worker that inherited HTTPS_PROXY (a
single-profile gateway passes its environment through unchanged) sent
worker.adopt to the proxy. A proxy that cannot reach 127.0.0.1 refused
it, the child failed before its first frame and the admission was left
unknown.

The dial now passes proxy=None, the same rule connect_gateway applies to
the same endpoint. Proven with a real refusing HTTP proxy and a real
loopback websockets owner. ALL_PROXY alone is not read by websockets, so
it never affected this dial.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4213739424
2026-10-07 23:44:33 -07:00
Teknium
1e500ebce2 Merge origin/main (#16: 4,465 commits to 9dcab1e440) into feat/unified-gateway-runtime
99 conflicted files resolved in nine area lanes (Desktop composer, Desktop renderer/shared
client, Electron main, Ink, tui_gateway, gateway, state, CLI/config, cron/tools/CI). The
unified runtime's architecture wins where it deliberately replaced a mechanism (pool,
fallback lanes, claim poller, renderer queue); every orthogonal main change is kept, ported
into the <stem>_<topic> sibling that now owns relocated code.

Notable ports and repairs in this merge:
- tui_gateway/server.py relocated regions: atomic _attach_built_agent (#49852), slash ranking
  registry names, minted-key helpers methods_session.py calls, request_overrides, service tier.
- gateway/run_turn*.py: i18n accessors for the removed reply constants, first-contact
  internal/DM rule, rotated-compression persist, fast-mode tiers, prompt-pin rehydration.
- webhook: route_from_chat_id decodes main's opaque webhook:v2 chat ids (old ids still read).
- ws.py: main's per-connection dispatch queue with authority-first dispatch inside it.
- state: schema event for runtime revision renumbered to 31; worker mirrors updated for
  main's message uid/merge fields, on_contended lease arg, compression columns.
- config: branch's bot_chat_delivery_timeout removal renumbered v47 -> v50.
- Electron: primary-profile pin, redirect header scoping, remote fetchJsonForBackend, SSH
  teardown on profile delete, held-update dial gate restored (lost in earlier merges).
- Desktop: canonical clarify.request mapped to main's questions[] card; replay truncation vs
  snapshot_required; periodic secondary prune tick restored; DELETE already_absent restored.
- cron/tools: diagnostic category on cron failure notices restored; owner_holds_delivery
  ported onto the authority; admitted receipts can no longer be cancelled locally.
2026-10-06 14:24:24 -07:00
teknium1
d86eac0320 fix(worker): managed workers receive main's transcript row state
Merge #10 brought main's transcript row identity (DB_ROW_SNAPSHOT digest,
CANONICAL_ROW adoption, stamped timestamp), which main mutates onto the
caller's message dicts in place. The owner's worker receipts still returned
the retired _canonical_content key, so an owner-run worker never learned an
adopted row and its next flush was refused for the new keys.
Receipts now carry every row-state key (None = the owner popped it, so a stale
adoption is cleared worker-side) and the worker whitelist accepts them.

Also aligns two suites with main: bulk delete reports skipped_active, and the
install-launcher tests target _hermes_cli (the DM delivery argv's launcher)
since this branch has no local bot-chat delivery lane.
2026-09-27 13:15:44 -07:00
teknium1
1b49728ef4 fix: read the unified runtime's journals and group metadata BOM-tolerantly
Main's footgun gate now requires utf-8-sig for reads; the runtime session
journal, scheduler authority journal, group-control metadata and --query-file
reads were still plain utf-8.
2026-09-27 02:32:34 -07:00
teknium1
f351158879 fix: canonical admission composes with main's chaos matrix, tools[] pin, webhook mirror and fr/de/es
- busy_input_mode over the durable FIFO (run_inbound._hm_busy_preempt): a follow-up during a running
  turn still steers into it, redirects it, or ends it before admission; before, every messaging
  follow-up was queued behind a turn that could hang for its whole request timeout (chaos cell
  busy_interrupt_during_provider_hang: no answer in 15 s).
- Native provenance binds a credential-less plugin platform by platform + owning profile instead
  of refusing it as not_found (every turn on the chaos fake platform failed RuntimeStoreError).
- Worker tools[] pin follows main's {version, tools} shape (d956f0ae57): the owner verb stores it
  content-addressed like SessionDB.update_session_tool_names, and worker session reads resolve it.
- Durable webhook destination accepts main's `mirror`/`route` delivery keys (11fb429f49); the
  route-test authority fixture pins a single default-profile runner.
- Desktop: the REST bridge's `connection` was shadowed by a block-scoped const, so the profile
  preference hook read `undefined.mode` after every request; the core E2E process census
  recognises `gateway run` backends (the app attaches through `gateway ensure` here); canonical
  group labels for fr/de/es; the #119569 reducer test uses the canonical admission receipt.
2026-09-23 19:14:39 -07:00
teknium1
9891fdf337 fix(workers): managed workers keep the session's tools[] prefix pinned across turns
The worker session-store facade had no update_session_tool_names, so
persist_agent_tool_names swallowed the AttributeError and left
sessions.tool_names NULL; the next fresh worker re-probed check_fns from
current config and forked the cached tools prefix. The facade now persists
the pin through a closed 'session.tools' receipt operation and a rebuilt
worker reads it back from the same row.

Finding: F26.
2026-09-12 09:57:31 -07:00
Teknium
e62ba4671e fix(cli): discover a served secondary through the default multiplexer's control socket
R3: `hermes -p <sec> chat`, `gateway ensure --json`, Desktop ensure, ACP attach and
WorkerRPC probed only `profiles/<sec>/gateway.sock*`. A served secondary has no socket
of its own — the multiplexer holds its gateway.lock — so discovery reported
`starting/deadline` forever and `ensure` tried to spawn a competing per-profile daemon.

`discover_gateway_endpoint` now falls through to the default root's control socket
when the profile's own is absent: the multiplexer's `identify` lists the home under
`served_profiles`, so `_endpoint(payload, home)` yields a ready endpoint whose
`profile_id` is the secondary's home and whose new `control_home` is the root.
`_session_ticket` mints against `control_home`, so the ticket is bound to the
secondary and redeemed by the multiplexer against its served set; `WorkerRPC` follows
the same discovery. `ensure_gateway_runtime` treats a starting multiplexer as the
pending owner of its named profiles instead of spawning a second gateway.

Only the live multiplexer's descriptor proves service (never a held lock alone); a
root that does not list the profile keeps the previous absent/starting verdict.
2026-09-11 21:33:59 -07:00
Teknium
56586998e2 fix: bind registered worker ledger before agent discovery 2026-09-08 18:31:18 -07:00
Teknium
ce8b1171a6 fix: release original worker turn lease after rotation 2026-09-08 18:31:18 -07:00
Teknium
6c57ad37c3 feat: compose worker compression lifecycle and delegation persistence 2026-09-08 17:53:19 -07:00
Teknium
84ccae2141 fix: restore worker compressor guards before agent construction 2026-09-08 17:03:13 -07:00
Teknium
7eecdcf213 fix: keep registered compute imports out of owner delegation recovery 2026-09-08 17:03:13 -07:00
Teknium
c6540cb9dd feat: persist assigned worker prompt context and usage anchors 2026-09-08 17:03:13 -07:00
Teknium
23b549216d fix: pause workers on outbox I/O failure and preserve local lease waits 2026-09-08 14:23:12 -07:00
Teknium
21a48aea09 feat: fence worker terminal receipt after sequenced durable writes 2026-09-08 14:23:12 -07:00
Teknium
a8c163afbc fix: freeze retry journals and retain exclusive worker outbox ownership 2026-09-08 14:23:12 -07:00
Teknium
e7cd5f9380 fix: attenuate worker reconnect tickets to execution operations 2026-09-08 14:23:12 -07:00
Teknium
9d7d7e2abd feat: authenticate live worker persistence and explicit restart adoption 2026-09-08 14:23:12 -07:00