Skip to content

list_bots marks a Bot whose send waits on the owner (takeover of #646) - #752

Closed
Birfy wants to merge 1 commit into
mainfrom
fix/587-list-bots-approved-tag
Closed

Birfy wants to merge 1 commit into
mainfrom
fix/587-list-bots-approved-tag

Conversation

@Birfy

@Birfy Birfy commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Reproduce

At main d5fefe01, a Bot whose outbound message is held for the owner's approval is indistinguishable from an idle one: core/src/host/tools.js builds list_bots tags from role / model / workDir / Main Bot / you, and state.flybot.approvals (where the pending holds live) is never read. So list_bots answers - Writer (Write) for a Bot that is actually blocked waiting on the owner — the case #587 describes, and the one a coordinator needs to see.

Takeover

This is the rebased successor of #646 (author rahul05ranjan, fork rahul05ranjan/FlyBot, head 0f9b144f). That branch cannot be merged any more: its base is fe79de66, main is far past it, GitHub reports dirty, and the author's last push has no check run at all, so the queue cannot evaluate it. The fork is read-only for us (permissions.push: false), so the fix is carried over here instead of asking the author to resolve conflicts; if they push their own rebase first, that supersedes this one.

What is not copied verbatim, and why: #646's branch predates several main changes, so its copies of tools.js, flybot.test.js and both docs files would have reverted them (create_bot's "starts no turn until the user writes to it" wording from #645/#699, the #712 bot.created announcements and the emptyTeam harness helper, and large parts of core-host.md/plugin-runtime.md). Only the author's own change is carried over, re-applied to current main:

  • core/src/host/tools.js: the heldSends count built from state.flybot.approvals (pending entries with a string request.from) and the ${count} to approve tag placed after the model tag — the author's code, unchanged.
  • core/test/flybot.test.js: the author's #587 case, unchanged, placed next to the existing hold test.
  • docs/subsystems/core-host.md: the author's list_bots bullet, added after the approvals paragraph.
  • docs/subsystems/plugin-runtime.md: the author's one-sentence addition in item 6 (held sends visible to coordination).
  • changelog.d/587-list-bots-approval-tag.fixed.md: the author's fragment.
  • patches/ds-bot/0002-flybot-api-host.patch and files/test/flybot.test.js: regenerated with node scripts/ds-bot-patches.mjs generate; check exits 0.

Commit carries the author's intent and Co-authored-by: rahul05ranjan.

What changed

list_bots now appends N to approve to a Bot's tags while that Bot has N pending held sends, so a coordinator sees - Writer (Write, 1 to approve). It is a count only: no held text, no state of its own, and the tag disappears as soon as the owner decides. Nothing else changes — the tag order is role, model, approval count, workDir, Main Bot, you.

What I ran

At the tip 8fd25e65, on this box (Node 22.23.3, DSH_HARNESS=/opt/flybot):

$ node --import ./test/harness-resolve.mjs --test test/flybot.test.js
# tests 42  # pass 42  # fail 0        (41 before this change + the #587 case)

$ node --import ./test/harness-resolve.mjs --test --test-concurrency=4 "test/*.test.js"
# tests 1239  # pass 1236  # fail 3

$ node --import ./test/harness-resolve.mjs --test --test-concurrency=4 "test/*.test.js"   # pristine main d5fefe01, same harness
# tests 1238  # pass 1235  # fail 3

The three failures are identical on both runs — empty diff passes, test/composer-label.test.js, test/read-page.test.js — so this change adds one test and one pass and changes no existing outcome. (empty diff passes needs a git worktree this container does not provide; the other two are the documented environment-limited files.)

$ node scripts/ds-bot-patches.mjs check
ok   ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)
ok   10 patches apply cleanly in order
ok   core/ equals ds-bot/ + patches/ds-bot/

$ node scripts/check-arch-docs.mjs
arch-docs: OK (7 changed file(s))

$ node scripts/lint.mjs
Found 44 warnings and 0 errors.

Red without the source change

core/src/host/tools.js reverted to main (git checkout -- core/src/host/tools.js), the new test left in place:

$ node --import ./test/harness-resolve.mjs --test test/flybot.test.js
not ok 8 - #587: list_bots marks a Bot whose send waits on the owner with a count, never the text
# tests 42  # pass 41  # fail 1

The red is exactly the new case, so it is pinned to the heldSends tag and not to the fixture: with the tag restored the file is 42/42. The test also asserts the two halves that matter — the sender's line stays undelivered while held (received('c') is empty), and after fb.approvals.decide(..., 'approve') the message arrives and the tag is gone.

Not run

  • npm run verify as one command (this box has no harness checkout for the plugin/interop suites); the core suite and the four gates above are run one by one, and CI's package, Test and Merge gate re-run the rest on the tip.
  • Desktop/real-model smoke; nothing here reaches a model.
  • The author's own branch is not deleted or touched; fix(core): list_bots marks a Bot whose send waits on the owner #646 stays open until this lands, then it is closed pointing here.

Risk

T2 by path (core/src/host/**). Read-only addition to one tool's output: it reads state.flybot.approvals that the host already keeps, writes nothing, adds no state, and touches no send path — a held message still waits exactly as before. The tag is a count, so no held text can leak into a roster a coordinator reads. The only visible change is the roster line for a Bot that is already blocked, and it clears on the decision. core/ and patches/ds-bot/ move together, so the package gate stays green.

Fixes #587

Supersedes #646

Tip SHA: 8fd25e6

A Bot whose outbound message is held for the owner's approval looked idle
to a coordinator. list_bots now tags it with the number of its pending
held sends ("Writer (Write, 1 to approve)"), a count only — never the
held message's text — and the tag clears once the owner decides.

Fixes #587

Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 22, 2026
@Birfy Birfy self-assigned this Oct 22, 2026
@Birfy

Birfy commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this as a duplicate.

#646 already carries the same change: its branch was updated to 528313bb, rebased onto current main, with the patch series regenerated, and it is green (9/9) and mergeable. Keeping the author's pull request also keeps the discussion, the Fixes #587 link and the authorship in one place.

Nothing from this branch is lost — it is the same seven files, and the review record for #587 will live on #646.

@Birfy Birfy closed this Oct 22, 2026
@Birfy Birfy removed the agent-pr Pull request opened by an agent label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_bots marks a Bot whose send waits for approval

1 participant