The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Revert "chore: review follow-ups — stale timeout comments, softer docs claim, group-turn cap credits only user-blocked intervals"
teknium1423eef696e8b
diff --git a/apps/desktop/src/plugins/hermes-bots/group-turns.ts b/apps/desktop/src/plugins/hermes-bots/group-turns.tsindex 8ed6420d007..60853841ee8 100644--- a/apps/desktop/src/plugins/hermes-bots/group-turns.ts+++ b/apps/desktop/src/plugins/hermes-bots/group-turns.ts@@ -1027,7 +1027,6 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<null// holds Desktop prompts until they are answered).let hardCap = started + GROUP_TURN_HARD_CAP_MSlet lastPolled = started- let wasAwaitingUser = false// After the terminal frame fires, the gateway still has to flip// session.running off in its turn `finally` — re-check quickly for a few// beats instead of falling back to the slow backstop cadence.@@ -1085,14 +1084,11 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<nullconst done = !busy && !awaitingUserconst polledAt = Date.now()- // Credit only intervals blocked on the user at both ends, not busy work- // that preceded the prompt.- if (awaitingUser && wasAwaitingUser) {+ if (awaitingUser) {hardCap += polledAt - lastPolled}lastPolled = polledAt- wasAwaitingUser = awaitingUser// The gateway's retained error for THIS turn. A turn that dies before its// prompt is committed (agent-init failure, no-agent refusal) never grows// the transcript, so the tombstone — not the message count — is the onlydiff --git a/apps/desktop/src/store/prompts.test.ts b/apps/desktop/src/store/prompts.test.tsindex 9b3c1e36091..b564bd4b171 100644--- a/apps/desktop/src/store/prompts.test.ts+++ b/apps/desktop/src/store/prompts.test.ts@@ -299,8 +299,8 @@ describe('answerApproval', () => {await answerApproval(gateway as never, target, 'once')- // #55433: the generic 30s default fires behind a stalled WS while the- // backend still applies the answer; the RPC carries a generous deadline.+ // #55433: the generic 30s default fires long before the backend's 300s+ // approvals.timeout; the RPC must carry an explicit longer deadline.expect(calls).toHaveLength(1)expect(calls[0][0]).toBe('approval.respond')expect(calls[0][2]).toBe(APPROVAL_RESPOND_REQUEST_TIMEOUT_MS)diff --git a/tests/tui_gateway/test_tui_gateway_server.py b/tests/tui_gateway/test_tui_gateway_server.pyindex b289d5da6fb..50c4d6392f1 100644--- a/tests/tui_gateway/test_tui_gateway_server.py+++ b/tests/tui_gateway/test_tui_gateway_server.py@@ -11714,6 +11714,7 @@ def test_prompt_submit_sets_approval_session_key(monkeypatch):assert resp["result"]["status"] == "streaming"assert captured["session_key"] == "session-key"assert captured["approval_wait"] > 1+ assert approval_context.approval_wait_seconds() == 1 # unbound again once the turn endsdef test_prompt_submit_expands_context_refs(monkeypatch):diff --git a/tools/approval.py b/tools/approval.pyindex 2c314cb6d84..21dc9e67066 100644--- a/tools/approval.py+++ b/tools/approval.py@@ -176,7 +176,7 @@ def resolve_gateway_approval(session_key: str, choice: str,def withdraw_gateway_approval(session_key: str, request_id: str, cause: str) -> bool:"""Withdraw one pending approval nobody can answer (the only attached client cannot render it).The waiter wakes at once with ``cancelled=cause`` — a withdrawal, never a user deny — instead of- idling on a prompt shown nowhere (#112548). False when it is no longer pending."""+ idling for the whole approvals.timeout (#112548). False when it is no longer pending."""with _lock:queue = _gateway_queues.get(session_key, [])entry = next((e for e in queue if e.data.get("request_id") == request_id), None)diff --git a/website/docs/user-guide/security.md b/website/docs/user-guide/security.mdindex 8e736bbbafa..4e05fed1672 100644--- a/website/docs/user-guide/security.md+++ b/website/docs/user-guide/security.md@@ -185,7 +185,7 @@ Deny rules are a shell-command policy, not a complete shell interpreter or an OS### Approval Timeout-In the CLI, the TUI and the Desktop app an approval prompt has no deadline: it stays up until you answer it, interrupt the turn (Ctrl+C / Stop), or close the session. The command does not run while it waits.+In the CLI, the TUI and the Desktop app an approval prompt has no deadline: it stays up until you answer it, interrupt the turn (Ctrl+C / Stop), or close the session. Nothing runs while it waits.On messaging platforms (and in ACP editors and approval transport plugins) the user has a configurable amount of time to respond. If no response is given within the timeout, the command is **denied** by default (fail-closed).