Problem
SessionIdleData.BackgroundTasks reports agents=-1 and shells=-1 when the field is null/missing in the JSON payload, instead of using nullable int? types.
Impact on PolyPilot
PolyPilot must check both bt == null AND agents == -1 to determine if background task info is available:
var bt = idle.Data?.BackgroundTasks;
var agentCount = bt?.Agents ?? -1;
var shellCount = bt?.Shells ?? -1;
// Is this 'no background tasks' or 'data not available'? Can't tell from -1.
This ambiguity means we can't distinguish between 'zero sub-agents running' and 'the server didn't report background task status'. The IDLE-DEFER logic has to treat null/missing as 'no deferral needed' (assumption, not fact).
Desired SDK Behavior
BackgroundTasks.Agents and BackgroundTasks.Shells should be int? (nullable). null = not reported, 0 = none active, >0 = active count.
SDK Reference
GitHub.Copilot.SDK v0.2.1 — SessionIdleData, SessionBackgroundTasks
Problem
SessionIdleData.BackgroundTasksreportsagents=-1andshells=-1when the field is null/missing in the JSON payload, instead of using nullableint?types.Impact on PolyPilot
PolyPilot must check both
bt == nullANDagents == -1to determine if background task info is available:This ambiguity means we can't distinguish between 'zero sub-agents running' and 'the server didn't report background task status'. The IDLE-DEFER logic has to treat null/missing as 'no deferral needed' (assumption, not fact).
Desired SDK Behavior
BackgroundTasks.AgentsandBackgroundTasks.Shellsshould beint?(nullable).null= not reported,0= none active,>0= active count.SDK Reference
GitHub.Copilot.SDKv0.2.1 —SessionIdleData,SessionBackgroundTasks