← Back to PRs

#18940: Agents: expose message tool buttons schema in scoped contexts

by saurabhchopade open 2026-02-17 06:11 View on GitHub →
channel: mattermost agents size: XS
## Summary #18930 Fix message tool schema parity with CLI by keeping Buttons available in scoped tool schemas when any configured channel supports inline/message buttons. ## Changes - Keep Buttons in createMessageTool scoped schema generation using global button capability detection. - Update e2e schema scoping expectation for Discord scope to ensure Buttons remains available. ## Validation - corepack pnpm test:e2e src/agents/tools/message-tool.e2e.test.ts - Result: 11 tests passed. <!-- greptile_comment --> <h3>Greptile Summary</h3> Changed button schema inclusion from channel-specific to global capability detection. The `buildMessageToolSchema` function now uses `supportsChannelMessageButtons` (global check) instead of `supportsChannelMessageButtonsForChannel` (scoped check), allowing Telegram inline buttons to remain available in the tool schema even when scoped to other channels for cross-channel message sends. - Removed unused import `supportsChannelMessageButtonsForChannel` - Updated test expectation: Discord-scoped schema now includes buttons field - Maintains parity with CLI behavior where buttons are globally available <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The change is well-isolated, properly tested with updated e2e tests that pass, and has a clear purpose (fixing schema parity with CLI). The logic change is straightforward - switching from channel-specific to global button capability detection. The unused import is correctly removed, maintaining clean code. The implementation aligns with the stated goal and the test update correctly reflects the new behavior. - No files require special attention <sub>Last reviewed commit: 2aaa554</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs