Repository navigation
tree: a burst of two same-name same-role calls names that Bot twice in the lead's role text #840
Copy link
Copy link
Closed
Labels
area:automationScheduled tasks and automationScheduled tasks and automationbugSomething isn't workingSomething isn't working
Description
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), andcreateLeadwrites 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
planChildand 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
- Two concurrent
create_child_botcalls 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. - 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.
- The four burst cases from Tree: a reachable Archived group in the sidebar, and one group for a concurrent burst #810 (
core-freeplugins/treesuite: 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. - 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:
- dedupe by role text or by a mangled name (use the same normalisation the reuse check uses,
norm(name)); - change how seats are counted, or drop a seat before the reuse decision (
planChild) has run; - make the two calls create two Bots instead of one (the host refuses duplicate names by design, A Bot cannot be moved to another parent, so a team can only be regrouped by hand #764).
Refs #819 (seat taken for a reuse), #831 (the fix that landed for it), #764 (a Bot's name is unique across the roster).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:automationScheduled tasks and automationScheduled tasks and automationbugSomething isn't workingSomething isn't working
Activity
Birfy commentedon Oct 23, 2026
Written-by: Dev
Claiming #840. Branch
fix/840-burst-duplicate-name, cut from153d5d45.The dedupe goes where the names become the lead's roster, not where the seats are counted:
createChildstill decides "is this a group" by the calls that took a seat, and the list handed tojoinGroupis deduped bynorm(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 beforeplanChildruns, 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
planChildand 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.