feat(statusline): expose background agents in status line payload (#1234)
This commit is contained in:
@@ -265,6 +265,7 @@ import {
|
||||
import {
|
||||
clearCompletedSubagents,
|
||||
clearSubagentsByIds,
|
||||
getActiveBackgroundAgents,
|
||||
getSubagentByToolCallId,
|
||||
getSnapshot as getSubagentSnapshot,
|
||||
hasActiveSubagents,
|
||||
@@ -2492,6 +2493,11 @@ export default function App({
|
||||
permissionMode: uiPermissionMode,
|
||||
networkPhase,
|
||||
terminalWidth: chromeColumns,
|
||||
backgroundAgents: getActiveBackgroundAgents().map((a) => ({
|
||||
type: a.type,
|
||||
status: a.status,
|
||||
duration_ms: Date.now() - a.startTime,
|
||||
})),
|
||||
triggerVersion: statusLineTriggerVersion,
|
||||
});
|
||||
|
||||
|
||||
@@ -19,6 +19,11 @@ export interface StatusLinePayloadBuildInput {
|
||||
permissionMode?: string;
|
||||
networkPhase?: "upload" | "download" | "error" | null;
|
||||
terminalWidth?: number;
|
||||
backgroundAgents?: Array<{
|
||||
type: string;
|
||||
status: string;
|
||||
duration_ms: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,6 +81,11 @@ export interface StatusLinePayload {
|
||||
permission_mode: string | null;
|
||||
network_phase: "upload" | "download" | "error" | null;
|
||||
terminal_width: number | null;
|
||||
background_agents: Array<{
|
||||
type: string;
|
||||
status: string;
|
||||
duration_ms: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export function calculateContextPercentages(
|
||||
@@ -162,5 +172,10 @@ export function buildStatusLinePayload(
|
||||
permission_mode: input.permissionMode ?? null,
|
||||
network_phase: input.networkPhase ?? null,
|
||||
terminal_width: input.terminalWidth ?? null,
|
||||
background_agents: (input.backgroundAgents ?? []).map((a) => ({
|
||||
type: a.type,
|
||||
status: a.status,
|
||||
duration_ms: a.duration_ms,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export const STATUSLINE_NATIVE_FIELDS: StatusLineFieldSpec[] = [
|
||||
{ path: "permission_mode" },
|
||||
{ path: "network_phase" },
|
||||
{ path: "terminal_width" },
|
||||
{ path: "background_agents" },
|
||||
];
|
||||
|
||||
export const STATUSLINE_DERIVED_FIELDS: StatusLineFieldSpec[] = [
|
||||
|
||||
@@ -37,6 +37,11 @@ export interface StatusLineInputs {
|
||||
permissionMode?: string;
|
||||
networkPhase?: "upload" | "download" | "error" | null;
|
||||
terminalWidth?: number;
|
||||
backgroundAgents?: Array<{
|
||||
type: string;
|
||||
status: string;
|
||||
duration_ms: number;
|
||||
}>;
|
||||
triggerVersion: number;
|
||||
}
|
||||
|
||||
@@ -73,6 +78,7 @@ function toPayloadInput(inputs: StatusLineInputs): StatusLinePayloadBuildInput {
|
||||
permissionMode: inputs.permissionMode,
|
||||
networkPhase: inputs.networkPhase,
|
||||
terminalWidth: inputs.terminalWidth,
|
||||
backgroundAgents: inputs.backgroundAgents,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user