From d1278aa8564c3006b398137c855dff5388f628c5 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sun, 31 May 2026 10:27:13 +0700 Subject: [PATCH] Update tests for steering capability and send-path routing Test drift surfaced by rebasing onto main: - client SDK agent fixture now expects supportsSteering: false (the steering feature adds this capability flag, schema-defaulted). - permission-response fake AgentManager gains startAgentRun, since the shared startAgentRun helper now routes through AgentManager.startAgentRun (the steer-vs-replace-vs-stream dispatch) instead of calling streamAgent/replaceAgentRun directly. --- packages/client/src/index.test.ts | 1 + .../src/server/agent/permission-response.test.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/client/src/index.test.ts b/packages/client/src/index.test.ts index 39d511234..d25817918 100644 --- a/packages/client/src/index.test.ts +++ b/packages/client/src/index.test.ts @@ -152,6 +152,7 @@ function createAgent(input: Partial = {}): PaseoAgent { supportsRewindBoth: false, supportsRewindConversation: false, supportsRewindFiles: false, + supportsSteering: false, supportsToolInvocations: true, }, currentModeId: null, diff --git a/packages/server/src/server/agent/permission-response.test.ts b/packages/server/src/server/agent/permission-response.test.ts index 89b320b00..6bab79f4a 100644 --- a/packages/server/src/server/agent/permission-response.test.ts +++ b/packages/server/src/server/agent/permission-response.test.ts @@ -8,6 +8,7 @@ import type { AgentPermissionResponse, } from "./agent-sdk-types.js"; import type { AgentStreamEvent } from "../messages.js"; +import type { StartAgentRunOptions, StartAgentRunResult } from "./agent-manager.js"; import { respondToAgentPermission } from "./permission-response.js"; class FakePermissionAgentManager { @@ -61,6 +62,21 @@ class FakePermissionAgentManager { this.replacementRuns.push({ agentId, prompt, options }); return emptyAgentStream(); } + + startAgentRun( + agentId: string, + prompt: AgentPromptInput, + options?: StartAgentRunOptions, + ): StartAgentRunResult { + if (this.tryRunOutOfBand()) { + return { outOfBand: true }; + } + const shouldReplace = Boolean(options?.replaceRunning && this.hasInFlightRun()); + const events = shouldReplace + ? this.replaceAgentRun(agentId, prompt, options?.runOptions) + : this.streamAgent(agentId, prompt, options?.runOptions); + return { outOfBand: false, events }; + } } async function* emptyAgentStream(): AsyncGenerator {}