The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(gateway): null tool_progress inherits; name the task-card suppression latch
Victor Kyriazakosbc125d59d536
diff --git a/gateway/run_turn.py b/gateway/run_turn.pyindex e3dbf01a301..1fc77129cad 100644--- a/gateway/run_turn.py+++ b/gateway/run_turn.py@@ -2735,8 +2735,15 @@ class GatewayTurnMixin:for cfg, key in ((_platform_cfg, "tool_progress"), (_legacy_tp_overrides, platform_key)))progress_mode = _env_tp if _env_tp and not _tool_progress_configured else (_resolved_tp or _env_tp or "all")- # Operator intent vs tier default: True when a human wrote the mode (config or env).- _tool_progress_explicit = _tool_progress_configured or bool(_env_tp)+ # Operator intent vs tier default: True when a human WROTE a mode (config or env). A ``null``+ # value is inheritance, not intent — the resolver skips None (display_config.py), so a bare+ # key with no value must not read as "explicitly off".+ _tool_progress_explicit = bool(_env_tp) or any(+ isinstance(cfg, dict) and cfg.get(key) is not None+ for cfg, key in (+ (_display_cfg, "tool_progress"), (_platform_cfg, "tool_progress"), (_legacy_tp_overrides, platform_key),+ )+ )# "accumulate" (edit one bubble) or "separate" (one msg per tool)progress_grouping = resolve_display_setting(user_config, platform_key, "tool_progress_grouping") or "accumulate"_generic_status_recent: List[str] = []diff --git a/gateway/run_turn_runner.py b/gateway/run_turn_runner.pyindex c328fdd35a3..a1cfea73cfb 100644--- a/gateway/run_turn_runner.py+++ b/gateway/run_turn_runner.py@@ -319,11 +319,13 @@ class TurnRunner:task_order: List[str] = dataclasses.field(default_factory=list)fallback_msg_id: Optional[str] = Nonenative_failed: bool = False- # TERMINAL authorization refusal, distinct from native_failed: the- # connector refused this destination, so no later publication in this- # turn may re-deliver the task text through the text fallback. Declared- # rather than set dynamically so the state is visible where it lives.- egress_declined: bool = False+ # TERMINAL for the turn, distinct from native_failed: no later publication+ # in this turn may deliver task text through the native lane OR the text+ # fallback. Two causes, both properties of the destination rather than of+ # one attempt: the connector's egress guard refused the chat, or the chat+ # cannot host a card (no thread anchor). Declared rather than set+ # dynamically so the state is visible where it lives.+ publication_suppressed: bool = Falseanonymous_seq: int = 0@staticmethod@@ -369,7 +371,7 @@ class TurnRunner:text = st.fallback_text()from gateway.relay.egress import declined_send- if getattr(st, "egress_declined", False):+ if st.publication_suppressed:returnif st.fallback_msg_id:result = await st.adapter.edit_message(@@ -387,7 +389,7 @@ class TurnRunner:"guard; suppressing progress delivery for the rest of this ""turn (the destination is not approved)")- st.egress_declined = True+ st.publication_suppressed = Truereturnresult = await self._send_progress_text(st, text)if getattr(result, "success", False) and getattr(result, "message_id", None):@@ -397,9 +399,10 @@ class TurnRunner:ctx = self._ctxif not st.tasks:return- if getattr(st, "egress_declined", False):- # The connector refused this destination earlier in the turn; every- # later publication would re-deliver the same task text there.+ if st.publication_suppressed:+ # Publication was suppressed earlier in the turn (egress refusal or a chat+ # that cannot host a card); every later publication would re-deliver the+ # same task text there.returnif not st.native_failed:result = await st.adapter.send_native_task_card_progress(@@ -420,7 +423,7 @@ class TurnRunner:# event skipped this branch (the lane is already "failed") and# went straight to the text fallback. A refusal does not expire# after one tick.- st.egress_declined = True+ st.publication_suppressed = Truest.native_failed = Truelogger.warning("Slack native task-card progress DECLINED by the connector's "@@ -432,9 +435,10 @@ class TurnRunner:if _card_destination_unsupported(result):# The destination itself cannot host a card (flat DM: no thread anchor). This is# a property of the chat, not a transient outage, and it repeats on every event.- # Degrading to text would deliver tool progress the operator never enabled- # (Slack's default is off), so the lane goes silent for this turn.- st.egress_declined = True+ # The text fallback exists to keep a WORKING card lane live through a transient+ # native failure, not to turn an un-cardable chat into text bubbles; the lane+ # goes silent for this turn whatever the configured mode.+ st.publication_suppressed = Truelogger.info("Slack native task cards are unsupported for this destination ""(%s); tool progress stays off for this turn",diff --git a/tests/gateway/test_decline_fallback_suppression.py b/tests/gateway/test_decline_fallback_suppression.pyindex 7e38ed6308a..b4f83ad738f 100644--- a/tests/gateway/test_decline_fallback_suppression.py+++ b/tests/gateway/test_decline_fallback_suppression.py@@ -207,6 +207,7 @@ def _card_state(adapter: _CardAdapter):return SimpleNamespace(tasks=[{"text": "step"}],native_failed=False,+ publication_suppressed=False,visible_tasks=lambda: [{"text": "step"}],fallback_text=lambda: "step",adapter=adapter,@@ -355,11 +356,11 @@ def test_task_card_fallback_edit_decline_does_not_send_progress_text():fallback_msg_id="m0",fallback_text=lambda: "task text",adapter=adapter,- egress_declined=False,+ publication_suppressed=False,)asyncio.run(runner._task_card_send_or_edit_fallback(st))assert adapter.ops == ["edit"]assert sent == []- assert st.egress_declined is True+ assert st.publication_suppressed is Truediff --git a/tests/gateway/test_run_progress_topics.py b/tests/gateway/test_run_progress_topics.pyindex 2cb9c772cb6..5591d16f576 100644--- a/tests/gateway/test_run_progress_topics.py+++ b/tests/gateway/test_run_progress_topics.py@@ -1175,6 +1175,39 @@ async def test_slack_operator_tool_progress_off_disables_task_cards(monkeypatch,assert adapter.edits == []+ "display_cfg",+ [+ {"platforms": {"slack": {"tool_progress": None}}},+ {"tool_progress": None},+ {"tool_progress_overrides": {"slack": None}},+ # null at the platform level over a global "all": the platform inherits "all", cards stay.+ {"tool_progress": "all", "platforms": {"slack": {"tool_progress": None}}},+ ],+ ids=["platform-null", "global-null", "legacy-null", "platform-null-over-global-all"],+)+async def test_slack_null_tool_progress_is_inheritance_not_explicit_off(monkeypatch, tmp_path, display_cfg):+ # A bare key with ``null`` inherits (the resolver skips None); it is not an operator saying "off".+ adapter, result = await _run_with_agent(+ monkeypatch,+ tmp_path,+ DuplicateNativeToolsAgent,+ session_id="sess-native-null",+ config_data={"display": display_cfg},+ platform=Platform.SLACK,+ chat_id="C1",+ thread_id="thread-1",+ adapter_cls=NativeTaskCardAdapter,+ user_id="U1",+ scope_id="T1",+ )++ assert result["final_response"] == "done"+ assert adapter.native_updates+ assert adapter.native_stops == 1++@pytest.mark.asyncioasync def test_slack_operator_tool_progress_new_keeps_task_cards(monkeypatch, tmp_path):# An explicit non-off mode keeps the native card lane engaged (text lane stays swallowed by it).diff --git a/website/docs/user-guide/messaging/slack.md b/website/docs/user-guide/messaging/slack.mdindex 65caa90e27c..f82070c7394 100644--- a/website/docs/user-guide/messaging/slack.md+++ b/website/docs/user-guide/messaging/slack.md@@ -429,10 +429,11 @@ platforms:# Requires rich_blocks: true. Default: false.feedback_buttons: false- # Render live tool calls as Slack-native plan/task cards. This explicit- # opt-in activates native progress even when text tool_progress is off.- # If Slack rejects the native stream, Hermes keeps one editable text- # fallback current for the rest of the turn.+ # Render live tool calls as Slack-native plan/task cards. Works with+ # Slack's built-in tool_progress: off default; a tool_progress: off you+ # write yourself disables cards too. Cards need a thread: an un-threaded+ # chat shows no tool progress. Recoverable native API failures keep one+ # editable text fallback current for the rest of the turn.native_task_cards: false# Suggested prompts pinned at the top of Agent view's Messages tab.@@ -468,7 +469,7 @@ platforms:| `platforms.slack.extra.unfurl_media` | Slack default | Set to `false` to suppress automatic media previews while preserving clickable links. Same caption-ordering and streaming notes as `unfurl_links`. || `platforms.slack.extra.rich_blocks` | `false` | When `true`, agent messages are rendered as [Block Kit](https://docs.slack.dev/block-kit/) blocks (headers, dividers, true nested lists, and native tables). A plain-text fallback is always sent. Tables over Slack's limits fall back to aligned monospace. No app reinstall required — it's a send-side change only. || `platforms.slack.extra.feedback_buttons` | `false` | When `true` with `rich_blocks`, appends Slack-native feedback controls to final replies. |-| `platforms.slack.extra.native_task_cards` | `false` | When `true`, renders live tool calls as Slack-native plan/task cards. Cards work with Slack's built-in default `tool_progress: off`; an explicitly configured `display.tool_progress: off` (global or `display.platforms.slack`) disables cards too. Native API failures fall back to one continuously edited text update; chats that cannot host a card (flat DMs with `reply_in_thread: false`) show no tool progress. |+| `platforms.slack.extra.native_task_cards` | `false` | When `true`, renders live tool calls as Slack-native plan/task cards. Cards work with Slack's built-in default `tool_progress: off`; an explicitly configured `display.tool_progress: off` (global or `display.platforms.slack`; `/verbose` writes the same key) disables cards too. Cards need a thread: when the card lane is active and the chat has no thread to anchor on (a top-level DM with `reply_in_thread: false`), Hermes shows no tool progress instead of text bubbles. Recoverable native API failures fall back to one continuously edited text update. || `platforms.slack.extra.suggested_prompts` | `[]` | Up to four `{title, message}` prompts for Agent/Assistant DM entry points; accepts either a list or `{title, prompts}`. || `platforms.slack.extra.assistant_thread_titles` | `true` | When `true`, names Agent/Assistant DM threads from the first user message. || `platforms.slack.extra.allow_bots` | `"none"` | Controls messages from other Slack bots: `"none"` ignores them, `"mentions"` accepts a bot message only when **that message itself** @mentions Hermes, and `"all"` accepts all of them. Use `"mentions"` for the safest bot-to-bot collaboration mode. See [Accepting messages from other bots](#accepting-messages-from-other-bots-allow_bots). |@@ -575,17 +576,20 @@ platforms:```- Cards are the Slack rendering of tool progress. They work with Slack's- built-in default `tool_progress: off` (text bubbles spam channels; native- cards don't). Writing `tool_progress: off` yourself, globally or under- `display.platforms.slack`, turns cards off as well; `new` or `all` keeps- them.-- Cards need a thread. In flat DMs (`reply_in_thread: false`) Slack cannot- render them, and Hermes shows no tool progress rather than degrading to text- bubbles you did not enable.+ built-in default `tool_progress: off`. Writing `tool_progress: off` yourself+ (globally, under `display.platforms.slack`, or by cycling `/verbose` to off)+ turns cards off as well; `new` or `all` keeps them. A `null` value inherits+ and is not an "off".+- Cards need a thread. With the card lane active, a chat that has no thread to+ anchor on (a top-level DM under `reply_in_thread: false`) shows no tool+ progress at all rather than text bubbles; replies inside an existing thread+ still get cards.- Concurrent calls to the same tool are correlated by real tool-call ID, soparallel `web_search` calls each get their own row with the right status.-- If the native stream can't start or update, Hermes falls back to a single- continuously edited text message so progress stays live for the turn.+- If the native stream fails for a recoverable reason (API error, rate+ limit), Hermes falls back to a single continuously edited text message so+ progress stays live for the turn. A relay egress refusal of the destination+ is not recoverable and suppresses progress for the turn.- The card stream is stopped exactly once when the turn finalizes, includingon interrupt/disconnect, so no dangling live indicator is left behind.