From bf292ebd948d2d1ca27101eca1c964edef5c3f49 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Wed, 9 Sep 2026 13:50:41 -0700 Subject: [PATCH] test(agent-session): name the projected rows so the fixture typechecks An indexed lookup into the fixture's task list is possibly-undefined under `pnpm tc`; the rows are more readable named anyway. --- ...ured-agent-session-background-task-capability.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.ts b/src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.ts index 4c2283efb52..2b62b00525e 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.ts @@ -34,13 +34,12 @@ const STOP_ONLY_CLIENT = { (capability) => capability !== AGENT_SESSION_BACKGROUND_TASK_ROW_STOP_CAPABILITY ) } +const FOREGROUND_ROW = { id: 'fore', kind: 'agent', stoppable: false } as const +const BACKGROUNDED_ROW = { id: 'back', kind: 'agent' } as const const MIXED_ROWS: AgentSessionBackgroundTaskState = { state: 'monitoring', supportsTaskStop: true, - tasks: [ - { id: 'fore', kind: 'agent', stoppable: false }, - { id: 'back', kind: 'agent' } - ] + tasks: [FOREGROUND_ROW, BACKGROUNDED_ROW] } describe('background-task stop capability at the RPC boundary', () => { @@ -127,7 +126,7 @@ describe('background-task stop capability at the RPC boundary', () => { [ 'stop-only reader', () => STOP_ONLY_CLIENT, - { state: 'monitoring', tasks: [MIXED_ROWS.tasks[1]] } + { state: 'monitoring', tasks: [BACKGROUNDED_ROW] } ], ['in-process reader', () => undefined, MIXED_ROWS] ] as const)('projects unstoppable rows for a %s', async (_label, client, expected) => {