fix(discord): pass config to subagent thread binding

This commit is contained in:
Jai Govindani
2026-04-24 11:56:26 +07:00
committed by Peter Steinberger
parent 0c46e8000e
commit 84571e45ce
2 changed files with 10 additions and 0 deletions

View File

@@ -193,6 +193,15 @@ describe("discord subagent hook handlers", () => {
expect(hookMocks.autoBindSpawnedDiscordSubagent).toHaveBeenCalledTimes(1);
expect(hookMocks.autoBindSpawnedDiscordSubagent).toHaveBeenCalledWith({
cfg: expect.objectContaining({
channels: expect.objectContaining({
discord: expect.objectContaining({
threadBindings: expect.objectContaining({
spawnSubagentSessions: true,
}),
}),
}),
}),
accountId: "work",
channel: "discord",
to: "channel:123",

View File

@@ -126,6 +126,7 @@ export async function handleDiscordSubagentSpawning(
try {
const agentId = event.agentId?.trim() || "subagent";
const binding = await autoBindSpawnedDiscordSubagent({
cfg: api.config,
accountId: event.requester?.accountId,
channel: event.requester?.channel,
to: event.requester?.to,