fix(agent-chat): guard integration lookup in manualPosting modal#1688
Open
giladresisi wants to merge 1 commit into
Open
fix(agent-chat): guard integration lookup in manualPosting modal#1688giladresisi wants to merge 1 commit into
giladresisi wants to merge 1 commit into
Conversation
The manualPosting CopilotKit action builds its modal from the channels the user has selected in the agent-chat sidebar (PropertiesContext). It read `properties.find(...).picture` with no null check, so whenever the referenced integration isn't in that selected list the lookup returns undefined and `.picture` throws, white-screening the chat. This is reachable whenever the agent opens the modal for an integration the user hasn't selected in the sidebar (e.g. asking it to open a modal for an existing post's channel). Guard with optional chaining so the modal degrades to an empty picture instead of crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Contribution-checker quality warning Heuristics that flagged:
If this is a genuine contribution, please add detail to your PR description and tighten the diff scope before reviewers look at it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Problem
Opening the agent-chat "populated modal" (the
manualPostingCopilotKit action) can white-screen the whole chat with:manualPostingbuilds the modal fromproperties— the channels the user has selected in the agent-chat sidebar (PropertiesContext, fed byAgentList). It looked up the integration withproperties.find(...).pictureand no null guard. Whenever the action references an integration that isn't in the selected list,findreturnsundefinedand.picturethrows.This is reachable any time the agent opens the modal for a channel the user hasn't selected in the sidebar — e.g. asking the agent to open a modal for an existing post's channel.
Fix
One-character defensive guard —
properties.find(...)?.picture || ''— so the modal degrades to an empty picture instead of crashing. No behavior change when the integration is present.Notes
Pre-existing latent crash, independent of any specific feature. Small and self-contained.
🤖 Generated with Claude Code