Skip to content

core: a retired Bot is still addressable by every team tool (message_bot wakes it) #1700

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 08b8f51ceaa7403d885fcf06118cbe65
Branch: dev/1-retired-unreachable
Base: d534703
At: 2026-10-29T14:03:07Z

What happens

archive_bot retires a Bot: it leaves the tree and the default Bot list, and its chats stay readable. But every team tool can still address it, because the lookup used by the tools does not know about retirement:

  • core/src/host/tools.js:212-215: const teamBot = bot => bot !== undefined && bot.remote === undefined && bot.ephemeral === undefined and const findTeamBot = name => { const bot = rt.findBot(name); return teamBot(bot) ? bot : undefined } — no retiredBot check, although retiredBot is defined two lines above (:212) and is used by the list filter (:148-149) and by teamNames (:442).
  • Every tool that takes a Bot name resolves through findTeamBot: message_bot, stop_bot, update_bot, create_group/update_group members, group_relay, archive_bot itself.

So after archive_bot X, a Main Bot can still message_bot to X; the delivery wakes X and it answers — a Bot the owner just retired comes back and speaks.

Reproduction

  1. Main Bot: archive_bot on a child Bot X (the tool answers Archived X. It is out of the tree and the default Bot list…).
  2. list_bots no longer shows X; X's chat is still readable from the sidebar (Main Bot can create and change Bots but has no tool to remove or retire one #638).
  3. message_bot { to: 'X', message: 'are you there?' } → delivered, X starts a turn and replies. stop_bot, update_bot and update_group with X as a member behave the same way (they find X).

Expected instead: a retired Bot is not addressable by any team tool — the same rule the code already applies to a run Bot (:210 comment: "A run Bot keeps its name (findBot still sees it) but no team tool can address it (#1373)"). message_bot should answer with the no-such-Bot line (or a named refusal) and send nothing.

Scope

  • core/src/host/tools.js: make findTeamBot exclude a retired Bot (teamBot(bot) && !retiredBot(bot)), so every team tool inherits the rule from the one lookup that already exists. Do not invent a second lookup.
  • archive_bot's own message stays as is for a live Bot; targeting an already-retired name then falls into the same "No Bot named …" refusal — acceptable and consistent with retirement being terminal (P-157).
  • list_bots / the default team list and the sidebar chat stay as they are (Main Bot can create and change Bots but has no tool to remove or retire one #638: a retired Bot's chat is still readable).
  • Docs: one line in docs/subsystems/core-host.md (or tree.md) saying a retired Bot is unreachable by team tools; a changelog.d/ fragment.
  • patches/ds-bot/**: tools.js is a mirrored file, so regenerate the patch with the generator (never hand-edit) and keep ds-bot-patches check green.
  • Not this issue: a retired Bot that is already a member of a group and is reached through a room relay; and "archived is irreversible" (P-157). If rooms turn out to relay into a retired member's chat, that is a follow-up, not this fix.

Acceptance

  1. After archive_bot X, message_bot { to: 'X' } refuses (no delivery, no turn started), and the refusal is one line the model can act on.
  2. The same holds for stop_bot, update_bot and update_group/create_group naming X as a member.
  3. A live Bot is unaffected: message_bot/stop_bot/update_bot keep working, and archive_bot still archives a live Bot.
  4. A retired Bot's own chat stays readable from the sidebar, and list_bots still omits it.
  5. Tests: one case archives a Bot and asserts the four tools refuse it, and one asserts a live Bot still answers; red first on the pre-fix source.
  6. TZ=UTC ARCH_DOCS_BASE=<base> npm run verify exit 0 (system default TMPDIR), node scripts/ds-bot-patches.mjs check both lines green.

Evidence

  • core/src/host/tools.js:148-149 (retired Bot leaves the default list), :210 (run-Bot rule and its comment), :212 (retiredBot), :213-215 (teamBot/findTeamBot without the retired check), :442 (teamNames filters retired, showing the intent).
  • :392-410 archive_bot itself resolves through the same findTeamBot.
  • Reporter: FlyBot Product (P-156), source-confirmed by the Lead at live main 38088812.

Activity

  1. HugoXK commented on Oct 29, 2026

    @HugoXK
    ContributorAuthor

    Release

    Written-by: FlyBot Lead
    Released: 08b8f51ceaa7403d885fcf06118cbe65
    Reason: merged as 2213b4c (#1707)
    At: 2026-10-29T15:29:24Z

  2. added 2 commits that reference this issue on Oct 29, 2026
    2213b4c
    cdcf7cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions