From 30fd4c6cdbeeae16276588ed656bcb4e4f12d69e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 3 Apr 2026 22:50:02 +0100 Subject: [PATCH] test: add default channel account stubs in subagent focus tests --- .../reply/commands-subagents-focus.test.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/auto-reply/reply/commands-subagents-focus.test.ts b/src/auto-reply/reply/commands-subagents-focus.test.ts index 6d246fbd532..66b842a66b3 100644 --- a/src/auto-reply/reply/commands-subagents-focus.test.ts +++ b/src/auto-reply/reply/commands-subagents-focus.test.ts @@ -115,7 +115,10 @@ const hoisted = vi.hoisted(() => { plugin: { id: threadChannel, meta: {}, - config: { hasPersistedAuthState: () => false }, + config: { + hasPersistedAuthState: () => false, + defaultAccountId: () => "default", + }, bindings: { resolveCommandConversation: resolveThreadCommandConversation }, }, }, @@ -123,7 +126,10 @@ const hoisted = vi.hoisted(() => { plugin: { id: roomChannel, meta: {}, - config: { hasPersistedAuthState: () => false }, + config: { + hasPersistedAuthState: () => false, + defaultAccountId: () => "default", + }, conversationBindings: { defaultTopLevelPlacement: "child" }, bindings: { resolveCommandConversation: resolveRoomCommandConversation }, }, @@ -132,7 +138,10 @@ const hoisted = vi.hoisted(() => { plugin: { id: topicChannel, meta: {}, - config: { hasPersistedAuthState: () => false }, + config: { + hasPersistedAuthState: () => false, + defaultAccountId: () => "default", + }, conversationBindings: { defaultTopLevelPlacement: "current" }, bindings: { resolveCommandConversation: resolveTopicCommandConversation }, }, @@ -227,7 +236,10 @@ function createThreadCommandParams(commandBody: string) { return params; } -function createThreadCommandParamsWithoutAccountId(commandBody: string, cfg: OpenClawConfig = baseCfg) { +function createThreadCommandParamsWithoutAccountId( + commandBody: string, + cfg: OpenClawConfig = baseCfg, +) { const params = buildCommandTestParams(commandBody, cfg, { Provider: THREAD_CHANNEL, Surface: THREAD_CHANNEL, @@ -689,7 +701,7 @@ describe("/focus, /unfocus, /agents", () => { }); it("/agents honors the plugin default account when AccountId is omitted", async () => { - hoisted.runtimeChannelRegistry.channels[0]!.plugin.config.defaultAccountId = () => "work"; + hoisted.runtimeChannelRegistry.channels[0].plugin.config.defaultAccountId = () => "work"; addSubagentRunForTests({ runId: "run-work-1", childSessionKey: "agent:main:subagent:work-1",