Skip to content

feat: add HIDE_TOOL_FILE_MESSAGES env var to suppress file edit documents#82

Merged
grinev merged 1 commit intogrinev:mainfrom
Paslestrange:feat/hide-tool-file-messages
Apr 14, 2026
Merged

feat: add HIDE_TOOL_FILE_MESSAGES env var to suppress file edit documents#82
grinev merged 1 commit intogrinev:mainfrom
Paslestrange:feat/hide-tool-file-messages

Conversation

@Paslestrange
Copy link
Copy Markdown
Contributor

@Paslestrange Paslestrange commented Apr 14, 2026

Summary

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.

Motivation

When the bot edits or writes files, it currently sends every change as a .txt document 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: Parse HIDE_TOOL_FILE_MESSAGES env var
  • src/bot/index.ts: Skip enqueueFile in setOnToolFile when the flag is true
  • .env.example: Document the new option
  • README.md: Add the new env var to the configuration table
  • tests/config.test.ts: Update tests to cover the new flag

Usage

HIDE_TOOL_FILE_MESSAGES=true

…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
@Paslestrange
Copy link
Copy Markdown
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 :)

@grinev
Copy link
Copy Markdown
Owner

grinev commented Apr 14, 2026

@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.

@grinev
Copy link
Copy Markdown
Owner

grinev commented Apr 14, 2026

@Paslestrange I think I will do rework leves of progress later, so I will approve this

@grinev grinev merged commit 6009873 into grinev:main Apr 14, 2026
1 check passed
luoyingwen pushed a commit to luoyingwen/opencode-chat-bot that referenced this pull request Apr 15, 2026
…ents (grinev#82)

- Add HIDE_TOOL_FILE_MESSAGES configuration option
- When set to true, hides file edit documents sent as .txt attachments
- Apply upstream commit 6009873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants