mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:20:45 +00:00
fix(regression): propagate team scope into child spawns
This commit is contained in:
@@ -651,6 +651,7 @@ describe("msteams monitor handler authz", () => {
|
||||
expect(dispatched?.ctxPayload).toMatchObject({
|
||||
BodyForAgent:
|
||||
"[Thread history]\nAlice: Allowed context\n[/Thread history]\n\nCurrent message",
|
||||
GroupSpace: "team123",
|
||||
});
|
||||
expect(
|
||||
String((dispatched?.ctxPayload as { BodyForAgent?: string }).BodyForAgent),
|
||||
|
||||
@@ -773,6 +773,7 @@ export function createMSTeamsMessageHandler(deps: MSTeamsMessageHandlerDeps) {
|
||||
ChatType: isDirectMessage ? "direct" : isChannel ? "channel" : "group",
|
||||
ConversationLabel: envelopeFrom,
|
||||
GroupSubject: !isDirectMessage ? conversationType : undefined,
|
||||
GroupSpace: teamId,
|
||||
SenderName: senderName,
|
||||
SenderId: senderId,
|
||||
Provider: "msteams" as const,
|
||||
|
||||
@@ -196,6 +196,7 @@ describe("slack prepareSlackMessage inbound contract", () => {
|
||||
|
||||
expect(prepared).toBeTruthy();
|
||||
expectInboundContextContract(prepared!.ctxPayload as any);
|
||||
expect(prepared!.ctxPayload.GroupSpace).toBe("T1");
|
||||
});
|
||||
|
||||
it("does not enable Slack status reactions when the message timestamp is missing", async () => {
|
||||
|
||||
@@ -736,6 +736,7 @@ export async function prepareSlackMessage(params: {
|
||||
ChatType: isDirectMessage ? "direct" : "channel",
|
||||
ConversationLabel: envelopeFrom,
|
||||
GroupSubject: isRoomish ? roomLabel : undefined,
|
||||
GroupSpace: ctx.teamId || undefined,
|
||||
GroupSystemPrompt: groupSystemPrompt,
|
||||
UntrustedContext: untrustedChannelMetadata ? [untrustedChannelMetadata] : undefined,
|
||||
SenderName: senderName,
|
||||
|
||||
@@ -983,9 +983,10 @@ describe("slack slash command session metadata", () => {
|
||||
expect(recordSessionMetaFromInboundMock).toHaveBeenCalledTimes(1);
|
||||
const call = recordSessionMetaFromInboundMock.mock.calls[0]?.[0] as {
|
||||
sessionKey?: string;
|
||||
ctx?: { OriginatingChannel?: string };
|
||||
ctx?: { GroupSpace?: string; OriginatingChannel?: string };
|
||||
};
|
||||
expect(call.ctx?.OriginatingChannel).toBe("slack");
|
||||
expect(call.ctx?.GroupSpace).toBe("T1");
|
||||
expect(call.sessionKey).toBeDefined();
|
||||
});
|
||||
|
||||
|
||||
@@ -577,6 +577,7 @@ export async function registerSlackMonitorSlashCommands(params: {
|
||||
: `slack:group:${command.channel_id}`,
|
||||
}) ?? (isDirectMessage ? senderName : roomLabel),
|
||||
GroupSubject: isRoomish ? roomLabel : undefined,
|
||||
GroupSpace: ctx.teamId || undefined,
|
||||
GroupSystemPrompt: groupSystemPrompt,
|
||||
UntrustedContext: untrustedChannelMetadata ? [untrustedChannelMetadata] : undefined,
|
||||
SenderName: senderName,
|
||||
|
||||
Reference in New Issue
Block a user