`subagent.started` event sometimes reports "General Purpose Agent" instead of registered `displayName` (intermittent, same code/commit)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- api
Research direction
Start with nodejs/src/generated/session-events.ts and verify the SubagentStartedData contract, then reproduce the createSession/customAgents/task flow with the subagent.started listener described in the issue. The CLI binary is not source-readable, so confirm whether the SDK can add coverage or whether the fix must be escalated to the CLI; done means agentDisplayName consistently matches displayName or name across repeated runs.
Written by the indexing model from the issue text.
Description
Summary
When the orchestrator dispatches custom agents via task, the subagent.started event's agentDisplayName field sometimes correctly reports the registered displayName (e.g., "Tenant Metrics", "Outlier Detector") and sometimes reports "General Purpose Agent". The behavior is non-deterministic across runs on identical code.
Repro
const session = await client.createSession({
customAgents: [
{ name: "tenant-metrics", displayName: "Tenant Metrics", prompt: "..." },
{ name: "outlier-detector", displayName: "Outlier Detector", prompt: "..." },
/* ... 3 more named custom agents ... */
],
});
session.on("subagent.started", (evt) => console.log(evt.data.agentDisplayName));
await session.sendAndWait({ prompt: "Dispatch all five custom agents to analyze..." });
Observed across multiple runs of the same code, same commit, same SDK/CLI:
- Run 1: prints
"Tenant Metrics","Outlier Detector", etc. correctly - Run 2: prints
"General Purpose Agent"for all 5 agents
Expected
agentDisplayName consistently matches customAgents[].displayName (or, when not set, falls back to customAgents[].name).
Actual
Non-deterministic. The intermittency is the larger concern — it suggests state leaking across runs or initialization-order sensitivity in the CLI's agent registration path.
Evidence (SDK source — limited)
nodejs/src/generated/session-events.ts: SubagentStartedData includes agentDisplayName: string. The SDK never populates this field — the event arrives over RPC from the CLI. The bug is in the CLI binary, which is not source-readable.
Consumer impact
- Dashboards and reports show
"General Purpose Agent" × Ninstead of distinguishable names. - Per-agent metrics rollups (timings, token usage, cost) keyed by
agentDisplayNamecollapse to a single bucket.
Suggested fix
- Propagate the custom agent's
displayName(or the dispatchingtaskcall'snamefield) tosubagent.startedevents consistently. - Separately: root-cause the intermittency. Even if the display-name propagation lands, an intermittent CLI is a debugging hazard.
Related
- #1110 —
agentIdmissing fromSessionEventin .NET, Go, and Python SDKs. Adjacent: anotherSessionEventfield that's not being populated reliably across SDKs/runtimes.
Environment
- SDK: @github/copilot-sdk@0.3.0 (also observed on older versions)
- CLI: @github/copilot@1.0.45 (also observed on 1.0.14+)
- Node: 22 LTS
- OS: Windows 11
- Model: claude-sonnet-4-6
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 130
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-sdk
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2759 ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2709 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/copilot-sdk#2673 ·
All issues in github/copilot-sdk
Similar issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/flink-agents#1152 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo-graphs#75 ·