6 Commits
Author SHA1 Message Date
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 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 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 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 c6540cb9dd feat: persist assigned worker prompt context and usage anchors 2026-09-08 17:03:13 -07:00