#10712: feat(discord): add compact mode for message reads
agents
stale
Cluster:
Discord Message Enhancements
Add a 'compact' parameter to the message tool's read action for Discord. When enabled, returns only essential fields (id, content, author, authorId, timestamp) instead of the full Discord API response.
This reduces token usage by ~90% for bulk message reads, preventing context overflow when reading channel history.
Changes:
- Add readBooleanParam helper to common.ts
- Add compact option to message tool fetch schema
- Add compactMessage() function in discord-actions-messaging.ts
- Wire compact param through handle-action.ts to the messaging handler
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Adds a `compact` boolean parameter to the Discord `message` tool read path and wires it through the Discord action handler.
- Introduces a shared `readBooleanParam` helper for parsing boolean-ish params.
- Implements `compactMessage()` to return a reduced message payload for bulk reads to reduce token usage.
- Updates the message tool fetch schema to expose the new `compact` option.
<h3>Confidence Score: 4/5</h3>
- This PR is close to merge-ready but needs a small contract/behavior alignment fix for the new `compact` output.
- Changes are localized and straightforward (new param plumbed through + helper + compact mapping). The main concern is a user-visible mismatch between documented compact output shape and what `compactMessage()` actually returns, which should be resolved before merging.
- src/agents/tools/discord-actions-messaging.ts and src/agents/tools/message-tool.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9984: feat: Add Discord embed support to message action schema
by UltimateBrent · 2026-02-05
76.7%
#19917: feat(discord): allow disabling intermediate status reactions
by Gitjay11 · 2026-02-18
75.8%
#15864: feat: add deliverOnlyToolMessages config for clean messaging channe...
by gandalf-the-engineer · 2026-02-14
75.2%
#12950: feat: add Telegram pin/unpin message support
by alex-muradov · 2026-02-09
73.6%
#14367: feat(telegram): add message read via inbound message store
by michaelquinlan88 · 2026-02-12
72.7%
#12074: feat(discord): enhanced forum post creation with multi-tag support
by xiaoyaner0201 · 2026-02-08
72.4%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
72.2%
#8753: fix(telegram): add config option to disable acknowledgments
by revenuestack · 2026-02-04
72.2%
#23158: discord: harden preflight/reply path against slow lookup latency
by danielstarman · 2026-02-22
72.2%
#20913: fix: intercept Discord embed images to enforce mediaMaxMb
by MumuTW · 2026-02-19
71.9%