Commit Graph

60 Commits

Author SHA1 Message Date
Teknium
839415bd11 fix(gateway): a cancelled hot-serve reserve can no longer take the profile after cleanup
Review finding P2 on #146120: cancelling the hot-serve's bare asyncio.to_thread
await left the reservation worker retrying. Once the transient holder let go it
took the profile's gateway.lock flock AFTER the canceller's ownership cleanup,
with no coroutine left to build the authority or release it (the gateway stop
cancels the reconcile watcher, then releases reservations).

reserve_waiting_out_transient_holders takes a cancel Event: checked before each
attempt, its waits wake on it, and a grant that lands after it is set is
released at once (ReservationCancelled). reserve_profile_home_in_worker runs
the hot-serve reserve with that Event; on CancelledError it sets it, waits for
the worker to finish (absorbing further cancels), undoes a reservation the
worker completed first, then re-raises. Boot's reserve runs synchronously on
the loop before any task can cancel it, so it needs no wrapper.

The flock is never bypassed: one gateway per host, two gateways never both own
a profile.
2026-10-28 13:11:46 -07:00
Teknium
24479b4529 fix(gateway): hot-serve of a new profile no longer parks it over a client's lock probe
The running multiplexer's hot-serve reserved a new profile's gateway.lock with one non-blocking
attempt (run_runtime.reserve_profile_home); a client discovery probe holding the flock in that
instant made it OwnershipConflict, and the profile was parked as "home owned by another gateway"
and only retried on an explicit control-socket rescan.

The bounded retry from the boot reserve moves into one shared helper,
runtime_ownership.reserve_waiting_out_transient_holders, used by both the boot reserve and
hot-serve: a contender that is gone by the re-check (a probe) is retried after a 15 ms backoff, a
browse reconcile or unpublished record is waited out, a live foreign owner still refuses at once,
and one fixed deadline bounds it all. Every grant is a real reserve. Hot-serve runs the reserve
in a worker thread so a wait never blocks the event loop.

Tests use real flocks held by a separate process (probe and live owner) through the real
_serve_profile_runtime, plus a persistent-flicker case that still refuses at the deadline; the
boot control asserts refusal well before the deadline instead of an absolute wall-clock bound.
2026-10-28 13:11:46 -07:00
Teknium
226c9bffd8 fix(gateway): a detached conversation leaves the chat's topic alone, never fakes a reset, and runs its queued prompt after a restart
Greptile on 7a915038d9c:

- A detached Telegram topic conversation kept its chat_id/thread_id, so its turn healed onto the
  topic's binding (the chat's current conversation) and a compression in it rewrote that binding,
  pulling the chat back into the old conversation. _is_telegram_topic_lane is False for a detached
  source: its turns neither heal nor write the binding, nor rename the topic.
- Compression exhaustion in a detached turn ran the route reset on its unstored key: nothing reset
  but the reply announced one. It keeps the session and returns the typed exhaustion result, as an
  API conversation does.
- An app prompt accepted for a detached conversation during a restart's after-turn wait stayed
  queued: boot recovery binds only conversations the routing index names. recover_detached_sessions
  mounts each pending conversation its chat moved past that has queued input and schedules it (a
  lost, unknown turn still waits for /discard).
2026-10-27 17:04:02 -07:00
Teknium
cedcf7a0b6 fix(gateway): open every profile's state.db off the event loop at boot
A multiplexed boot opened each served profile's state.db (schema + FTS
setup, about a second per store on a loaded host) synchronously on the
gateway loop: _build_profile_authority read runner._session_db under the
profile scope, and GatewayRunner() opened the launch store in
SessionStore.__init__. With 11 profiles the loop sat in _init_schema for
~11.7 s of stall samples before any client was served.

- open_profile_store binds the profile scope inside the worker thread and
  resolves the store through the same scoped handle cache; the authority
  build awaits it via asyncio.to_thread.
- secondaries are prewarmed concurrently before the ordered build; a failed
  open is still reported (and the profile parked) by the build that follows.
- start_gateway pins the launch store from a worker thread around
  GatewayRunner() so the store's own open is a registry hit, then drops
  the extra reference.

Measured (11 profiles, 33 Desktop-style sessions, cron per profile,
loopback provider): state.db-open stall samples on the loop 11.68 s -> 0.20 s.
2026-10-27 12:35:50 -07:00
emozilla
49f75ab653 fix(gateway): the Webapp's control verbs answer "starting" from the control socket's first moment
A starting gateway answered its control socket for about 1.7 seconds before it registered the
Webapp's verbs, because the registration ran only after the Webapp's listener and dashboard mount
were up. In that window webapp-status got "unknown verb: 'webapp-status'". Web Access turned that into
"unavailable", and the pane's restart wait, which stops at the first answer that is not pending,
showed a Start that had worked as Unavailable with the protocol error and a Stop button.

The gateway now registers the Webapp's verbs before its control socket starts, and the runtime
reports the Webapp as "starting" until its listener settles on serving, off or unavailable. While
starting, webapp-status answers that state (the pane already keeps waiting on any state other than
serving or unavailable), and webapp-launch and webapp-sign-out refuse with "still starting": a
sign-out must not replace the stored credential while the starting listener may already hold it,
and hermes webapp --sign-out already waits for a starting gateway. hermes webapp --status says the
gateway is still starting instead of printing "Unavailable: None".
2026-10-25 03:22:38 -07:00
emozilla
21fd6dd020 fix(gateway): the Webapp names a browser credential file it cannot use, and replaces one that is not text
@teknium1's bde2a1bfe43 undoes a bind that fails partway, so a browser credential that cannot be read
or written leaves native clients main's private listener instead of stopping the gateway. On top of
it, the mount now reads or creates the credential before it changes any app state, so there is
nothing to undo when the file is the problem.

browser_session_token raises BrowserCredentialError naming the file and the cause (a stray file or
folder at its path, a folder another user owns, a full or read-only home), and that becomes the
reason hermes webapp --status prints, where the fallback used to say "could not listen on host:port"
though the port was fine. A token file that cannot be decoded (saved as UTF-16 by an editor) is
replaced like a malformed one instead of failing the mount. hermes webapp --sign-out with no gateway
running reports the same error instead of a traceback.
2026-10-25 03:22:38 -07:00
Teknium
c1be276af9 fix(gateway): keep native clients a listener when the Webapp credential cannot be kept
Greptile: "Credential errors stop the gateway". GatewayDashboardMount.ensure()
bound the dashboard app's state (gateway_runner, ui_surface, the swapped
_SESSION_TOKEN) outside the block that rolls back a failed mount. When
browser_session_token() could not read or write the Webapp's credential
(read-only home, full disk, a file where its folder belongs), cleanup left
gateway_runner set, so the fallback to main's private listener raised
"gateway API already started" and the whole gateway failed to start.

Binding now runs inside the same rollback as the lifespan startup, and the
Webapp's unavailable reason names the file instead of claiming a port
could not be listened on.
2026-10-25 03:22:36 -07:00
emozilla
a5acfe45f6 fix(webapp): say what is wrong with a webapp block instead of asking to enable it
With an invalid webapp.host, webapp.port or webapp.public_url, or an enabled value that is not a
boolean, the gateway kept the Webapp off as it should, but the reason only reached a log warning:
`hermes webapp` printed "Set webapp.enabled: true" even when it was already true, and the gateway's
status said off. `hermes webapp --status` against a gateway that predated a valid `enabled: true`
gave the same advice.

webapp_settings now returns the reason with its settings. The gateway reports such a block as
unavailable with that reason (so a launch is refused with it too), and `hermes webapp` and
`hermes webapp --status` print the block's own problem and how to retry. When the config already
turns a valid Webapp on but the running gateway started before that, the status asks for a restart.
"Set webapp.enabled: true" stays for a config that does not ask for the Webapp at all.
2026-10-25 03:22:23 -07:00
emozilla
82b7f06448 fix(gateway): replace the browser credential when the Webapp cannot hold its port
The Webapp's browser credential now survives gateway restarts, and open tabs keep sending it to
whatever answers on the Webapp's fixed port. When the gateway could not listen there (another local
process held the port, or the listener failed for another reason), it kept the credential as it
was: a process squatting on the port could collect it from an open tab and, once the real gateway
had the port back, use it there to open a host shell.

Whenever the Webapp's listener fails to start, the gateway now writes a new credential before it
falls back to its private listener, so a credential sent to another process opens nothing here.
Open tabs then have to sign in again (`hermes webapp`) once the Webapp is back, which is the point.
A Webapp that starts normally keeps the credential, so tabs still survive an ordinary restart.
2026-10-25 03:22:23 -07:00
emozilla
2a6febe314 fix(gateway): keep serving native clients when the Webapp's sign-in gate refuses
With webapp.host 0.0.0.0 and no sign-in provider, the dashboard's auth gate refuses the listener
by raising SystemExit, which the Webapp fallback did not catch, so the whole gateway exited. The
fallback takes that refusal like any other: it keeps main's private listener and reports the
gate's message. Cancellation still propagates.
2026-10-25 03:22:21 -07:00
emozilla
fff24cff13 feat(gateway): serve the Webapp from the gateway's own listener
With webapp.enabled set, the gateway binds its listener to webapp.host and
webapp.port (127.0.0.1:9120 by default) and serves the Desktop bundle next
to the session API the browser uses. The gateway keeps the browser
credential in its home, so open tabs stay signed in across a restart.
Private control-socket verbs report status, mint one-use launch links and
sign every tab out.

When the Webapp's listener cannot start, the gateway keeps main's private
listener for native clients and reports the reason. With the Webapp off,
the listener is exactly main's.
2026-10-25 03:22:16 -07:00
Teknium
835b0fa4d7 fix(gateway): the store-park reason reports the recorded open failure, never reopens
_store_open_failure reopened <home>/state.db through the registry to learn why it had no handle:
a real open that could create a missing store or run its migration, and skipped the handle
caches' backoff. RecoverableHandleCache now records the exception of the latest failed open
(last_error), and the park reason reads it from the runner's caches.
2026-10-20 03:08:06 -07:00
Teknium
adbc7cd0b5 fix(gateway): a profile parked for an unusable store names the open failure
`_build_profile_authority` read every missing store handle as "session authority database does
not belong to the reserved profile". The scoped handle cache returns None for a failed open (and
during its backoff), so a legacy store whose v32 backfill crashed on every open was parked under
an ownership reason that sent the operator after the wrong problem. A None handle now re-tries the
open once off the loop and parks with the real exception (`<home>/state.db did not open: ...`); the
ownership message stays for a handle that genuinely resolves elsewhere.

Fixes #141467
2026-10-20 03:08:06 -07:00
Teknium
f959be49c1 fix(gateway): a shutdown Stop before the managed worker spawns keeps its cause
stop_authority_turns recorded the restart/shutdown cause only on managed
workers it could signal. A turn whose worker was still being spawned (env
build or Popen in flight) had no worker yet: shutdown signalled nothing, so
the child was bootstrapped and ran on, and a cancelled spawn settled
interrupted with no cause, so no restart notice.

execute_managed now marks the generation as spawning until the worker is
registered. stop_authority_turns latches a Stop for a spawning generation
(adopt_agent delivers it, and the child is never bootstrapped). For a
gateway restart/shutdown it also latches the cause on the authority
(pending_stop_causes). The cause is consumed into worker.stop_cause when
the worker registers, or into the cancelled-spawn interrupted result. Only
a reasoned shutdown sets it: a user Stop latched first keeps none. The
drain drops the latch with pending_stops.

Refs #134889 (GW-22)
Refs #134889 only
2026-10-19 03:13:07 -07:00
Teknium
6c256e4f6c fix(gateway): managed-worker turns keep the restart notice the owner's stop caused
The notice follows the turn's recorded interrupt_message, but a managed
worker's wire result carries none and shutdown's stop frame names no reason,
so a managed turn interrupted by a gateway restart/shutdown settled without
the notice. The owner now records the cause on the worker object at the
moment shutdown signals it (stop_managed_turns / settle_gateway_runtime take
the runner's interrupt reason as a parameter) and fills interrupt_message
from it when the turn settles interrupted. A worker the user already
stopped is skipped by that signal and keeps no cause; profile retirement
passes none. The worker wire frame is unchanged.

Test: test_managed_worker_turn_settles_with_the_cause_of_the_stop_that_reached_it
(real child process, real SQLite authority, stop()'s interrupt path).

Refs #134889 (F1)
2026-10-18 20:52:16 -07:00
Teknium
1efb1175ed chore(gateway): keep run_shutdown.py and status.py inside their line caps
The round-2 fixes grew both files past their main values (code-health
FILE_LINES). interrupt_side_agents rides run_runtime's existing import
into run_shutdown, and the comments are shorter. No behaviour change.

Refs #134889 (GW-15)
Refs #140719
2026-10-18 03:28:42 -07:00
David Dudok de Wit
cac92d05ff fix(gateway): don't stall relay on a parked profile; retry its other ingress
A relay frame routed to a parked profile was refused runtime_draining with
its ACK withheld. The park lasts until a rescan or a restart, and the
connector drains its per-instance buffer in order, ack-gated, so one such
frame held back every later buffered frame for every profile on that
instance. A live frame has no redelivery, so it was lost silently.
Producer admission now raises ParkedProfileRefusal for a parked target.
Relay acknowledges the frame and tells the sender in-channel to resend, as
a direct bot does, also when the park kept the profile's retiring
authority (a turn outlived its Stop). Transient refusals still withhold
the ACK. The notice is marked interim, so it never seals another turn's
open stream in the same chat (relay Slack) or fills a pending answer slot
(LINE).

The rest of an unserved profile's ingress is now retryable too:
- a coalesced webhook that profile_routes sends to a parked profile is
  answered 503 before its delivery id is recorded, not 202 and dropped;
- a /p/<profile>/ webhook prefix with no serving authority in the live
  registry gets the same 503, whatever keeps it from being served;
- the API doors under a parked /p/<profile>/ answer 503 runtime_draining
  with Retry-After instead of 409 profile_mismatch, and shared-listener
  callbacks answer 503 instead of 404.

Once a hot-added profile's bots connect, queued native rows are bound in
every serving ledger, not only that profile's: a bot_profile route runs a
bot's messages on another profile.

Fixes #140564
Refs #134889

(cherry picked from commit a88ea4e2de26fbc6b09bdd826b7b7a8972ef6d43)
2026-10-18 03:24:12 -07:00
unsupportedpastels
ff3aec5ed2 fix(gateway): Desktop llm.oneshot borrows the chat's model on the shared gateway
The owner had no llm.oneshot handler, so the WebSocket fell back to the
legacy sidecar's. That handler lends the model of a session it finds in
its own table (_main_runtime_from_agent), and that table never holds an
owner session: every session-bound one-shot (Desktop commit messages,
review summaries, plugins) ran on the task backend's `auto` route, the
profile default, instead of the chat's model.

The owner now serves llm.oneshot. A session-bound call authorizes
session:read on that session and lends the resident agent's route
(snapshotted on the loop when the request arrives), else the session's
own frozen launch route, resolved in the worker with fallback=False: only
the primary route, so an AuthError fails the one-shot (5030) instead of
walking the route's fallback chain, a walk that would also set the
runner-wide fallback notice the next turn reports. A session-less call
keeps the task backend.

A named custom provider's route is lent as provider `custom` with its
resolved endpoint and key, and the aux client's anonymous custom arm
dropped the entry's extra_headers, so a provider that requires them
failed the one-shot while chat worked. That arm now adds the extra_headers
of the configured entry whose base URL matches the endpoint, the same
match the main agent's own client makes; the endpoint and key stay
pinned, and the headers only ever go to that entry's own endpoint.

The model call is answered by a detached task, as the sidecar ran it on
its long-handler pool: the connection's serial dispatch moves on, so a
slow commit message never holds up the next request on that socket. The
call runs on the owner's own one-shot pool (4 threads, 16 admitted calls;
the 17th is refused as oneshot_busy), never the loop's default executor,
which session resume, socket setup and disconnect cleanup share across
connections and profiles. The pool is its own FIFO rather than a
ThreadPoolExecutor, which keeps a cancelled queued call (params and
copied context) until a worker dequeues it: with every worker parked on
the model, a reconnect loop would retain payloads past the bound. The
thread runs in a copy of the handler's context, so the profile scope
holds. dispatch still checks the accepted params before deferring and
the result before the reply is written.

Lifecycle: a closed socket's queued calls leave the queue at once and
its replies are discarded; owner shutdown (whole runtime or one profile's
unserve) refuses new calls with runtime_draining and cancels the queue.
A call already running in its thread cannot be interrupted: it finishes,
keeps its slot until then, and its reply goes nowhere. Failures keep the
sidecar's 5030 "one-shot generation failed" answer.

Refs #134889 (RT-7)
Refs #140208
2026-10-17 13:31:15 -04:00
unsupportedpastels
8d9fe10f61 fix(gateway): retry a parked profile's ingress, never ack and drop it
When a secondary's startup Bot recovery fails, round 2 parks it and keeps
starting shared ingress. The parked profile then looked like an invalid
route:

- Relay: a frame routed to it was refused as `profile_mismatch`, which
  relay treats as permanent, so the frame was ACKed with nothing admitted.
- Coalesced webhook: answered 202 `coalesced`, lost on flush, and the
  provider's retry was answered `duplicate`.
- `deliver_only` / `cron_job` webhook: ran for the parked profile and
  recorded the delivery id.

Before round 2 a Bot-recovery failure aborted the start, so no ingress
connected.

A parked profile comes back on a rescan, so its traffic is now temporarily
unavailable (`profile_parked`):

- `producer_scope` refuses a delivery routed to a parked profile with the
  retryable `runtime_draining`. The relay ACK is withheld and the connector
  redelivers. A primary route's rejection now carries its target profile
  (`ProfileRouteRejected.profile`, stashed on the source as
  `_rejected_route_profile`) so the parked case can be told apart. A route
  to a profile this gateway does not serve stays `profile_mismatch`.
- A webhook to a parked `/p/<name>/` gets a retryable 503 with
  `Retry-After` right after authentication, before any delivery id is
  recorded or any route mode runs (`parked_profile_refusal`).
- A coalesced batch whose admission fails releases every delivery id it
  holds (the dispatched one and those it superseded), so a resend is
  processed, not answered as a duplicate.

Refs #134889 (GW-12)
Refs #140018
2026-10-17 13:16:34 -04:00
unsupportedpastels
617f9fe1c9 fix(gateway): a rescan after a park serves the profile fully
Round 2's park reason says a control-socket rescan serves a parked profile
again. The rescan (`serve_profile_runtime`) did not:

- The profile's LOCAL adapter stayed bound to the retired authority, so
  restoring or creating any local session raised `runtime_draining`.
- Hot-serve ran local, Bot and webhook-finalization recovery only. API
  turns and native rows queued before the park stayed queued.

Main's hot-serve failure branch had the same gaps; the startup park made
them reachable on every boot whose secondary Bot recovery fails.

The serve now drops a LOCAL adapter whose authority fully retired before
any recovery runs, and `restore_local_session` builds the new authority's
own. The retained-writer guard is unchanged: while the previous authority
is still retiring, the serve is refused (`ProfileOwnershipRetained`) before
this point. The serve also runs boot's API-turn pass
(`recover_authority_api_turns`, split out of `recover_api_turns`) on the
profile's store when the launch API adapter is already published; if it is
not, its later publication covers the profile as at boot.

Native rows need connected adapters, as at boot. Boot's per-authority step
is split out as `recover_profile_native_sessions`. The reconcile runs it for
a newly served profile once its adapters connected
(`recover_served_profile_native`). An error there is logged and leaves the
rows queued; it does not stop the reconcile of other profiles.

Refs #134889 (GW-12)
Refs #140018
2026-10-17 13:16:34 -04:00
unsupportedpastels
4dc234372b fix(gateway): say how a parked profile comes back; log what Bot recovery skipped
Three review follow-ups on startup Bot recovery:

- A profile parked at boot comes back only through a control-socket rescan
  (`hermes -p <name> gateway run` sends one). The parked reason now says so.
- A receipt the store cannot answer is logged with its file and the
  traceback, not just its delivery id and reason.
- A pending receipt whose session row is gone with no deletion marker still
  settles as `ambiguous` (never resent), but that is store damage or a marker
  an older release reclaimed, not a plain delete, so it is now logged. The
  receipt is final afterwards, so the warning appears once.

Refs #134889 (GW-12)
Refs #140018
2026-10-17 13:16:34 -04:00
unsupportedpastels
1caa071b38 fix(gateway): park a profile whose startup Bot recovery fails
start_gateway_runtime_api ran recover_bot_mailbox for every served
authority without catching anything, so a durable leftover one
secondary profile could not recover aborted the whole boot: under
multiplex every served profile went down with it, on every restart.
Hot-serve already parks such a profile; boot did not.

Each served secondary's startup recovery now runs on its own: on
failure its authority is retired, its reservation released and it is
named under parked_profiles (the same verdict boot gives a secondary
whose store cannot be opened), and the remaining profiles still start.
A launch-profile failure still aborts the start: its store is the
process's own. Per receipt, recover_bot_deliveries already logs and
skips a receipt the store cannot answer.

When retirement misses its deadline (a writer outlived Stop) the
profile keeps its gateway.lock and its retiring authority, so shutdown
still settles that writer, but it leaves _runtime_profile_homes: later
boot no longer connects its adapters, publishes it as served, ticks its
cron or recovers its spool. Native-session recovery, API-turn recovery
when the API adapter is published, and hosted-room service
creation/start now cover serving_authorities (all minus retiring);
shutdown keeps all_authorities. The startup auto-resume guard still
consults the retained store, but when that store cannot answer the
entry is held back (fail closed) instead of the read error stopping
the boot.

Refs #134889 (GW-12)
Refs #140208
Refs #140018
2026-10-17 13:16:34 -04:00
Teknium
0a53953c98 fix(gateway): an unusable bot mailbox dir pauses Bot Chat instead of aborting startup
An elevated install/update creates runtime/bot_live_delivery owned by
BUILTIN\Administrators with no ACE for the user. The same user's
non-elevated gateway then fails at os.open(.lock) right after the chmod
guard, and start_gateway_runtime_api aborted start_gateway.

_locked now raises MailboxUnusable (a PermissionError subclass, so
existing callers keep their handling) when the dir cannot be prepared or
locked, logging the dir, its owner and the remedy (icacls <dir> /reset)
once per dir and DEBUG after, for the receipt readers that re-enter it.
Startup recovery (start_gateway_runtime_api and hot serve) skips Bot Chat
recovery for that profile on MailboxUnusable; every other client keeps
working, any other failure still aborts.

The Windows ACL test now builds the reporters' shape (Administrators
owner, inheritance removed, only SYSTEM granted) and runs the startup
step in a privilege-dropped child that cannot open .lock. A Linux test
denies os.open on the lock path and is red on the previous head.

Fixes #139485, Fixes #138872

Review finding by @alt-glitch on #139839
2026-10-16 07:19:04 -07:00
Teknium
e1e6f30486 fix(gateway): let clients reach a restart-wait owner to answer a parked prompt
A graceful restart (Desktop's code-SHA restart, `hermes update --gateway`) waits for in-flight
turns, but a turn parked on approval/clarify can only finish when a human answers, and the
draining owner refused every client: identify dropped its capabilities, `gateway ensure`
returned a bare `draining` (exit 6), the WS boundary closed interactive tickets 1013 and every
submit raised `runtime_draining`. The wait therefore ran the full 1800 s cap.

The draining owner still owns the turn (#106742: one owner per session), so it stays reachable
during the restart's after-turn wait:

- request_restart publishes `drain_reason: restart_wait` and identify keeps the endpoint while it
  is set; drain_gateway_runtime (stop()) withdraws it, so the window closes before teardown.
- `gateway ensure` reports `draining`/`restart_wait` (still exit 6, never a fresh-start target)
  WITH the endpoint; Desktop's ensureLocalGateway and the Python client attach to it.
- The WS boundary admits interactive tickets while the window is open, so attach + respond()
  reach the parked prompt.
- New submits are committed queued (durable FIFO, next owner runs them exactly once); the claim
  path stays refused, so the draining owner never starts them.
- A turn nobody answers still ends interrupted at the cap and is never replayed (unchanged).

Refs #134889 (GW-6)
Refs #139574
2026-10-16 01:54:58 -07:00
Teknium
a40307a6cc fix(gateway-stop): settle within the leash left; keep state.db open for live authority work
Mechanism: _stop_impl drains, interrupts, then settle_gateway_runtime waited a
flat TURN_SETTLE_SECONDS (45 s) on authority tasks regardless of what the drain
and interrupt phases had already spent, so a stop could run past its watchdog
leash (os._exit, no clean teardown). After a missed settle, the SessionDB close
gate counted executor / cron / API / deferred workers but not the authority's
still-running turns and owner mutations, so it closed and checkpointed state.db
under a live writer (the #101093 sequence).

Fix: settle_gateway_runtime takes the leash budget the stop has left
(_effective_watchdog_leash - elapsed) and waits min(45 s, budget - 10 s tail
reserve); the close gate adds managed_turn_count (unmapped executing turns,
managed workers, owner mutations) to its live-writer count and skips the close
like every other live writer.

Test: tests/gateway/test_shutdown_settle_leash.py drives the real
GatewayRunner.stop with an authority turn that ignores Stop under a 12 s leash;
red on r12-base (stop overruns: TimeoutError at 10 s) and, with only the budget
half applied, red on the close gate (state.db closed under the live turn).

Review: dokterdok N59
(cherry picked from commit fb4e13dda5c1014129b541c164cf3247e63f7572)
2026-10-11 07:34:28 -07:00
Teknium
ceae2aa8d8 fix(gateway): a still-retiring profile leaves the published served set
When a hot-serve fails, or an unserve's turn outlives its Stop,
_retire_profile_authority returns False and the authority keeps its registry
slot (its writer may still touch the home) with retiring=True, so it refuses
every admission with runtime_draining. SessionAuthorities.served_profiles /
profile_ids iterated every slot unfiltered and nothing republished when
retiring was set: identify kept listing the profile, discovery said ready
(served wins over parked_profiles), the ticket store kept minting for it, and
every submit then answered runtime_draining.

served_profiles/profile_ids now list only serving authorities (no unbuilt
None slot, no retiring one), retirement republishes the served set the moment
it sets retiring, and the native-HTTP descriptor check compares against the
same filtered view (it would otherwise 401 every native request while a
sibling is retiring). Discovery of the parked profile then falls through to
its parked_profiles verdict.

Test: tests/gateway/test_parked_profile_served_set.py::test_still_retiring_profile_leaves_the_served_set

Review: dokterdok dokterdok-N38
(cherry picked from commit ab3e053d6e42ec89b89c01f26a02630639d96513)
2026-10-10 22:49:17 -07:00
Teknium
b7511e257b fix(gateway): the unknown-turn barrier resolves a reset tip to its admission owner
A local /reset keeps policy, FIFO and admissions on the conversation's
creation id and moves the store route to a physical reset child. Restart
recovery matched store entries to admissions with logical_owner, which walks
only the compression lineage, and _is_compression_child_row deliberately
excludes reset forks; the legacy auto-resume backstop matched
target_session_id against the physical id alone. After an ordinary /reset
followed by a crash mid-turn, the child's crash marker was promoted to
resume_pending instead of released, and _schedule_resume_pending_sessions
found no admission for the child and synthesized a resume turn while the
canonical admission was still unknown: a silent re-run.

One helper, session_authorities.admission_owner (logical_owner, then
hermes_state_local.local_lineage_owner), now feeds both
release_unknown_turn_markers and the auto-resume admission guard.

Tests: tests/gateway/test_reset_tip_unknown_barrier.py::test_crash_marker_on_a_reset_tip_is_released_for_its_unknown_admission
       tests/gateway/test_reset_tip_unknown_barrier.py::test_legacy_resume_skips_a_reset_tip_whose_admission_is_unknown

Review: andrexibiza andrexibiza-5480715949-P1
(cherry picked from commit c02fc82e095d7f8dcc7be125b771ca01339fddd6)
2026-10-10 22:49:17 -07:00
Teknium
86d4c2ef2f fix(gateway): a retired profile authority refuses cron mutations
session_cron.operation's cancel path deliberately skips the admission gate
(it stops already-admitted work) and reaches cancel_session_input, fenced
only by the store's runtime epoch. _retire_profile_authority set retiring,
joined the work, unbound the cron owner and returned True; nothing marked the
object retired. unserve then releases gateway.lock, and until the successor
reserves the home and runs begin_runtime_epoch, A's epoch is still current,
so a stale connection to A (a cached host-socket sibling, a ticker holding
it) could cancel a queued cron admission the next owner is about to run.

Retirement now sets authority.retired = True as its last step before
returning True, and session_cron.operation refuses every verb on a retired
authority with runtime_retired (fail closed; the row stays queued). The same
fence for the authority's own mutators (authorize) and the _sibling_for cache
is proposed in NOT_COVERED.md (authority lane files).

Test: tests/gateway/test_retired_authority_cron_fence.py::test_retired_authority_refuses_cron_cancel_before_successor_epoch

Review: andrexibiza andrexibiza-5479692359-P1.6
Review: andrexibiza andrexibiza-5480238075-4
(cherry picked from commit bee54c37e64faeb37bd32929e7cf253427960a24)
2026-10-10 22:49:17 -07:00
Teknium
81bdbe76a1 fix(gateway): settle every pending observer when a profile retires
_retire_profile_authority stops and joins the turns, cancels the idle drains
and receipt watchers, unbinds the cron owner and returns True, but never
touched authority.waiters or native_waiters. An observer whose drain had
paused with session_busy (API/webhook/Bot futures deliberately keep waiting
for a worker to finish) or whose drain was cancelled has no one left to
answer it: session_api_turn, session_bot._watch_reply, webhook and
api_server_bot_chat futures stayed pending forever after unserve.

After the join, retirement clears native_waiters and fails every pending
waiter with RuntimeStoreError('runtime_draining'). The durable rows stay
queued for the profile's next owner, so nothing is dropped or resent.

Test: tests/gateway/test_retire_settles_waiters.py::test_successful_retirement_fails_pending_waiters_and_keeps_rows_queued

Review: andrexibiza andrexibiza-11
Review: JoaoMarcos44 JoaoMarcos44-R8
Review: kshitijk4poor kshitijk4poor-P2-retire-waiters
Review: andrexibiza andrexibiza-5479692359-P2.7
(cherry picked from commit 20f9760ca19d1da549d6358bbdbef4d076308507)
2026-10-10 22:49:17 -07:00
Teknium
beea566de7 fix(gateway): a profile Stop reaches the agent its generation adopted
stop_authority_turns(in_process=True), the retire/shutdown path, still resolved
the turn's agent through the route's running slot. Between adopt_agent and the
slot's promotion that slot is the pending sentinel, so it latched a generation
adopt_agent had already consumed and interrupted nobody: the adopted agent ran
on through the profile stop. It now delivers to authority.adopted's agent when
the generation matches (8a5193a651f made adopted hold the agent), and falls
back to the running slot / latch otherwise, as the user Stop path does.

Test: test_retire_stop_between_adoption_and_promotion_reaches_the_adopted_agent
fails on the previous head and passes.

Review: andrexibiza 5479692359 P1.1 / JoaoMarcos44 R4 (stop-latch-promotion, retire path)
2026-10-10 22:25:42 -07:00
Teknium
2250bda4fb fix(gateway): a failed hot-serve whose writer outlives Stop parks the profile, never re-adopts it
When a serve-time recovery step failed and _retire_profile_authority missed its deadline (a turn
that serve started, or a hosted room still joining), the retiring authority stayed registered.
_serve_profile_runtime then called release_profile_home, which raises "Profile authority must
retire before ownership is released", aborting the whole _apply_profile_changes batch. The next
reconcile's serve_profile_runtime returned that same retiring authority as served, adapters
started, and every submit/claim/cron fire/bot delivery was refused runtime_draining until restart.

Now serve_profile_runtime finishes a retiring authority's retirement without waiting, or raises
ProfileOwnershipRetained; it never hands one back as served. _serve_profile_runtime parks a
profile whose failed attempt kept its authority, keeps the reservation and registry entry while
that writer lives, and returns a park reason so the batch goes on for every other profile.
_retire_profile_authority takes an optional timeout (default TURN_SETTLE_SECONDS, read at call
time).

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5475590057
2026-10-10 05:52:01 -07:00
Teknium
2b79f9a409 fix(gateway): retirement signals turns before the hosted-room stop and joins both in one deadline
_retire_profile_authority called hosted_room_service.stop(timeout=5) first and returned False
as soon as it failed, so join_authority_work - the only path that sends Stop or latches
pending_stops - never ran. The hosted runtime's stop deliberately does not interrupt accepted
turns and joins its room threads, which wait for the member turns they observe: a live member
turn therefore made the room stop fail, and that turn was never told to stop. The profile kept
its lock and store handles until process exit with nothing retrying.

Now every executing turn is signalled first, the room stop runs alongside join_authority_work,
and both share TURN_SETTLE_SECONDS. Retirement still reports False (ownership retained) when
either a turn or a room thread outlives the deadline.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5475590057
2026-10-10 05:52:01 -07:00
Teknium
81edebdb07 fix(gateway): a settled native reply keeps its crash marker until the delivery ledger owns it
On main the in-process turn hands its durable active-turn marker to the
adapter's delivery lifecycle, which clears it only after the final reply
is recorded in the delivery ledger (base.py send_final_ledgered ->
_release_turn_marker). A kill between "reply persisted" and "ledgered"
therefore leaves a marked turn, and the next unclean boot ledgers the
persisted reply (_ledger_crash_left_replies) and sends it once without
re-running inference.

Under the canonical FIFO the marker belongs to the drain's restored
event, not the adapter's event, so _handle_message's finally cleared it
as soon as the handler returned, before the drain committed the terminal
outcome and the waiting adapter sent the reply. An owner death in that
window left a terminal admission whose answer sat in state.db with no
marker, no ledger row and no process-local pending delivery: startup
excludes terminal inputs, so the reply was lost (real Telegram polling +
SIGKILL probe: terminal row, zero sends after restart).

execute_admission now marks the restored event as handed off and, once
the handler returns, moves its marker to the adapter event waiting in
admit_message (adopted and released by its ledgered send, exactly as on
main), keeps it with a recovered no-waiter reply until deliver_settled
returns, and otherwise releases it. A turn that dies before its terminal
commit recovers as unknown; startup now clears the marker of a session
whose admission is unknown before the crash-left-reply pass, so an
uncommitted answer is never delivered. Inference never re-runs: the
recovered reply comes from the transcript through the existing ledger.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6088835949
(cherry picked from commit 8e47cc1cc1734bedf58f451761caf801fb3195c9)
2026-10-09 17:31:26 -07:00
Teknium
3745e6a578 fix: a removed secondary's scope never resolves to the launch authority
SessionAuthorities.active() answered every scoped lookup with the launch
authority whenever the registry held exactly one entry. That cardinality test
conflated two different runtimes: a never-multiplexed single profile (where a
map of one answering every scope is the intended contract) and a multiplexing
runtime whose last secondary was just hot-unserved. In the second case a late
callback of the removed profile, still inside that profile's runtime scope,
resolved to the launch profile's ledger, contradicting the method's own
docstring ("a routed profile must never fall back to the launch profile's
ledger").

The registry now records whether the runtime multiplexes: set from
config.multiplex_profiles at boot, and latched whenever a non-launch home is
added (hot-serve). Only a registry that never multiplexed keeps the map-of-one
fallback; a multiplexed one returns None for a scoped home it does not serve,
regardless of how many slots remain. test_single_profile_runtime_is_a_map_of_one
is unchanged and still passes (non-multiplexed registry, unrelated scope ->
launch).

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:08:57 -07:00
Teknium
0a739dc8b7 fix(gateway): whole-runtime settle logs late writers and finishes shutdown
Follow-up to 6156b21c5e3f (#135061).

settle_gateway_runtime raised TimeoutError when an authority task missed
TURN_SETTLE_SECONDS (or join_authority_work(authority, 0) saw a live
abandoned thread). _stop_impl then skipped every later phase: adapter
disconnect, pending-message flush and _shutdown_event.set(), the DB close
gate and the exit state, and its finally set _watchdog_done, disarming the
hard-exit watchdog. On the signal/restart path wait_gateway_runtime then
waited forever. Probe (signal-style stop with one abandoned turn thread):
r5-picked "main loop HUNG >8s; phases []"; after "main loop returned;
phases [adapters, flush, close_dbs, exit_state]".

For a whole-process exit the raise buys no ownership: the executor quiesce
already skips the SessionDB close while a writer is live (#101093) and the
process exit releases the flock. Settle now logs the late work and
continues; the admissions stay for recovery. Profile retirement keeps the
F03 behaviour (ownership retained when a writer outlives the Stop).

Review: https://github.com/NousResearch/hermes-agent/pull/135061
2026-10-08 12:06:59 -07:00
David Dudok de Wit
e1cca25c99 fix(gateway): retain mutation ownership through publication and retirement
Shield mutations from request cancellation and hold admission/claim gates until commit and live publication finish. Recheck queued submits after deletion, fence replayed projections by generation, and join mutations before profile retirement.

Depends-on: "fix(worker): retain persistence and ownership through physical shutdown" (physical worker and drain ownership)

Additional cancellation, retirement, and submit/delete regressions identified during GPT-6 Astra review.

Validation: tests/gateway/test_local_authority_transitions.py, tests/gateway/test_adversarial_mutation_lifecycle.py, tests/gateway/test_submit_after_delete_gate.py, tests/gateway/test_rewind_receipt_projection.py

Implementation and additional regression probes were AI-assisted with GPT-6 Astra.

(cherry picked from commit 564ffcb9819bb63ee34e5720b0debd1b2fbd7d6e)
2026-10-08 09:10:27 -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
e28da35e4e fix(gateway): stopping a served profile stops and joins its turns before releasing it
_retire_profile_authority cancelled the session's drain task, but that only
abandons the await: the in-process turn's executor thread kept running.
Live probe (multiplexer, `unserve-profile` while a boot-profile turn was in
a model call): gateway.lock was released and a foreign process acquired it,
close_all_under closed the store, and then the old turn made another model
call, ran write_file and wrote three history rows (the store silently
reopened its handle); the admission stayed `started` forever.

Retirement now:
- marks the authority retiring, so its drain claims no successor
  (_require_admission_open refuses, like a draining runtime);
- sends every executing turn a cooperative Stop: the managed worker's Stop
  control, the in-process agent's hard interrupt (via _running_agents; the
  agent cache was already evicted), or the generation latch adopt_agent
  consumes when the agent does not exist yet;
- joins the executing turns' tasks within TURN_SETTLE_SECONDS (a task ends
  only after its thread returned and the admission settled), then cancels
  idle drains and receipt watchers;
- returns False when a turn missed the deadline, and _unserve_profile then
  keeps gateway.lock and the store handles instead of releasing them.

Same live probe after the fix: the turn settles terminal/interrupted before
the lock is released, no model call or tool runs after unserve.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4211047305
2026-10-07 23:44:54 -07:00
Teknium
c222074e85 fix(gateway): shutdown drains, stops and bounds managed-worker turns
Managed-worker turns run in child processes, outside _running_agents, so
_active_work_count()/_drain_work_counts() saw none: with a managed turn
running, _drain_active_agents reported no work and timed_out=False, no Stop
was ever sent, and settle_gateway_runtime() awaited the authority task with
an unbounded gather. A stalled worker bypassed the configured bounded drain.

- run_runtime.managed_turn_count counts live managed workers across every
  served authority; it rides the chat slot of the drain (chat deadline), the
  active-work total, the restart wait and the post-interrupt grace loop, and
  appears in the draining status as kind=managed. A worker registers before
  its reservation, and a draining owner refuses that reservation, so nothing
  unbootstrapped can start work behind the count.
- the timed-out path (_interrupt_running_agents) sends each managed worker
  the same Stop a user's Stop sends (stop_managed_turns); the worker
  acknowledges or is terminated within STOP_ACK_SECONDS and the admission
  settles through its own fenced path (interrupted, or durable unknown).
- settle_gateway_runtime keeps the #121813 authority-task settlement wait
  but sends Stop first and bounds it (TURN_SETTLE_SECONDS); a task past the
  bound is cancelled, which leaves its admission for recovery, never settled.

Donor test pattern: #103961 test_active_work_count_includes_kanban_workers /
test_restart_wait_excludes_wedged_kanban_workers_and_interrupts_them, adapted
to canonical managed workers with real subprocess children.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4211144039
2026-10-07 23:44:54 -07:00
Teknium
54327b2ad8 refactor(gateway): resolve session/runtime paths off the event loop
Clears the ASYNC240 code-health findings (PR #106742 ratchet) in
run_runtime, session_a2a, session_authority, session_cron,
session_group_controls, session_kanban and session_managed_worker:
each Path.resolve() inside an async def now runs via
`await asyncio.to_thread(...)` with identical values/exceptions.

New await points sit before any shared state is touched:
- initialize_session_authority resolves the db key before the epoch bump
  and authority registration, so bring-up stays yield-free.
- session_kanban.run_task resolves the owner db at the top so no await
  separates the saved-claim check, session creation and the claim's
  write transaction.
- session_cron.execute resolves inside its existing try (cancel event and
  _execution ContextVar unwind unchanged); the profile scope is entered
  after the await as before.

(cherry picked from commit ba404123a6d5d47ef05cbdea2e5a88e16d14ad7c)
2026-10-07 10:57:34 -07:00
Teknium
5b1d34f9c5 fix(acp): end idle ACP sessions when the last viewer detaches or the gateway stops
Restores main 9fb2dd4c39 (#118216) on the gateway path. ACP v0.9 has no
per-session destroy; the in-process adapter stamped ended_at when its stdio
transport closed. Under the gateway the ACP process is a viewer and nothing
wrote the stamp (the entry.py comment claimed the daemon's reset lifecycle
did), so source='acp' rows stayed open forever and prune/archive's
ended-session guard never selected them.

- SessionAuthority.detach: when the last subscriber leaves, an ACP-created
  local session (policy source 'acp') is ended 'acp_disconnect'.
- settle_gateway_runtime: at stop, every ACP session nobody is viewing.
- hermes_state_local.end_idle_local_session: idle check (no non-terminal
  admission/worker) and the stamp in ONE epoch-fenced owner write txn, so
  queued work keeps the row open. The drain's reopen_local_session already
  reopens an ended row on the next admitted turn (session/load + prompt).

(cherry picked from commit 84787b2245e85ac0d5f5703f4be559af976172cf)
2026-10-06 21:58:26 -07:00
Brian Fernstrom
d50b2eda3d fix(gateway): retire bot receipt tasks with authority 2026-10-06 11:58:02 -07:00
Brian Fernstrom
f4fd982b56 fix(gateway): recover mixed local queues and retire failed hot serves 2026-10-06 11:57:52 -07:00
teknium1
b36858fd9c fix(gateway): publish parked profiles so their clients fail fast with profile_parked
A secondary the multiplexer could not serve at boot (state.db is a directory, home owned by a
stray daemon) was parked in a private descriptor list only: identify and gateway_state.json
said nothing about it, so `hermes -p broken gateway ensure` waited the whole timeout for a
served_profiles entry that would never appear (rc 5 starting/deadline), `chat -q` sat 38 s on
"Gateway starting: deadline" and `gateway status` reported not running, with no hint that the
profile's store was the problem.

The park now goes through one seam (`run_runtime.park_profile` / `unpark_profile`) that keeps
`parked_profiles` as a name -> reason map in the runtime descriptor, publishes it in the
`identify` payload and writes it to the root's `gateway_state.json` (boot publishes its verdict
even when empty, clearing a previous run's). The hot-serve reconcile parks and unparks through
the same seam, carrying the real reason from `_serve_profile_runtime`. On the client,
`_served_by_multiplexer` maps a parked name to a terminal `inaccessible` /
`profile_parked` verdict (exit 7 via ensure_exit_code) with the reason in the new
`GatewayDiscovery.detail`, which `connect_gateway` appends to the error so `chat` and Desktop
name the cause immediately.
2026-09-16 16:35:34 -07:00
teknium1
eb7ff90043 fix(gateway): a secondary with an unusable state.db parks itself, not the boot
`initialize_gateway_runtime` built one authority per reserved home in a
single pass, so one secondary whose store could not be opened raised out of
boot and no profile was served (exit 1). Main parks such a profile at
runtime; boot now does the same: log `Profile '<name>' not served`, release
its reservation, leave it out of `served_profiles`, name it under
`parked_profiles`, and keep booting the rest. The launch profile's store is
still fatal — there is nothing to park it behind.

tests/gateway/test_multiplex_hot_serve_live.py boots a real
`hermes gateway run` multiplexer in a disposable root and proves the three
hot-serve invariants end to end: a profile created by `hermes profile create`
is listed by `identify`, a ticket bound to it opens a session the
multiplexer commits into that profile's state.db under its instance id,
`hermes -p fresh gateway ensure` resolves to the multiplexer (no stray
gateway.pid) and the restart reserves cleanly; a broken secondary parks only
itself.
2026-09-16 10:59:54 -07:00
teknium1
8cb6d0cea1 fix(gateway): the hot-serve reconcile grows and shrinks the profile reservation
`reconcile_served_profiles` diffed `_multiplex_profile_homes(config)`
against the served set, and since the reservation landed that function
returns the frozen boot snapshot, so the diff compared the snapshot to
itself and could never see a new profile. It now diffs the live
`profiles_to_serve()` against the served set.

A profile that appears is reserved (its gateway.lock taken, the boot set
extended) and gets its own session authority, ticket-store entry and
descriptor row — the steps `initialize_gateway_runtime` performs per
secondary — before its adapters start; a deleted profile's authority is
retired and its reservation released. Consequences the reservation used to
break: `hermes -p new` finds the multiplexer as owner instead of spawning a
per-profile daemon, and the next `gateway restart` reserves the set that
exists now (no OwnershipConflict against the stray daemon's lock).

`SessionAuthority.logical_owner` keeps a session id its store does not hold
(another served profile's) instead of raising on an empty lineage; startup
recovery iterates every profile's routing entries against every authority.

tests/gateway/test_multiplex_hot_serve.py boots its runner the way
`start_gateway` does — reserving the profile set and freezing it into
`config._runtime_profile_homes` — so it no longer passes vacuously; it is
red on the previous reconcile (`added == []`).
2026-09-16 10:59:53 -07:00
teknium1
9d552c1374 refactor(gateway): hoist webhook recovery import out of the authority loop
One late import above the per-authority loop instead of re-importing on
every iteration; the module-level binding is still resolved at call time
so the monkeypatch seam used by the hosted-mux test is unchanged.
2026-09-12 17:39:33 -07:00
unsupportedpastels
87763c4bc4 fix(webhook): recover finalization of settled admissions
Recover one-shot session finalization after settlement survives a lost process-local finalizer. Reuse exact terminal receipts during startup and authenticated duplicate handling, fencing the current writer epoch separately from the original settling epoch and validating current routes.

Do not admit, execute, or deliver work again. No schema or delivery-ledger redesign. Focused and adjacent recovery tests, including multiplex scope and stale-owner fencing, pass; independent review found no blockers.
2026-09-12 17:38:57 -07:00
teknium1
b5ab97cc5e fix(gateway): keep native FIFO identity stable across compression
Native admission identity followed the current physical routing session, so after compression moved the route to a child the drain's check_native_route (and startup recovery's binding) compared the parent-owned queue against the child ID and refused it with admission_conflict: the parent executed first then third, left second queued, and an exact first-event retry minted a new admission. The authority now registers/binds admissions to the logical owner (lineage root), preflights routes against the physical tip, and the turn runner publishes execution callbacks to that logical owner.

Findings: F6
2026-09-12 10:41:48 -07:00
David Dudok de Wit
1e604c3576 fix(gateway): keep hosted profile work on its ready canonical owner
Group Chats targeting served profiles now use the correct coordinator, logical profile and private control endpoint. Prepare all hosted transports before releasing coordinators at runtime readiness so queued work is not failed during ordinary startup. Preserve exact owner/profile checks and the existing canonical executor.

Source-Commits: 4a13910927bdf00649d3f1e1c6c3165d7b739d31, 4aaddec3891162e73400821718ccd933c8a3a288 (same author, consolidated before publication).

Validation: exact changed-file blobs match independently reviewed 4aaddec;16 focused tests pass on current108594 base1a2dc3ac with retries disabled. No full release or native Windows acceptance claim.
2026-09-12 10:46:00 +02:00