Skip to content

Commit 9aa5303

Browse files
committed
fix: preserve slack announce thread fallback
1 parent c52b217 commit 9aa5303

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Docs: https://docs.openclaw.ai
146146

147147
- Sandbox/security: auto-derive CDP source-range from Docker network gateway and refuse to start the socat relay without one, so peer containers cannot reach CDP unauthenticated. (#61404) Thanks @dims.
148148
- Daemon/launchd: keep `openclaw gateway stop` persistent without uninstalling the macOS LaunchAgent, re-enable it on explicit restart or repair, and harden launchd label handling. (#64447) Thanks @ngutman.
149+
- Agents/Slack: preserve threaded announce delivery when `sessions.list` rows lack stored thread metadata by falling back to the thread id encoded in the session key. (#63143) Thanks @mariosousa-finn.
149150

150151
## 2026.4.9
151152

src/agents/tools/sessions.test.ts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ const installRegistry = async () => {
8080
},
8181
capabilities: { chatTypes: ["direct", "channel", "thread"] },
8282
messaging: {
83-
resolveSessionConversation: resolveSessionConversationStub,
8483
resolveSessionTarget: resolveSessionTargetStub,
8584
},
8685
config: {
@@ -113,6 +112,30 @@ const installRegistry = async () => {
113112
},
114113
},
115114
},
115+
{
116+
pluginId: "slack",
117+
source: "test",
118+
plugin: {
119+
id: "slack",
120+
meta: {
121+
id: "slack",
122+
label: "Slack",
123+
selectionLabel: "Slack",
124+
docsPath: "/channels/slack",
125+
blurb: "Slack test stub.",
126+
preferSessionLookupForAnnounceTarget: true,
127+
},
128+
capabilities: { chatTypes: ["direct", "channel", "thread"] },
129+
messaging: {
130+
resolveSessionConversation: resolveSessionConversationStub,
131+
resolveSessionTarget: resolveSessionTargetStub,
132+
},
133+
config: {
134+
listAccountIds: () => ["default"],
135+
resolveAccount: () => ({}),
136+
},
137+
},
138+
},
116139
]),
117140
);
118141
};
@@ -363,6 +386,32 @@ describe("resolveAnnounceTarget", () => {
363386
threadId: "thread-77",
364387
});
365388
});
389+
390+
it("preserves threaded Slack session keys when sessions.list lacks stored thread metadata", async () => {
391+
callGatewayMock.mockResolvedValueOnce({
392+
sessions: [
393+
{
394+
key: "agent:main:slack:channel:C123:thread:1710000000.000100",
395+
deliveryContext: {
396+
channel: "slack",
397+
to: "channel:C123",
398+
accountId: "workspace",
399+
},
400+
},
401+
],
402+
});
403+
404+
const target = await resolveAnnounceTarget({
405+
sessionKey: "agent:main:slack:channel:C123:thread:1710000000.000100",
406+
displayKey: "agent:main:slack:channel:C123:thread:1710000000.000100",
407+
});
408+
expect(target).toEqual({
409+
channel: "slack",
410+
to: "channel:C123",
411+
accountId: "workspace",
412+
threadId: "1710000000.000100",
413+
});
414+
});
366415
});
367416

368417
describe("sessions_list gating", () => {

0 commit comments

Comments
 (0)