Host tools — messages between threads and their delivery, the command center's manager tools, a thread's last activity, host wakes. A repository rule for apps/daemon/src/v1/command-center/**, apps/daemon/src/v1/agents/**/thread-inbox*, apps/daemon/src/v1/agents/**/command-center*.broker*, apps/daemon/src/v1/agents/**/host-wake*, apps/daemon/src/v1/agents/**/host-thread-message*, apps/daemon/src/v1/agents/**/host-command-center*, apps/daemon/src/v1/agents/**/thread-message-text*, apps/daemon/s...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rule Daemon Host Tools Threads?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geniro-io-rule-daemon-host-tools-threads)
---
name: rule-daemon-host-tools-threads
description: "Host tools — messages between threads and their delivery, the command center's manager tools, a thread's last activity, host wakes. A repository rule for apps/daemon/src/v1/command-center/**, apps/daemon/src/v1/agents/**/thread-inbox*, apps/daemon/src/v1/agents/**/command-center*.broker*, apps/daemon/src/v1/agents/**/host-wake*, apps/daemon/src/v1/agents/**/host-thread-message*, apps/daemon/src/v1/agents/**/host-command-center*, apps/daemon/src/v1/agents/**/thread-message-text*, apps/daemon/src/v1/agents/**/thread-list-cursor*, apps/daemon/src/v1/agents/**/run-activity*, apps/daemon/src/v1/teams/services/*-delivery*, apps/daemon/src/v1/mcp/tools/list-threads/**, apps/daemon/src/v1/mcp/tools/message-thread/**, apps/daemon/src/v1/mcp/tools/tell-threads/**, apps/daemon/src/v1/mcp/tools/note-thread/**, apps/daemon/src/v1/mcp/tools/start-thread/**, apps/daemon/src/v1/mcp/tools/read-command-center/**, apps/daemon/src/v1/mcp/tools/restore-threads/**, apps/daemon/src/v1/mcp/tools/search-chats/**, apps/daemon/src/v1/mcp/tools/thread-tools-offer*; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/daemon-host-tools-threads.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->
# Host tools — thread messages, the command center and host wakes
- Thread messages (`list_threads`, `message_thread`): `ThreadInboxService` (`v1/agents`) writes the row first, in `thread_messages`, under per-target limits; `ThreadDeliveryService` (`v1/teams`, it needs both the chat service and the executor) routes it to one of three outcomes. **Joined**: a running turn on a CLI whose `followUp` neither is unavailable nor interrupts takes it through `sendMessage` `joinOnly` or `joinThreadMessage`, flipped `delivered` before the write so a `follow_up_dropped` finds it; a dropped one goes back to waiting under one info row, never a "not sent" row. A turn parked on the lead's or the chat's own question takes nothing, because it reads nothing until the user answers: the row waits with reason `question`, where Remove reaches it. Past `THREAD_JOINS_PER_HOUR` per target, counted from the rows (`status: delivered` with a `deliveryId`, which only a join stamps), a message that could join waits with reason `wake_limit` and wakes nobody, so two threads answering each other while the other's turn is alive run out. **Woken**: past stopped, failed, not started, a question card, cold-and-large and `THREAD_WAKES_PER_HOUR` (a sender has no way to leave an idle thread asleep: `message_thread` takes no `wake`, and the row's `wake` column is written true and read by nothing), a wake opens a turn on the fixed `THREAD_WAKE_PROMPT`, and that turn's drain carries the text: a wake never carries a message, so a message has one path into a prompt whichever way its turn opened. A chat's wake is a `HostWake` with `note: null` and a `stale` check, so it leaves memory unsettled and the row keeps the debt; a team goes through `wakeLeadForThreadMessage`, which walks a run again only when it `completed`. **Waiting**: the row carries its reason and the next turn drains it, at most `THREAD_MESSAGES_TURN_MAX_CHARS` a turn. The user's **Deliver now** (`POST /v1/threads/:runId/waiting-messages/:messageId/deliver`, `ThreadDeliveryService.deliverNow`) routes the row again with `pressed`, which passes the join budget, cold-and-large and `THREAD_WAKES_PER_HOUR` (they hold back agents, not the user) but not stopped, failed, not started or a question card; it answers the outcome and reason. Owed rows (reason null, `running_turn`, `question` or `sender_opted_out` — the last only on rows stored while a sender could still hold a message back; the reason stays in the wire enum and both word tables so those rows read) are released on `bus.allStatuses()`, not on a settled turn, because a thread working off-turn settles none, on the lead's `onConversationTurnEnded`, and once at boot. Agent text, and the sender's title and member name, reach a prompt only through `threadMessagesPrompt`'s fence, never `<geniro-note>`; a not-delivered note names the thread by id for the same reason. The approval is the sender's ordinary card, so neither tool may join `autoApproves` or the team memory arm, and nothing reads the receiver's mode. `tools/call` skips `isOffered`, so the tools also refuse from the sender's run row. `claude` turns withhold `ListAgents` and set `crossSessionInbound: refuse` (`claudeSettingsArgs`), and keep `SendMessage`.
- The command center's manager (`v1/command-center`, `Run.commandCenter`, hidden from the sidebar and `list_threads` like a project chat but still a messageable thread, so replies reach it) reaches threads through its own tools only, each offered while `CommandCenterBroker` holds its turn and refused from any other run by the row: `tell_threads` (1–12 roster threads per call, optionally setting their `watch`, resolved by handle, id or exact title — a name two titles share, exactly or as a part of each, is ambiguous — and nothing sent while any name is ambiguous or unknown — `AMBIGUOUS_TARGET`, `THREAD_NOT_FOUND`, `NOT_MANAGED` with candidates; each send is an ordinary `ThreadDeliveryService.send` with the manager as sender), `note_thread` (its note per roster thread), `archive_threads` (1–12 roster threads, resolved like `tell_threads` and nothing archived while any name is unresolved; each through `ChatService.archive`, the sidebar's own archive, never a delete; an already archived thread is reported `already_archived` without failing the rest, including one that has left the roster, named by its old handle, id or title; the manager's own run is refused `OWN_RUN`; an archived thread leaves the roster at once), `restore_threads` (its way back, 1–12 archived threads: each through `ChatService.unarchive`, the sidebar's own unarchive; resolved among archived threads first — one that left the roster, by its old handle, id or title, and any other archived chat or team run, by id or title, never a builder, project, analysis or manager chat — and only a name matching no archived thread is tried on the live roster, where a match is reported `not_archived` and changed in nothing; nothing is restored while any name is ambiguous or unknown, `AMBIGUOUS_TARGET` / `THREAD_NOT_FOUND` with candidates and their ids, since archived titles repeat; a restored thread rejoins the roster at once, under its old handle when it had one, reason `manager`; it starts no turn and sends nothing, and its answer says what archiving ended that unarchiving does not start again), `read_command_center` (read-only: every board thread with its handle, column, status, what it awaits, its pull request, board card, last activity and note, finished threads last, behind a data preface; the card's activity line is not returned) and `start_thread` (by default no board card — user decision: a card only when the user asks for one in their own words, `card: true` — a row in `command_center_thread_starts` (`CommandCenterThreadStartDao`, deleted with its manager) that Electron main's `ThreadStartConductor` starts in the project's folder with no worktree through the desktop-only `POST /v1/command-center/starts/:startId/runs` (`TaskRunsService.startProjectRun`, which reads the folder off the project, never the body; the same run creation a card start uses), its Start card reading `GET /v1/command-center/starts/:startId` and re-read on `command_center_changed` reason `start`; with `card: true`, a backlog card plus a start request on the task row; either way a deferred Start card raised through `ChatService.raiseOwnedCard` and re-tracked at boot from its row, or approved at once in `auto`; the conductor starts approved requests with `startedBy: 'manager'` and no approval of its own, and the manager is woken only when one failed (the desktop-only `POST …/starts/:startId/failed`, a card's or a cardless id) — a start puts the thread on the roster and writes no row of its own, since its card already says it started (user decision)). `list_threads` and `message_thread` are withheld from it (`isAppOwnChat` reads the sink; `senderTarget` refuses the row). `tell_threads`, `note_thread`, `start_thread` and `read_command_center` are auto-approved in the manager's chat only (`isHostCommandCenterCall`, user decision), so a manager start asks the user once, on its Start card; `archive_threads` and `restore_threads` are not — they follow the manager chat's approval mode — and `message_thread` keeps its card everywhere. A manager send with `expect_reply` carries `replyCreditUntil` (2 h): the receiver's first reply spends every live credit it holds and routes past the join and wake budgets once, never past `cold_and_large`; a spent credit is announced on the bus (`publishReplyCreditSpent`) so the replying thread's card stops awaiting at once. The board's active set is every thread not archived, finished ones included (they stay, in the Done band, until archived — user decision), and the roster (`command_center_roster`, handles never reused) is synced to it before each manager turn — additions and removals at once, since only an archive or a delete takes a thread off — and written as the manager's `teamInstructions`, opening with the dispatcher rule (user decision: the manager never does work itself, every piece of work goes to a thread, and the rule leads the brief), byte-identical while it does not change, closed by the user's standing instructions for the manager (`Settings.commandCenterInstructions`, pushed by Electron main to the desktop-only `PUT /v1/command-center/instructions` and held in memory by `CommandCenterChatService`) when there are any; the per-turn status table rides the prompt instead. A finished thread is marked `done` and listed last in the status table (before its 40-line cut) and in `read_command_center`, never in the brief (user decision: a finish must not rewrite the brief, which only the roster's membership changes), and a name matching an unfinished and a finished title resolves among the unfinished ones only (`resolveTarget`). An archive or unarchive made anywhere reaches the board through `AgentEventBus.allChanged()` (reason `refiled`): an idle thread's archive emits no status, and a running one's cancel can announce its status before `archivedAt` is written. A delete reaches it through `AgentEventBus.allDeleted()` (reason `deleted`), so every client's board drops the card at once. What the manager hears about its roster is `CommandCenterNotifyService`, driven by `CommandCenterEventBus.allChanges()`: a thread's change of column never wakes it; a move INTO `done` (`boardColumnOf`, where a monitor out keeps a thread `working` — user decision, so a thread with monitors is never done — and so does a detached command started after the finish, `RunWire.newestShellOpenedAt` later than `ThreadOutcome.at`, while one started before it, or a finish with no known time, leaves the thread done) is announced once per finish (user decision): the roster row's `announcedFinish` holds the finish last told, the board's own `finishKey` (`finishKeyHash`, below: one identity for the Done news, the Needs you gallery and both Dismisses), and a move into done with that same finish writes and wakes nothing — a recorded outcome the thread settles again without recording a new one; a finish no recorded outcome names (none, or one its goals derive) carries the time it finished, so a thread that works again and finishes again is a new finish even with its goals unchanged. A row written before that holds `finishKeyOf` instead: at a first reading it counts as the finish already told and is rewritten to the key with no row and no wake, and later only for a recorded outcome (`announcedInOldForm`). A new finish writes one Done host row (`threadDone`, `woke: false`, `RunNoticeWriter.info`), its summary the thread's report (`threadReportOf`: the recorded outcome, else the newest message its own agent wrote in the run's own flow, `ItemDao.latestAgentMessageTextPerRun` — never the user's, a callee's or a delegate's — capped at `THREAD_REPORT_MAX_CHARS`; the board serves the same as `CommandCenterCard.report` for a card in `done`); the chat draws only the newest Done row of each thread (user decision: one card per thread). It wakes the manager only when the roster row is `watch`ed (`command-center:done:<runId>`, a plain row with no `threadDone`, the Done row being written either way; its prompt quoting the thread's recorded outcome as data — user decision: a finish costs no manager turn unless the user asked to be told). A row the writer could not write (`RunNoticeWriter.info` answers false) records no finish, and the thread is read again as at a first reading. `watch` (default off) is set by `start_thread`'s `watch` (kept on the task as `startRequestWatch` until the start is reported, cleared with the request) and by `tell_threads`' `watch` (true or false for every target it reached; omitted leaves it), and lasts one finish: the wake it asked for clears it in the same write that records the finish (user decision); a new ask arms it again through those same flags. Every `tell_threads` send clears `announcedFinish` for the threads it reached, so the finish of the work it asked for is news even when it matches the last one. A thread's first reading after a boot records its column and, when it is done, its finish without a wake (`firstReadingOf`) — writing its Done row only when the chat holds none for that thread, so one that reached done while the daemon was down is shown — except a watched thread that finished after its finish became news — the row's `finishNewsSince`: its joining, then each `tell_threads` send — and so finished while the daemon was down: that finish wakes the manager once, like a live one (user decision); a row whose thread has not run since a `tell_threads` send keeps waiting for that work's finish, and a row written before finishes were recorded (`finishNewsSince` null) is recorded without a wake, so an upgrade never repeats a finish the app before it told. What the chat was already told is read from its own `system` rows (`ManagerAnnouncementsService` over `announcedIn`: `threadDone` run ids and `waitingItems` ids, both writers' rows), once per manager, and added to before each row is written. `CommandCenterWaitingService` announces what waits for the user's review — memory entries `pending`, lesson proposals `proposed` / `check_failed`, knowledge revisions `pending` — once per item (`waitingItems`, `WaitingItemsRow`), reviewed per kind at boot and on that kind's change bus, one summary row when more than `WAITING_ITEMS_SUMMARY_OVER` new items of a kind are found at once; never retired, never woken. They are host rows, not owned cards, because a standing owned card keeps the manager run `awaiting` (`awaitingOf`) for as long as the item waits. Every open registry entry of a roster thread is relayed into the manager chat (a board thread with an open entry that the roster has not caught up with yet is put on it first, `CommandCenterChatService.syncRoster`, so its question is not left unrelayed until the manager's next turn) as an owned card (`thread_question`, `ThreadQuestionCardInput`, `raiseOwnedCard`) whose responder answers the THREAD's entry through `ApprovalRegistry.resolve` — the WS verdict's own path — and records the verdict with `recordOwnedCardVerdict` (outcome `delivered` / `not-delivered`), never waking the manager. A relay whose thread entry closed elsewhere, or whose thread left the roster, is retired (`retireOwnedCard`); at boot (after `main.ts` rehydrates the standing questions) a relay whose roster thread still holds its entry is re-tracked on the same card (`trackOwnedCard`), so a restart never draws a second card for one question, every other one still open is retired, and the roster is read afresh.
- What waits on the user in Settings reaches the manager chat as notices (`CommandCenterNoticesService`, `command_center_notices`, deleted with its manager): one per key — `agent-updates:<cli>`, `agent-sign-in:<cli>:<config dir>`, `share-sign-in:<destination id>`, `memory-conflicts` (a reported item's key is `readingsByKey`'s, twin of the card's) — open from its first reading until a reading of its kind no longer holds it, at most one open per key. Opening one writes a `settingsNotice` host row with `woke: false` (`RunNoticeWriter.info`, written before the notice itself, so a notice whose row could not be written is never opened and the next reading tries again). An open notice holds what its key holds now (a version, `<cli>@<version>`, `<cli>:<config dir>`, a share id, a finding id), moved in place as its readings change, and a `share-sign-in` notice also the place's name (`label`: the destination's sign-in label, else its name — never a link or key), so a paired device, which reads no shares, draws its card from the notice alone; once dismissed it keeps what it showed, and an item it never showed resolves it and opens a new notice and row (`utils/notice-plan.ts`). Shares waiting on a sign-in (`ShareService.list`, `ShareEventBus`) and memory findings (`MemoryFindingsService.open`, `MemoryEventBus`) are read here, at bootstrap, on their change and on the board's `roster` change; the agent CLIs live in Electron main, so the desktop window reports them through the desktop-only `PUT /v1/command-center/notices/readings` (from `App`, whenever that reading changes and after a reconnect, the manager chat open or not — `useNoticeReadingsReport`), a kind listed with no items closing its notice, a kind left out untouched and an item reported `unsettled` (an answer not known right now: a CLI's update check under way or failed, an account not asked) leaving its key's notice as it is, so neither a check nor a restart closes a notice and opens it again; the last report is kept in memory and applied again on a `roster` change, so a manager started after it gets its rows. An `app-update` notice an earlier build wrote stays open and draws nothing; `noticeUnresolved` leaves it out of the chat button's count. Every change of one manager, its reading included, runs in order (`KeyedChain`) and is announced as `command_center_changed` reason `notices`; `POST /v1/command-center/notices/:noticeId/dismiss` is open to paired devices. The same service keeps how far the user dismissed each thread's finish (`command_center_done_dismissals`, one row per manager and thread with the newest dismissed row's `throughSeq`, only ever moving forward, and the board's `finishKey` of the finish dismissed, deleted with its manager — so it survives an archive and an unarchive, user decision): `POST /v1/command-center/done/:runId/dismiss`, open to paired devices, answered with the whole list, and `GET /v1/command-center/notices` carries them as `doneDismissals`. With the Done row's `seq` (the manager chat's card) it is refused `DONE_ROW_NOT_FOUND` unless that row of the manager announces that thread; with none (the Needs you gallery) it dismisses every Done row of the thread written so far, through the chat's newest seq, and is refused `THREAD_NOT_DONE` unless the thread is finished on the board. A board card's `finishKey` is `finishKeyHash` (`utils/finish-key.ts`): the hash of `finishKeyOf` plus `attentionAt` when no recorded outcome names the finish (none, or one its goals derive — `finishCarriesAttention`), so a thread that runs and finishes again is a new finish while a later row is not; it is also what `announcedFinish` holds. The gallery leaves out a finished card while its thread's dismissal names that same key, or was made at or after the thread's `attentionAt` (a dismissal's `dismissedAt` rides `GET /v1/command-center/notices`), so a key recorded under an earlier reading of the same finish still hides it.
- A thread's last activity is the creation time of its newest transcript row, read only through `utils/run-activity.ts` (`newestItemAt`): `RunWire.lastActivityAt` (`ItemDao.latestItemAtPerRun`), the list routes' `activeSince` / `activeUntil` window (`RunDao.listPage`), `list_threads` (`RunDao.listThreads`: the window, `includeArchived`, `project` and its `page` / `nextPage`, ordered own project first, then by last activity, then id) and `search_chats`. The window's start is inclusive and its end exclusive (`windowBounds`); a run with no rows falls in no window. Never date a thread by `Run.updatedAt`, which bookkeeping writes have moved.
- Host wakes (`services/host-wake.bus.ts`): something geniro did for an agent outside its turn (a share that waited on the user's sign-in, a message from another thread) wakes it like a monitor's output, but on its own deliveries — `HostWakeChatDelivery` (held while a turn runs or a card waits, sent after listen, `RUN_BUSY` holds it again, other failures retried 3 × 30 s, then a run-level warning row says why) and `HostWakeGraphDelivery` (`wakeConversation` with opener `host`: its settle is news, announced without `hostTurn`, never counted toward `MAX_MONITOR_WAKES`, and a callee conversation is refused — only a monitor reopens a held call). What cannot be delivered (archived chat, the user's Stop — also one pressed while the wake was being sent — a refused wake, a run no pass has driven since the daemon started) becomes `oweKeyNote` for the conversation's next turn — the one pass-less exception is the restart continuation, which starts its own pass (`RestartContinuationService`, Teams and passes) —, which settles the wake (a note refused because the daemon is shutting down settles nothing, so the next boot sends it again). A wake whose `withdrawn()` answers true is dropped unsent at every attempt (a share link once agents may not share). A wake with `note: null` leaves memory unsettled when it cannot go, because a durable row holds the debt, and `stale()`, which `HostWakeChatDelivery` alone asks, drops it right before a turn would start. The opening row is a `HostRowWire` (`monitors`, `shares` or `threadWake`), whose prompt alone carries a share's link.