Skip to content

fix(slack): preserve custom identity while streaming - #100084

Merged
steipete merged 1 commit into
mainfrom
codex/fix-slack-stream-identity
Jul 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-slack-stream-identity

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Slack agent replies posted with a configured display name/avatar lose that custom identity when draft or final preview updates use chat.update. Closes #58737. Supersedes the implementation in #93972 while preserving contributor credit for @MoerAI.

Why This Change Was Made

Slack does not support username, icon_url, or icon_emoji on chat.update; the public method contract and current @slack/web-api type omit them, and the SDK maintainer confirms there is no update workaround. Slack now supports those authorship fields on chat.startStream.

This replacement therefore:

  • forwards the configured identity through supported native stream starts;
  • disables edit-based draft previews when a custom identity cannot use native streaming;
  • delivers those replies once through the existing chat.postMessage path instead;
  • converts deferred missing_scope stream-start failures into the existing post fallback so short replies are not lost.

User Impact

Custom Slack agent names and avatars remain intact. Threaded/native-stream replies retain streaming UX; contexts that cannot use native streaming trade the edit preview for one correctly attributed final message.

Evidence

  • node scripts/run-vitest.mjs extensions/slack/src/streaming.test.ts extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts — 2 files, 106 tests passed.
  • Blacksmith Testbox through Crabbox tbx_01kwq9kbv377k5mhe81ghmsjja — changed extension production/test typecheck, lint, guards, and import-cycle checks passed (run).
  • pnpm build and pnpm check passed during native prepare after rebase.
  • Fresh structured autoreview accepted one deferred-start fallback finding; after the fix, the rerun reported no actionable findings.
  • Official contracts checked: chat.update, chat.startStream, and @slack/web-api request types.

Known proof gap: a disposable live Slack canary was prepared but desktop 1Password authorization timed out; hosted exact-head CI remains required before merge.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head cc4f44e5d14789a8e167cdbc9ea9112775202941, but the PR head is now e8563450c89092683b6c16af0e0021399a1cb2d2. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (7 earlier review cycles)
  • reviewed 2026-07-04T20:23:49.670Z sha 70e2c24 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T20:50:42.664Z sha 1a15c85 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T20:57:05.172Z sha 1a15c85 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T21:09:21.348Z sha a3ddffb :: needs real behavior proof before merge. :: [P2] Omit unresolved agent id when opening terminals
  • reviewed 2026-07-04T21:17:09.139Z sha a3ddffb :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T22:15:28.766Z sha 0ce951c1f616bf3d089228049364eda40ec59d9c :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T22:22:36.737Z sha 0ce951c1f616bf3d089228049364eda40ec59d9c :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 4, 2026
@steipete
steipete requested a review from a team as a code owner July 4, 2026 20:45
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL and removed size: S labels Jul 4, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: e8563450c89092683b6c16af0e0021399a1cb2d2

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a15c855ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/src/ui/app-render.ts Outdated
: "dark";
return html`<openclaw-terminal-panel
.client=${state.client}
.agentId=${chatAgentId}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Omit unresolved agent id when opening terminals

When the terminal panel is restored/opened as soon as the gateway connects, this new binding can run before loadControlUiBootstrapConfig or agents.list has populated assistantAgentId/agentsList; in that window chatAgentId falls back to literal "main" (ui/src/ui/app-render.ts:1726-1730) and is sent as an explicit terminal.open agent. For installs whose configured default/only agent is not main, the server treats that explicit id as unknown instead of applying the server-side default, so persisted-open or quick terminal opens fail until the user retries after agents load. Pass no agentId until a real agent id is known, or otherwise let the server resolve the default.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: telegram Channel integration: telegram cli CLI command changes agents Agent runtime and tooling extensions: codex extensions: policy labels Jul 4, 2026
Use supported chat.startStream authorship and avoid edit-based previews when custom identity cannot stream.

Co-authored-by: MoerAI <friendnt@g.skku.edu>
@steipete
steipete force-pushed the codex/fix-slack-stream-identity branch from cc4f44e to e856345 Compare July 4, 2026 22:47
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: telegram Channel integration: telegram app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: qa-lab extensions: codex extensions: policy labels Jul 4, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 4, 2026
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 4, 2026
@steipete
steipete merged commit be8b5f6 into main Jul 4, 2026
111 of 123 checks passed
@steipete
steipete deleted the codex/fix-slack-stream-identity branch July 4, 2026 22:56
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Landed as be8b5f6c4f5602474ac90229ca6dcc3d3bb982fd.

Verification:

  • node scripts/run-vitest.mjs extensions/slack/src/streaming.test.ts extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts — 106 tests passed.
  • Blacksmith Testbox tbx_01kwq9kbv377k5mhe81ghmsjja: build, changed extension production/test types, lint, guards, and import-cycle checks passed (run).
  • Fresh autoreview completed after the final deferred-stream fallback fix with no accepted/actionable findings.
  • Repository-native prepare/merge gates completed on the exact PR head.

Live Slack mutation proof was not captured because the approved desktop 1Password session timed out; no Slack message was sent during that attempt. Contract proof uses Slack's documented chat.startStream authorship fields and chat.update omission, plus pinned SDK types. Focused tests cover both native-stream identity and the final-post fallback.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 5, 2026
Use supported chat.startStream authorship and avoid edit-based previews when custom identity cannot stream.

Co-authored-by: MoerAI <friendnt@g.skku.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Agent display name/avatar reverts to bot default on edited Slack messages

1 participant