diff --git a/ui-tui/src/app/createGatewayEventHandler.ts b/ui-tui/src/app/createGatewayEventHandler.ts index 11127e7b0f..31d64f54c2 100644 --- a/ui-tui/src/app/createGatewayEventHandler.ts +++ b/ui-tui/src/app/createGatewayEventHandler.ts @@ -1,11 +1,6 @@ import { STREAM_BATCH_MS } from '../config/timing.js' import { buildSetupRequiredSections, SETUP_REQUIRED_TITLE } from '../content/setup.js' -import type { - CommandsCatalogResponse, - DelegationStatusResponse, - GatewayEvent, - GatewaySkin -} from '../gatewayTypes.js' +import type { CommandsCatalogResponse, DelegationStatusResponse, GatewayEvent, GatewaySkin } from '../gatewayTypes.js' import { rpcErrorMessage } from '../lib/rpc.js' import { formatToolCall, stripAnsi } from '../lib/text.js' import { fromSkin } from '../theme.js' @@ -74,7 +69,11 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev: const top = subagents.filter(s => !s.parentId).slice(0, 2) const label = top.length - ? top.map(s => s.goal).filter(Boolean).slice(0, 2).join(' · ') + ? top + .map(s => s.goal) + .filter(Boolean) + .slice(0, 2) + .join(' · ') : `${subagents.length} subagents` await rpc('spawn_tree.save', { @@ -314,32 +313,28 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev: turnController.recordToolStart(ev.payload.tool_id, ev.payload.name ?? 'tool', ev.payload.context ?? '') return + case 'tool.complete': { + const inlineDiffText = + ev.payload.inline_diff && getUiState().inlineDiffs ? stripAnsi(String(ev.payload.inline_diff)).trim() : '' - case 'tool.complete': - { - const inlineDiffText = - ev.payload.inline_diff && getUiState().inlineDiffs ? stripAnsi(String(ev.payload.inline_diff)).trim() : '' - - turnController.recordToolComplete( - ev.payload.tool_id, - ev.payload.name, - ev.payload.error, - inlineDiffText ? '' : ev.payload.summary - ) - - if (!inlineDiffText) { - return - } - - // Keep inline diffs attached to the assistant completion body so - // they render in the same message flow, not as a standalone system - // artifact that can look out-of-place around tool rows. - turnController.queueInlineDiff(inlineDiffText) + turnController.recordToolComplete( + ev.payload.tool_id, + ev.payload.name, + ev.payload.error, + inlineDiffText ? '' : ev.payload.summary + ) + if (!inlineDiffText) { return } + // Keep inline diffs attached to the assistant completion body so + // they render in the same message flow, not as a standalone system + // artifact that can look out-of-place around tool rows. + turnController.queueInlineDiff(inlineDiffText) + return + } case 'clarify.request': patchOverlayState({ @@ -386,9 +381,7 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev: case 'subagent.spawn_requested': // Child built but not yet running (waiting on ThreadPoolExecutor slot). // Preserve completed state if a later event races in before this one. - turnController.upsertSubagent(ev.payload, c => - c.status === 'completed' ? {} : { status: 'queued' } - ) + turnController.upsertSubagent(ev.payload, c => (c.status === 'completed' ? {} : { status: 'queued' })) // Prime the status-bar HUD: fetch caps (once every 5s) so we can // warn as depth/concurrency approaches the configured ceiling. @@ -401,9 +394,7 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev: return case 'subagent.start': - turnController.upsertSubagent(ev.payload, c => - c.status === 'completed' ? {} : { status: 'running' } - ) + turnController.upsertSubagent(ev.payload, c => (c.status === 'completed' ? {} : { status: 'running' })) return case 'subagent.thinking': { diff --git a/ui-tui/src/app/slash/commands/ops.ts b/ui-tui/src/app/slash/commands/ops.ts index 343d83c8d5..210c6301ef 100644 --- a/ui-tui/src/app/slash/commands/ops.ts +++ b/ui-tui/src/app/slash/commands/ops.ts @@ -8,12 +8,7 @@ import type { import type { PanelSection } from '../../../types.js' import { applyDelegationStatus, getDelegationState } from '../../delegationStore.js' import { patchOverlayState } from '../../overlayStore.js' -import { - getSpawnHistory, - pushDiskSnapshot, - setDiffPair, - type SpawnSnapshot -} from '../../spawnHistoryStore.js' +import { getSpawnHistory, pushDiskSnapshot, setDiffPair, type SpawnSnapshot } from '../../spawnHistoryStore.js' import type { SlashCommand } from '../types.js' interface SkillInfo { @@ -101,10 +96,11 @@ export const opsCommands: SlashCommand[] = [ // ── Disk-backed listing ───────────────────────────────────── if (lower === 'list' || lower === 'ls') { - ctx.gateway.rpc('spawn_tree.list', { - limit: 30, - session_id: ctx.sid ?? 'default' - }) + ctx.gateway + .rpc('spawn_tree.list', { + limit: 30, + session_id: ctx.sid ?? 'default' + }) .then( ctx.guarded(r => { const entries = r.entries ?? [] @@ -136,7 +132,8 @@ export const opsCommands: SlashCommand[] = [ return ctx.transcript.sys('usage: /replay load ') } - ctx.gateway.rpc('spawn_tree.load', { path }) + ctx.gateway + .rpc('spawn_tree.load', { path }) .then( ctx.guarded(r => { if (!r.subagents?.length) { @@ -202,9 +199,7 @@ export const opsCommands: SlashCommand[] = [ const candidate = resolve(b!) if (!baseline || !candidate) { - return ctx.transcript.sys( - `replay-diff: could not resolve indices · history has ${history.length} entries` - ) + return ctx.transcript.sys(`replay-diff: could not resolve indices · history has ${history.length} entries`) } setDiffPair({ baseline, candidate }) diff --git a/ui-tui/src/components/agentsOverlay.tsx b/ui-tui/src/components/agentsOverlay.tsx index a890879352..9cec37e44b 100644 --- a/ui-tui/src/components/agentsOverlay.tsx +++ b/ui-tui/src/components/agentsOverlay.tsx @@ -206,7 +206,6 @@ function GanttStrip({ now: number t: Theme }) { - const spans = flatNodes .map((node, idx) => { const started = node.item.startedAt ?? now @@ -273,7 +272,6 @@ function GanttStrip({ {shown.map(({ endAt, idx, node, startAt }) => { - const active = idx === cursor const { color } = statusGlyph(node.item, t) const accent = active ? t.color.amber : t.color.dim