fix(subagents): pass group context in /subagents spawn

This commit is contained in:
Peter Steinberger
2026-02-17 03:00:01 +01:00
parent 2b3ecee7c5
commit f242246839
3 changed files with 29 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
import crypto from "node:crypto";
import type { SubagentRunRecord } from "../../agents/subagent-registry.js";
import type { CommandHandler } from "./commands-types.js";
import { AGENT_LANE_SUBAGENT } from "../../agents/lanes.js";
import { abortEmbeddedPiRun } from "../../agents/pi-embedded.js";
import type { SubagentRunRecord } from "../../agents/subagent-registry.js";
import {
clearSubagentRunSteerRestart,
listSubagentRunsForRequester,
@@ -35,7 +36,6 @@ import {
} from "../../shared/subagents-format.js";
import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js";
import { stopSubagentsForRequester } from "./abort.js";
import type { CommandHandler } from "./commands-types.js";
import { clearSessionQueues } from "./queue.js";
import { formatRunLabel, formatRunStatus, sortSubagentRuns } from "./subagents-utils.js";
@@ -681,6 +681,9 @@ export const handleSubagentsCommand: CommandHandler = async (params, allowTextCo
agentAccountId: params.ctx.AccountId,
agentTo: params.command.to,
agentThreadId: params.ctx.MessageThreadId,
agentGroupId: params.sessionEntry?.groupId ?? null,
agentGroupChannel: params.sessionEntry?.groupChannel ?? null,
agentGroupSpace: params.sessionEntry?.space ?? null,
},
);
if (result.status === "accepted") {