Skip to content

Commit 9711521

Browse files
committed
fix(ci): keep legacy config.agent fallback in thread-ownership
1 parent 72873b8 commit 9711521

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extensions/thread-ownership/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ type ThreadOwnershipConfig = {
44
forwarderUrl?: string;
55
abTestChannels?: string[];
66
};
7+
type LegacyAgentConfig = {
8+
agent?: {
9+
id?: string;
10+
name?: string;
11+
};
12+
};
713

814
// In-memory set of {channel}:{thread} keys where this agent was @-mentioned.
915
// Entries expire after 5 minutes.
@@ -33,8 +39,9 @@ export default function register(api: OpenClawPluginApi) {
3339
[],
3440
);
3541

36-
const agentId = api.id ?? "unknown";
37-
const agentName = api.name ?? "";
42+
const legacyAgent = (api.config as LegacyAgentConfig).agent;
43+
const agentId = legacyAgent?.id ?? api.id ?? "unknown";
44+
const agentName = legacyAgent?.name ?? api.name ?? "";
3845
const botUserId = process.env.SLACK_BOT_USER_ID ?? "";
3946

4047
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)