fix(discord): preserve embed title in fallback message text#26946
Merged
shakkernerd merged 3 commits intoopenclaw:mainfrom Feb 25, 2026
Merged
fix(discord): preserve embed title in fallback message text#26946shakkernerd merged 3 commits intoopenclaw:mainfrom
shakkernerd merged 3 commits intoopenclaw:mainfrom
Conversation
ea06cee to
b72169c
Compare
b72169c to
d78d985
Compare
This was referenced Feb 26, 2026
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.
Closes #26907
Problem
Discord embed messages with both a title and description were passed to the agent with only the description, so important context in the title was silently lost.
Root Cause
resolveDiscordMessageText()only readmessage.embeds?.[0]?.descriptionin the fallback chain and did not includetitleor combine the two fields.Fix
Add a small embed-text helper that trims and joins
title+descriptionwith a newline (when both exist), then reuse it for primary message text and forwarded snapshot embed text while preserving existing content/media/fallback precedence.Testing
pnpm install --frozen-lockfile --ignore-scriptspnpm exec vitest run src/discord/monitor/message-utils.test.ts --config vitest.unit.config.ts(19 tests passed, including new title/description regression cases)Greptile Summary
Created a new helper function
resolveDiscordEmbedTextthat properly combines embed title and description fields with a newline separator when both exist. Previously,resolveDiscordMessageTextonly read the description field and completely ignored the title, causing important context to be silently lost. The snapshot message handler had similar issues - it would only return the title if description was empty, never combining them.The fix consolidates embed text resolution into a single reusable helper that handles all edge cases (null, undefined, empty strings, whitespace) correctly and applies consistent behavior across both message and snapshot handling. The implementation correctly preserves the content precedence chain (content > media placeholders > embed text > fallback).
Four comprehensive regression tests were added to ensure the fix works correctly and prevent this issue from recurring.
Confidence Score: 5/5
Last reviewed commit: ea06cee