fix: polish Slack thread fetch diagnostics (#68594) (thanks @martingarramon)

This commit is contained in:
Peter Steinberger
2026-04-18 17:46:02 +01:00
parent 6368559c02
commit aad9a833c0
4 changed files with 14 additions and 6 deletions

View File

@@ -895,7 +895,13 @@ describe("resolveSlackThreadStarter", () => {
client,
});
expect(result).toEqual({ text: "hello thread", userId: "U1", botId: undefined, ts: "1.000", files: undefined });
expect(result).toEqual({
text: "hello thread",
userId: "U1",
botId: undefined,
ts: "1.000",
files: undefined,
});
expect(vi.mocked(logVerbose)).not.toHaveBeenCalled();
});

View File

@@ -1,4 +1,5 @@
import type { WebClient as SlackWebClient } from "@slack/web-api";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/infra-runtime";
import type { FetchLike } from "openclaw/plugin-sdk/media-runtime";
@@ -450,7 +451,7 @@ export async function resolveSlackThreadStarter(params: {
return starter;
} catch (err) {
logVerbose(
`slack thread starter fetch failed channel=${params.channelId} ts=${params.threadTs}: ${err instanceof Error ? err.message : String(err)}`,
`slack thread starter fetch failed channel=${params.channelId} ts=${params.threadTs}: ${formatErrorMessage(err)}`,
);
return null;
}
@@ -545,7 +546,7 @@ export async function resolveSlackThreadHistory(params: {
}));
} catch (err) {
logVerbose(
`slack thread history fetch failed channel=${params.channelId} ts=${params.threadTs}: ${err instanceof Error ? err.message : String(err)}`,
`slack thread history fetch failed channel=${params.channelId} ts=${params.threadTs}: ${formatErrorMessage(err)}`,
);
return [];
}