feat: add HIDE_TOOL_FILE_MESSAGES env var to suppress file edit documents#82
Merged
grinev merged 1 commit intogrinev:mainfrom Apr 14, 2026
Merged
Conversation
…ents Adds a new HIDE_TOOL_FILE_MESSAGES configuration flag that prevents the bot from sending edit_*.txt and write_*.txt code file attachments to Telegram. This is useful for users who find the per-edit document notifications noisy and prefer to rely on the pinned diff summary and streaming text responses instead. - Parse HIDE_TOOL_FILE_MESSAGES in config.ts - Skip enqueueFile in setOnToolFile when flag is true - Update .env.example, README.md, and tests
Contributor
Author
|
Hi @grinev, I've created this PR to reduce some noise in the chat. In my case the edits are causing a lot of messages, which bloat the notifications and the chat. If you think this is helpful, please have a look :) |
Owner
|
@Paslestrange thanks for PR. I've tested locally, I set HIDE_TOOL_FILE_MESSAGES=true, and I expected to see edit messages like ✏️ edit src\main\kotlin\ru\grinev\service\ChatService.kt (+8) but without file attachments. But I did't see any messages about file edits. That's not acceptable. Please change flag name to HIDE_FILE_CHANGES_ATTACHMENTS and if it is true, files with diffs won't be send, but you see edit/write/patch messages. |
Owner
|
@Paslestrange I think I will do rework leves of progress later, so I will approve this |
luoyingwen
pushed a commit
to luoyingwen/opencode-chat-bot
that referenced
this pull request
Apr 15, 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.
Summary
Adds a new
HIDE_TOOL_FILE_MESSAGESconfiguration flag that prevents the bot from sendingedit_*.txtandwrite_*.txtcode file attachments to Telegram.Motivation
When the bot edits or writes files, it currently sends every change as a
.txtdocument to Telegram. For users working on larger tasks, this creates a lot of noise in the chat. This PR gives users an opt-in way to suppress those file-edit documents while still receiving all streaming text responses and pinned diff summaries.Changes
src/config.ts: ParseHIDE_TOOL_FILE_MESSAGESenv varsrc/bot/index.ts: SkipenqueueFileinsetOnToolFilewhen the flag istrue.env.example: Document the new optionREADME.md: Add the new env var to the configuration tabletests/config.test.ts: Update tests to cover the new flagUsage