Skip to content

tree: a burst of two same-name same-role calls names that Bot twice in the lead's role text #840

Closed

Description

@Birfy

Two create_child_bot calls that are in flight at the same time with the same name and the same role become one lead with one child — and that lead's role text says the name twice: Lead of the FlyBot group: coordinates FlyBot Programmer, FlyBot Programmer.

Why (main be48393b)

  • A burst takes one seat per call and marks the seats that share a key as a group: plugins/tree/src/allocate.js:125-136. The group's names are collected straight from the seats — seats.filter(o => o.key === key).map(o => o.name) (:135) — so two calls named the same contribute the name twice.
  • Those names are handed to the one shared lead as memberNames (:204 → createLead), and createLead writes them into the lead's role text verbatim: Lead of the ${label} group: coordinates ${memberNames.join(', ')}. (plugins/tree/src/organize.js:173).
  • The child itself is not duplicated: the second call reaches planChild and finds the Bot the first one made, so it reuses it (allocate.js:98, :213-214). Result: one child, a role text naming it twice.

This is not #819. #819 stopped a call from taking a seat when it would reuse an already existing Bot (:120-124). Here both calls do create work and both seats are real; they only collapse into one Bot later, in the reuse branch.

Acceptance criteria

  1. Two concurrent create_child_bot calls from one caller with the same name and same role produce: one member Bot, one lead, and a lead role text in which that name appears once (coordinates FlyBot Programmer.), with the group label unchanged.
  2. A burst whose members have different names still lists every name once, in seat order — deduping must not drop a member that was not reused.
  3. The four burst cases from Tree: a reachable Archived group in the sidebar, and one group for a concurrent burst #810 (core-free plugins/tree suite: two calls become one group, different keys do not, a call that starts after the previous returned stays flat, area:-first keys are excluded) stay green.
  4. Negative control: with the dedupe removed, the new case fails on the duplicated name only — the created-Bot count and the child count in the same test stay correct, so the test cannot pass for the wrong reason.

Kill conditions — do not:

Refs #819 (seat taken for a reuse), #831 (the fix that landed for it), #764 (a Bot's name is unique across the roster).

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 23, 2026
  2. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claiming #840. Branch fix/840-burst-duplicate-name, cut from 153d5d45.

    The dedupe goes where the names become the lead's roster, not where the seats are counted: createChild still decides "is this a group" by the calls that took a seat, and the list handed to joinGroup is deduped by norm(name), the same normalisation the reuse check uses. So two same-name same-role calls stay one group with one lead, and that lead names the Bot once. A burst with different names is unchanged: every name appears once, in seat order. No seat is dropped before planChild runs, and nothing makes the two calls create two Bots.

    A note on the fixture: the reuse happens exactly as the issue says — the second call reaches planChild and finds the Bot the first one made — so the case keeps one member and one lead with and without the fix, and fails on the duplicated name alone.

  3. self-assigned this
    on Oct 23, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 23, 2026
  5. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions