test: add default channel account stubs in subagent focus tests

This commit is contained in:
Peter Steinberger 2026-04-03 22:50:02 +01:00
parent 01534d9bd5
commit 30fd4c6cdb
No known key found for this signature in database
1 changed files with 17 additions and 5 deletions

View File

@ -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",