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

@@ -22,6 +22,7 @@
- Models/Auth: add MiniMax Anthropic-compatible API onboarding (minimax-api). (#590) — thanks @mneves75
- Models: centralize model override validation + hooks Gmail warnings in doctor. (#602) — thanks @steipete
- Agents: avoid base-to-string error stringification in model fallback. (#604) — thanks @steipete
- Agents: `sessions_spawn` inherits the requester's provider for child runs (avoid WhatsApp fallback). (#528) — thanks @rlmestre
- Agents: treat billing/insufficient-credits errors as failover-worthy so model fallbacks kick in. (#486) — thanks @steipete
- Auth: default billing disable backoff to 5h (doubling, 24h cap) and surface disabled/cooldown profiles in `models list` + doctor. (#486) — thanks @steipete
- Commands: harden slash command registry and list text-only commands in `/commands`.

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