fix(agents): sessions_spawn inherits provider (#528)

This commit is contained in:
Peter Steinberger
2026-01-09 22:21:25 +01:00
parent 55e830b009
commit 304ec1abe5
3 changed files with 11 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ describe("subagents", () => {
const params = request.params as {
message?: string;
sessionKey?: string;
provider?: string;
timeout?: number;
};
const message = params?.message ?? "";
@@ -67,6 +68,7 @@ describe("subagents", () => {
childRunId = runId;
childSessionKey = sessionKey;
sessionLastAssistantText.set(sessionKey, "result");
expect(params?.provider).toBe("discord");
expect(params?.timeout).toBe(1);
}
return {
@@ -155,10 +157,16 @@ describe("subagents", () => {
const agentCalls = calls.filter((call) => call.method === "agent");
expect(agentCalls).toHaveLength(2);
const first = agentCalls[0]?.params as
| { lane?: string; deliver?: boolean; sessionKey?: string }
| {
lane?: string;
deliver?: boolean;
sessionKey?: string;
provider?: string;
}
| undefined;
expect(first?.lane).toBe("subagent");
expect(first?.deliver).toBe(false);
expect(first?.provider).toBe("discord");
expect(first?.sessionKey?.startsWith("agent:main:subagent:")).toBe(true);
expect(childSessionKey?.startsWith("agent:main:subagent:")).toBe(true);

View File

@@ -170,6 +170,7 @@ export function createSessionsSpawnTool(opts?: {
params: {
message: task,
sessionKey: childSessionKey,
provider: opts?.agentProvider,
idempotencyKey: childIdem,
deliver: false,
lane: "subagent",