From fc956b9db6efeb889cad27a8b6552130aa51bc12 Mon Sep 17 00:00:00 2001 From: Wolfram Ravenwolf Date: Tue, 14 Apr 2026 17:15:57 +0200 Subject: [PATCH] feat: add tool_progress_style config (accumulate vs separate) Add display.tool_progress_style setting to control how tool progress messages are displayed in chat platforms: - 'accumulate' (default): Edit a single message with all tool calls (new v0.9.0 behavior) - 'separate': Send each tool call as its own message, interleaved with thinking messages (pre-v0.9 behavior, better readability) The setting participates in the per-platform display override system and can be set globally or per-platform. Files: gateway/display_config.py, gateway/run.py --- gateway/display_config.py | 4 ++++ gateway/run.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gateway/display_config.py b/gateway/display_config.py index 5daab9f23c9..4d9daceeac1 100644 --- a/gateway/display_config.py +++ b/gateway/display_config.py @@ -32,6 +32,7 @@ from typing import Any _GLOBAL_DEFAULTS: dict[str, Any] = { "tool_progress": "all", + "tool_progress_style": "accumulate", # "accumulate" = edit single msg; "separate" = one msg per tool "show_reasoning": False, "tool_preview_length": 0, "streaming": None, # None = follow top-level streaming config @@ -238,6 +239,9 @@ def _normalise(setting: str, value: Any) -> Any: if isinstance(value, str): return value.lower() in {"true", "1", "yes", "on"} return bool(value) + if setting == "tool_progress_style": + val = str(value).lower() + return val if val in ("accumulate", "separate") else "accumulate" if setting == "tool_preview_length": try: return int(value) diff --git a/gateway/run.py b/gateway/run.py index 2c8f14008da..687f898437f 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -13624,6 +13624,8 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew if _env_tp and not _tool_progress_configured else (_resolved_tp or _env_tp or "all") ) + # Tool progress style: "accumulate" (edit single msg) or "separate" (one msg per tool) + progress_style = resolve_display_setting(user_config, platform_key, "tool_progress_style") or "accumulate" # Disable tool progress for webhooks - they don't support message editing, # so each progress line would be sent as a separate message. from gateway.config import Platform @@ -13930,7 +13932,7 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew progress_lines = [] # Accumulated tool lines for the CURRENT editable bubble progress_msg_id = None # ID of the current progress message to edit - can_edit = True # False once an edit fails (platform doesn't support it) + can_edit = progress_style != "separate" # "separate" = one message per tool (pre-v0.9 behavior) _last_edit_ts = 0.0 # Throttle edits to avoid Telegram flood control _PROGRESS_EDIT_INTERVAL = 1.5 # Minimum seconds between edits