fix(slack): extract text from bot message attachments when text is empty#1
Merged
Jimmy-xuzimo merged 7 commits intomainfrom Feb 26, 2026
Merged
fix(slack): extract text from bot message attachments when text is empty#1Jimmy-xuzimo merged 7 commits intomainfrom
Jimmy-xuzimo merged 7 commits intomainfrom
Conversation
- Add 'google' to the list of reasoning tag providers in provider-utils.ts - This fixes issue openclaw#26551 where google provider (used by gemini-api-key auth) was not being recognized for reasoning tag filtering - Add corresponding test case for google provider
- Fix issue openclaw#26643 where cache hit rate shows >100% (e.g., 1142%) - Use Math.min(100, ...) to cap the percentage display - This is a display-only fix for edge cases where cacheRead exceeds tokens used
- Fix issue openclaw#27533 where xAI grok thinking output leaks to users - Add 'xai' to the list of reasoning tag providers in provider-utils.ts - Add test case for xai provider
- Fix issue openclaw#27530 where openclaw skills list --json outputs malformed JSON - The emoji field contained raw ANSI terminal escape sequences - Added regex to strip ANSI codes from emoji field when JSON output is requested - Disabled eslint rule for the regex pattern (intentional control char match)
- Fix issue openclaw#27473 where gateway fails to start after Podman installation - Added dangerouslyAllowHostHeaderOriginFallback to the default openclaw.json generated by setup-podman.sh - This is needed because Podman/rootless containers bind to non-loopback addresses, triggering the origin check
Fix issue openclaw#27616: Bot messages with empty text property but content in attachments don't trigger sessions, even when allowBots: true is set. When monitoring webhooks (Prometheus Alertmanager, Gatus, etc.) send Slack messages with empty text and content in attachments[].text or attachments[].fallback, the message was being silently dropped because rawBody was empty. This fix adds botMessageAttachmentText extraction for bot messages with empty text but non-empty attachments, allowing these messages to be processed by the agent when allowBots: true.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Jimmy-xuzimo
pushed a commit
that referenced
this pull request
Mar 2, 2026
… and docs (openclaw#16761) Add inline file attachment support for sessions_spawn (subagent runtime only): - Schema: attachments[] (name, content, encoding, mimeType) and attachAs.mountPath hint - Materialization: files written to .openclaw/attachments/<uuid>/ with manifest.json - Validation: strict base64 decode, filename checks, size limits, duplicate detection - Transcript redaction: sanitizeToolCallInputs redacts attachment content from persisted transcripts - Lifecycle cleanup: safeRemoveAttachmentsDir with symlink-safe path containment check - Config: tools.sessions_spawn.attachments (enabled, maxFiles, maxFileBytes, maxTotalBytes, retainOnSessionKeep) - Registry: attachmentsDir/attachmentsRootDir/retainAttachmentsOnKeep on SubagentRunRecord - ACP rejection: attachments rejected for runtime=acp with clear error message - Docs: updated tools/index.md, concepts/session-tool.md, configuration-reference.md - Tests: 85 new/updated tests across 5 test files Fixes: - Guard fs.rm in materialization catch block with try/catch (review concern #1) - Remove unreachable fallback in safeRemoveAttachmentsDir (review concern openclaw#7) - Move attachment cleanup out of retry path to avoid timing issues with announce loop Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM> Co-authored-by: napetrov <napetrov@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem: Bot messages in Slack with empty
textproperty but content inattachmentsdon't trigger agent sessions, even whenallowBots: trueis set in channel config.Why it matters: Monitoring webhooks (Prometheus Alertmanager, Gatus, etc.) often send Slack messages with empty
textand all content inattachments. The agent should be able to react to these alerts whenallowBots: true.What changed: Added extraction of text from bot message attachments (
attachments[].textorattachments[].fallback) when the messagetextis empty. This is now included in therawBodycalculation for bot messages.What did NOT change (scope boundary):
resolveSlackAttachmentContentfunction behavior for forwarded messages is unchangedChange Type
Scope
Linked Issue/PR
User-visible / Behavior Changes
Before: Bot messages with
text: ""and content in attachments were silently ignored. No session was created.After: When
allowBots: true, bot messages now extract text from attachments[].text or attachments[].fallback when message text is empty, allowing these messages to trigger agent sessions.Security Impact
No)No)No)No)No)Repro + Verification
allowBots: truetextbut withattachmentscontaining text (like Prometheus Alertmanager webhook)Expected
allowBots: trueActual
prepare.test.tspassEvidence
Compatibility / Migration
Yes)No)No)Risks and Mitigations
allowBotscheck