You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] @ mention picker is flooded with subagent worker transcripts (3-line fix proposed)
#5486
The @ reference picker in the web input lists every persisted session — including
delegation worker sessions (origin: "subagent", non-null parentSession). After one
heavy orchestration run (~57 parallel review subagents in my case), the picker became
unusable: dozens of duplicate entries titled by the worker prompt
("你是计划审查员" × N, one per review arm per sample).
Why it happens
SessionReferenceResolver.listCandidates()
(packages/context/session-reference/src/index.ts) excludes only self:
.filter(record=>record.header.id!==agent.id)
parentSession is already indexed (session-query-sqlite stores it, filters.ts
can filter on it) — the candidate list just never uses it. Worker transcripts are
not conversations a human references; their content is reachable through the parent.
Proposed fix (3 lines + test)
const records = (await settleWithCancellation(this.ctx.sessionQuery.listSessions(signal), signal))
+ // Subagent child sessions (delegation workers) are transcripts, not+ // conversations a human references; exclude them from mention candidates.+ .filter(record => record.header.id !== agent.id && record.header.parentSession == null)
.map((record, index) => ({ record, index }))
With a regression test creating sessions with parentSession set and asserting they
never appear in listCandidates() output. Package suite passes 17/17 with the patch.
I can't submit a PR at the moment (external PRs paused per CONTRIBUTING) — happy to
post the full diff + test here if useful, or re-submit when PRs reopen.
Workaround meanwhile
Archiving worker records out of ~/.dsh/sessions cleans the picker
(records are plain directories; verify origin: "subagent" in the first JSONL line
before moving).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What happened
The
@reference picker in the web input lists every persisted session — includingdelegation worker sessions (
origin: "subagent", non-nullparentSession). After oneheavy orchestration run (~57 parallel review subagents in my case), the picker became
unusable: dozens of duplicate entries titled by the worker prompt
("你是计划审查员" × N, one per review arm per sample).
Why it happens
SessionReferenceResolver.listCandidates()(
packages/context/session-reference/src/index.ts) excludes only self:parentSessionis already indexed (session-query-sqlitestores it,filters.tscan filter on it) — the candidate list just never uses it. Worker transcripts are
not conversations a human references; their content is reachable through the parent.
Proposed fix (3 lines + test)
With a regression test creating sessions with
parentSessionset and asserting theynever appear in
listCandidates()output. Package suite passes 17/17 with the patch.I can't submit a PR at the moment (external PRs paused per CONTRIBUTING) — happy to
post the full diff + test here if useful, or re-submit when PRs reopen.
Workaround meanwhile
Archiving worker records out of
~/.dsh/sessionscleans the picker(records are plain directories; verify
origin: "subagent"in the first JSONL linebefore moving).
All reactions