Compare commits
4 Commits
vincentkoc
...
fix/slack-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01d3b67705 | ||
|
|
48195a4879 | ||
|
|
b8279e4f27 | ||
|
|
f0bf3be56d |
@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
- Docker: pin base images to SHA256 digests in Docker builds to prevent mutable tag drift. (#7734) Thanks @coygeek.
|
||||
- Provider/HTTP: treat HTTP 503 as failover-eligible for LLM provider errors. (#21086) Thanks @Protocol-zero-0.
|
||||
- Slack: pass `recipient_team_id` / `recipient_user_id` through Slack native streaming calls so `chat.startStream`/`appendStream`/`stopStream` work reliably across DMs and Slack Connect setups, and disable block streaming when native streaming is active. (#20988) Thanks @Dithilli. Earlier recipient-ID groundwork was contributed in #20377 by @AsserAl1012.
|
||||
|
||||
- Discord/Gateway: handle close code 4014 (missing privileged gateway intents) without crashing the gateway. Thanks @thewilloftheshadow.
|
||||
- Security/Net: strip sensitive headers (`Authorization`, `Proxy-Authorization`, `Cookie`, `Cookie2`) on cross-origin redirects in `fetchWithSsrFGuard` to prevent credential forwarding across origin boundaries. (#20313) Thanks @afurm.
|
||||
|
||||
@@ -199,6 +199,8 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
|
||||
channel: message.channel,
|
||||
threadTs: streamThreadTs,
|
||||
text,
|
||||
teamId: ctx.teamId,
|
||||
userId: message.user,
|
||||
});
|
||||
replyPlan.markSent();
|
||||
return;
|
||||
@@ -354,7 +356,7 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
|
||||
skillFilter: prepared.channelConfig?.skills,
|
||||
hasRepliedRef,
|
||||
disableBlockStreaming: useStreaming
|
||||
? false
|
||||
? true
|
||||
: typeof account.config.blockStreaming === "boolean"
|
||||
? !account.config.blockStreaming
|
||||
: undefined,
|
||||
|
||||
@@ -36,6 +36,18 @@ export type StartSlackStreamParams = {
|
||||
threadTs: string;
|
||||
/** Optional initial markdown text to include in the stream start. */
|
||||
text?: string;
|
||||
/**
|
||||
* The team ID of the workspace this stream belongs to.
|
||||
* Required by the Slack API for `chat.startStream` / `chat.stopStream`.
|
||||
* Obtain from `auth.test` response (`team_id`).
|
||||
*/
|
||||
teamId?: string;
|
||||
/**
|
||||
* The user ID of the message recipient (required for DM streaming).
|
||||
* Without this, `chat.stopStream` fails with `missing_recipient_user_id`
|
||||
* in direct message conversations.
|
||||
*/
|
||||
userId?: string;
|
||||
};
|
||||
|
||||
export type AppendSlackStreamParams = {
|
||||
@@ -64,13 +76,17 @@ export type StopSlackStreamParams = {
|
||||
export async function startSlackStream(
|
||||
params: StartSlackStreamParams,
|
||||
): Promise<SlackStreamSession> {
|
||||
const { client, channel, threadTs, text } = params;
|
||||
const { client, channel, threadTs, text, teamId, userId } = params;
|
||||
|
||||
logVerbose(`slack-stream: starting stream in ${channel} thread=${threadTs}`);
|
||||
logVerbose(
|
||||
`slack-stream: starting stream in ${channel} thread=${threadTs}${teamId ? ` team=${teamId}` : ""}${userId ? ` user=${userId}` : ""}`,
|
||||
);
|
||||
|
||||
const streamer = client.chatStream({
|
||||
channel,
|
||||
thread_ts: threadTs,
|
||||
...(teamId ? { recipient_team_id: teamId } : {}),
|
||||
...(userId ? { recipient_user_id: userId } : {}),
|
||||
});
|
||||
|
||||
const session: SlackStreamSession = {
|
||||
|
||||
Reference in New Issue
Block a user