Skip to content

Feature request: option to suppress thinking-block relays (CCGRAM_HIDE_THINKING) #139

Description

@RedelRedel

Problem

With extended-thinking models (e.g. Claude with thinking enabled), every intermediate thinking block is relayed to Telegram as its own message. On a longer task this means a steady stream of notifications for content that is only scratch reasoning, not an actual answer.

CCGRAM_HIDE_TOOL_CALLS (added in #64) solved exactly this for tool_use/tool_result noise, but it does not cover thinking blocks: in handlers/messaging_pipeline/message_queue.py the hidden-filter only matches content_type in ("tool_use", "tool_result"), and the only gate for thinking messages is the 20-char minimum length in handlers/messaging_pipeline/message_routing.py (_MIN_THINKING_LENGTH). Verified against 4.1.0 and current main.

Proposal

A global env toggle, symmetric to the existing one:

CCGRAM_HIDE_THINKING=true

When set, thinking-type messages are dropped before relay; text replies, tool messages (subject to their own setting) and status updates are unaffected. A per-window override via the /verbose cycle would be a nice bonus, but the global env var alone already solves the pain.

Workaround I'm running now

Three-line local patch in message_routing.py:

_HIDE_THINKING = os.getenv("CCGRAM_HIDE_THINKING", "").lower() in ("1", "true", "yes")

# in handle_new_message, inside the per-user loop:
        if msg.content_type == "thinking":
            if _HIDE_THINKING:
                continue

Works fine, but gets wiped on every uv tool upgrade ccgram. Happy to turn this into a PR (including the config plumbing in config.py analogous to hide_tool_calls) if you'd take it.

Thanks for ccgram — the terminal-first design is exactly right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions