Skip to content

The agent that grows with you

fix: register approvals.discord_prompt_timeout in the default config

kshitijk4poorc73b595460e8
diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.py
index 14434ff9377..dc3378a6681 100644
--- a/hermes_cli/config_defaults.py
+++ b/hermes_cli/config_defaults.py
@@ -1660,11 +1660,9 @@ DEFAULT_CONFIG = {
# channel — a pending approval there just blocks for the full timeout with nobody to answer (#37284,
# #87509): deny — block the command instantly and let the agent find another way (default, safe;
# mirrors cron_mode deny) approve — auto-approve all dangerous commands on unattended platforms
- # Shared by the CLI prompt and gateway/messaging waits. Messaging approvals arrive as a push
- # notification the user may not see immediately — 60s proved too tight on Telegram/Discord (the
- # prompt expired before the user reached their phone), so the default is 300.
"mode": "smart",
"timeout": 300,
+ "discord_prompt_timeout": 300, # Discord buttons stay clickable (min 30 s, cap MAX_SAFE_TIMEOUT_S)
"cron_mode": "deny",
"single_query_mode": "deny",
"unattended_mode": "deny",
diff --git a/tests/gateway/test_discord_prompt_timeout_config.py b/tests/gateway/test_discord_prompt_timeout_config.py
index cb2810cb096..0a9778fb08f 100644
--- a/tests/gateway/test_discord_prompt_timeout_config.py
+++ b/tests/gateway/test_discord_prompt_timeout_config.py
@@ -114,3 +114,14 @@ async def test_all_prompt_types_use_owning_profile_discord_timeout(tmp_path):
view.stop()
finally:
reset_hermes_home_override(token)
+
+
+def test_configured_through_the_profiles_config_yaml(monkeypatch, tmp_path):
+ """The key is registered with its default and reaches the views from a real config.yaml."""
+ from hermes_cli.config import load_config
+
+ monkeypatch.setenv("HERMES_HOME", str(tmp_path))
+ assert load_config()["approvals"]["discord_prompt_timeout"] == _DISCORD_PROMPT_TIMEOUT_DEFAULT
+ (tmp_path / "config.yaml").write_text("approvals:\n discord_prompt_timeout: 1800\n")
+ assert _read_discord_prompt_timeout() == 1800
+ assert load_config()["approvals"]["discord_prompt_timeout"] == 1800
diff --git a/website/docs/user-guide/security.md b/website/docs/user-guide/security.md
index 7291e25f489..2e0d44d0373 100644
--- a/website/docs/user-guide/security.md
+++ b/website/docs/user-guide/security.md
@@ -46,6 +46,7 @@ The full set of keys:
|---|---|---|
| `mode` | `smart` | Approval policy for dangerous shell commands — see the table below. |
| `timeout` | `300` | Seconds Hermes waits for an approval reply before timing out. |
+| `discord_prompt_timeout` | `300` | Seconds Discord's interactive buttons (approvals, clarify, update and slash-command prompts) stay clickable; minimum 30. See [Discord](./messaging/discord.md). |
| `cron_mode` | `deny` | How [cron jobs](./features/cron.md) behave headlessly when they trigger a dangerous-command prompt. `deny` blocks the command (the agent must find another path); `approve` auto-approves everything in cron context. |
| `single_query_mode` | `deny` | How one-shot [`hermes chat -q`](./cli.md) sessions behave when they trigger a dangerous-command prompt. A `-q` session runs a single turn and exits with no user waiting to answer prompts; `deny` blocks the command (the agent must find another path), `approve` auto-approves everything in single-query context. Mirrors `cron_mode`. |
| `unattended_mode` | `deny` | How sessions on unattended programmatic platforms (webhook, msgraph_webhook, api_server) behave when they trigger a dangerous-command prompt. These surfaces have no human who can answer `/approve`, so instead of blocking for the full approval timeout, `deny` blocks the command instantly (the agent must find another path) and `approve` auto-approves everything in unattended context. Exception: an api_server session whose client can answer the card (`/v1/runs` and streaming chat completions, via `POST /v1/runs/{id}/approval`) still gets the approval request. Mirrors `cron_mode`. |