Skip to content

tools: sibling task calls collide on agent_id — slug(description) is not unique within a dispatch group #1852

Description

@macanderson

Problem

crates/stella-tools/src/subagent.rs:257 sets agent_id: slug(description) — a pure function of the model-supplied description. Two siblings described 'research X' / 'research X' get the same id; with PR #1836 their SubAgent::Started/Finished event pairs interleave under one id on the parent stream, so the TUI renders indistinguishable rows (model.rs:845-885) and any consumer that pairs by agent_id mis-correlates. Thread names collide too (stella-cli/src/subagent.rs:358).

Fix

Suffix an ordinal (research-x, research-x-2) minted per turn/dispatch group, deterministic given call order (no randomness — replay/invariant 7 discipline). Update the thread name the same way.

Verify

Witness: two spawns with identical descriptions in one step carry distinct agent_ids on their Started events.

Constraints

Land after PR #1836 (same files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important — next in linetriageUntyped request — convert by adding bug / feature / epic

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions