Skip to content

fix: pause typing indicator during approval waits - #5893

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-f1e32b74
Apr 7, 2026
Merged

fix: pause typing indicator during approval waits#5893
teknium1 merged 1 commit into
mainfrom
hermes/hermes-f1e32b74

Conversation

@teknium1

@teknium1 teknium1 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

When the agent waits for dangerous-command approval, the _keep_typing loop kept refreshing the typing indicator. On Slack's Assistant API, assistant_threads_setStatus disables the compose box while active — users literally cannot type /approve or /deny to respond to approval prompts. The approval message send briefly clears the status, but _keep_typing re-sets it within 2 seconds.

This was reported by Willard on the Nous Slack.

Changes

gateway/platforms/base.py:

  • Added _typing_paused: set to BasePlatformAdapter.__init__
  • _keep_typing skips send_typing when chat_id is in the paused set
  • New methods: pause_typing_for_chat() / resume_typing_for_chat() — thread-safe (CPython GIL)

gateway/run.py:

  • _approval_notify_sync: pauses typing before sending the approval prompt
  • _handle_approve_command: resumes typing after approval (agent continues)
  • _handle_deny_command: resumes typing after denial (agent continues with BLOCKED)

How it works

  1. Agent hits dangerous command → _approval_notify_sync fires → typing paused
  2. Approval message sent → auto-clears Slack's assistant status
  3. _keep_typing loop continues but skips send_typing → compose box stays unlocked
  4. User sends /approve or /deny → handler resumes typing → agent resumes
  5. If timeout, typing stays paused → agent finishes shortly → typing task cancelled in finally

Benefits all platforms, not just Slack — no reason to show typing while idle.

Tests

All 134 base adapter + Slack tests pass. All 16 non-pre-existing gateway approval tests pass. 6 pre-existing approval E2E failures confirmed unrelated (same on main).

When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/memory_setup.py
hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1
teknium1 merged commit ab0c1e5 into main Apr 7, 2026
3 of 4 checks passed
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
When the agent waits for dangerous-command approval, the typing
indicator (_keep_typing loop) kept refreshing. On Slack's Assistant
API this is critical: assistant_threads_setStatus disables the
compose box, preventing users from typing /approve or /deny.

- Add _typing_paused set + pause/resume methods to BasePlatformAdapter
- _keep_typing skips send_typing when chat_id is paused
- _approval_notify_sync pauses typing before sending approval prompt
- _handle_approve_command / _handle_deny_command resume typing after

Benefits all platforms — no reason to show 'is thinking...' while
the agent is idle waiting for human input.
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.

1 participant