mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:31:06 +00:00
fix(agent): preserve default-agent session routing compatibility (#72414)
* fix(agent): preserve default-agent session routing compatibility * fix(clownfish): address review for ghcrawl-207038-agentic-merge (1) * fix(agent): migrate legacy default-agent sessions * fix(slack): use narrow agent runtime import
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
import type { SessionScope } from "openclaw/plugin-sdk/config-types";
|
||||
import type { DmPolicy, GroupPolicy } from "openclaw/plugin-sdk/config-types";
|
||||
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
||||
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import type { HistoryEntry } from "openclaw/plugin-sdk/reply-history";
|
||||
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
||||
@@ -218,6 +219,7 @@ export function createSlackMonitorContext(params: {
|
||||
params.sessionScope,
|
||||
{ From: from, ChatType: chatType, Provider: "slack" },
|
||||
params.mainKey,
|
||||
resolveDefaultAgentId(params.cfg),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -196,6 +196,18 @@ describe("resolveSlackSystemEventSessionKey", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("uses the configured default agent for fallback system-event sessions", () => {
|
||||
const ctx = createSlackMonitorContext({
|
||||
...baseParams(),
|
||||
cfg: {
|
||||
agents: { list: [{ id: "ops", default: true }] },
|
||||
},
|
||||
});
|
||||
expect(ctx.resolveSlackSystemEventSessionKey({ channelId: "C123" })).toBe(
|
||||
"agent:ops:slack:channel:c123",
|
||||
);
|
||||
});
|
||||
|
||||
it("routes channel system events through account bindings", () => {
|
||||
const ctx = createSlackMonitorContext({
|
||||
...baseParams(),
|
||||
|
||||
Reference in New Issue
Block a user