The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Revert "feat(desktop): copy and Bot Mode group turns follow no-deadline prompts"
teknium1eb049af69c81
diff --git a/apps/desktop/src/app/settings/constants.ts b/apps/desktop/src/app/settings/constants.tsindex 012e72b9e29..4dd955dddb1 100644--- a/apps/desktop/src/app/settings/constants.ts+++ b/apps/desktop/src/app/settings/constants.ts@@ -621,7 +621,7 @@ export const FIELD_DESCRIPTIONS: Record<string, string> = defineFieldCopy({fileReadMaxChars: 'Maximum characters Hermes can read from one file request.',approvals: {mode: 'How Hermes handles commands that need explicit approval.',- timeout: 'How long approval prompts on messaging platforms wait before timing out. The app and the terminal wait until you answer.'+ timeout: 'How long approval prompts wait before timing out.'},security: {redactSecrets: 'Hide detected secrets from model-visible content when possible.'diff --git a/apps/desktop/src/i18n/ar_settings.ts b/apps/desktop/src/i18n/ar_settings.tsindex d0e41ff64cd..c457841071b 100644--- a/apps/desktop/src/i18n/ar_settings.ts+++ b/apps/desktop/src/i18n/ar_settings.ts@@ -483,7 +483,7 @@ export const arSettings = {'codeExecution.mode': 'مدى تقييد تنفيذ الكود بالمشروع الحالي.',fileReadMaxChars: 'أقصى عدد أحرف يستطيع Hermes قراءته من ملف واحد في الطلب.','approvals.mode': 'كيف يتعامل Hermes مع الأوامر التي تحتاج موافقة صريحة.',- 'approvals.timeout': 'مدة انتظار طلبات الموافقة على منصات المراسلة قبل انتهاء المهلة. التطبيق والطرفية ينتظران حتى تجيب.',+ 'approvals.timeout': 'مدة انتظار طلبات الموافقة قبل انتهاء المهلة.','security.redactSecrets': 'يخفي الأسرار المكتشفة من المحتوى المرئي للنموذج قدر الإمكان.','checkpoints.enabled': 'ينشئ لقطات رجوع قبل تعديلات الملفات.','memory.memoryEnabled': 'يحفظ ذكريات دائمة يمكن أن تساعد الجلسات القادمة.',diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.tsindex 6f76b03a24d..811fecda3df 100644--- a/apps/desktop/src/i18n/de.ts+++ b/apps/desktop/src/i18n/de.ts@@ -1516,7 +1516,7 @@ export const deOverrides = {fileReadMaxChars: 'Maximale Zeichenzahl, die Hermes aus einer Dateianfrage lesen kann.',approvals: {mode: 'Wie Hermes Befehle behandelt, die eine explizite Genehmigung benötigen.',- timeout: 'Wie lange Genehmigungsaufforderungen auf Messaging-Plattformen warten, bevor sie ablaufen. App und Terminal warten, bis du antwortest.'+ timeout: 'Wie lange Genehmigungsaufforderungen warten, bevor sie ablaufen.'},security: {redactSecrets: 'Erkannte Geheimnisse nach Möglichkeit aus modellsichtbarem Inhalt ausblenden.'diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 3d1e9444549..73a42481cbe 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -5310,7 +5310,7 @@ export const en: Translations = {},approval: {gatewayDisconnected:- 'Hermes is offline right now. The command is still waiting for your answer. Reconnect, then send it again.',+ 'Hermes is offline right now. The command is still waiting for your answer (until the approval timeout). Reconnect, then send it again.',sendFailed: 'Could not send your answer',reconnect: 'Reconnect',timedOutSystemLine:diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.tsindex 2cfd596682e..e5bc29478b4 100644--- a/apps/desktop/src/i18n/es.ts+++ b/apps/desktop/src/i18n/es.ts@@ -1517,7 +1517,7 @@ export const esOverrides = {fileReadMaxChars: 'Máximo de caracteres que Hermes puede leer en una solicitud de archivo.',approvals: {mode: 'Cómo maneja Hermes los comandos que necesitan aprobación explícita.',- timeout: 'Cuánto esperan los prompts de aprobación en plataformas de mensajería antes de vencer. La app y la terminal esperan hasta que respondas.'+ timeout: 'Cuánto esperan los prompts de aprobación antes de vencer.'},security: {redactSecrets: 'Oculta secretos detectados del contenido visible para el modelo cuando sea posible.'@@ -5690,7 +5690,7 @@ export const esOverrides = {},approval: {gatewayDisconnected:- 'Hermes está sin conexión ahora mismo. El comando sigue esperando tu respuesta. Reconéctate y vuelve a enviarla.',+ 'Hermes está sin conexión ahora mismo. El comando sigue esperando tu respuesta (hasta que se agote el tiempo de aprobación). Reconéctate y vuelve a enviarla.',sendFailed: 'No se pudo enviar tu respuesta',reconnect: 'Reconectar',timedOutSystemLine:diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.tsindex 60ac06efa16..f150bba1be9 100644--- a/apps/desktop/src/i18n/fr.ts+++ b/apps/desktop/src/i18n/fr.ts@@ -1521,7 +1521,7 @@ export const frOverrides = {fileReadMaxChars: 'Nombre maximal de caractères que Hermes peut lire dans une demande de fichier.',approvals: {mode: 'Comment Hermes gère les commandes nécessitant une approbation explicite.',- timeout: "Durée d'attente des invites d'approbation sur les plateformes de messagerie avant expiration. L'app et le terminal attendent votre réponse."+ timeout: "Durée d'attente des invites d'approbation avant expiration."},security: {redactSecrets: "Masque les secrets détectés du contenu visible par le modèle lorsque c'est possible."diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex af416a5ba28..c24a81c0a12 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -1050,7 +1050,7 @@ export const ja = defineLocale({fileReadMaxChars: 'Hermes が 1 回のファイル読み取りで取得できる最大文字数です。',approvals: {mode: '明示的な承認が必要なコマンドを Hermes がどう扱うかを設定します。',- timeout: 'メッセージングプラットフォームで承認プロンプトがタイムアウトするまで待つ時間です。アプリとターミナルは回答するまで待ちます。'+ timeout: '承認プロンプトがタイムアウトするまで待つ時間です。'},security: {redactSecrets: '検出したシークレットを、可能な限りモデルから見える内容から隠します。'diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.tsindex e1249d339af..e3709bd2f9b 100644--- a/apps/desktop/src/i18n/ru.ts+++ b/apps/desktop/src/i18n/ru.ts@@ -1082,7 +1082,7 @@ export const ru = defineLocale({fileReadMaxChars: 'Максимальное число символов, которые Hermes может прочитать из одного запроса к файлу.',approvals: {mode: 'Как Hermes обрабатывает команды, требующие явного подтверждения.',- timeout: 'Как долго запросы подтверждения в мессенджерах ждут перед тайм-аутом. Приложение и терминал ждут вашего ответа.'+ timeout: 'Как долго запросы подтверждения ждут перед тайм-аутом.'},security: {redactSecrets: 'Скрывать обнаруженные секреты из видимого для модели содержимого, когда это возможно.'diff --git a/apps/desktop/src/i18n/zh-hant_settings.ts b/apps/desktop/src/i18n/zh-hant_settings.tsindex c0996b45dab..2a9cc794224 100644--- a/apps/desktop/src/i18n/zh-hant_settings.ts+++ b/apps/desktop/src/i18n/zh-hant_settings.ts@@ -608,7 +608,7 @@ export const zhHantSettings = {fileReadMaxChars: 'Hermes 單次檔案讀取可讀取的最大字元數。',approvals: {mode: 'Hermes 如何處理需要明確批准的指令。',- timeout: '訊息平台上的批准提示逾時前等待的時間。App 與終端機會一直等到你回覆。'+ timeout: '批准提示逾時前等待的時間。'},security: {redactSecrets: '盡可能從模型可見內容中隱藏偵測到的密鑰。'diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 2bb89c04c23..9441541ec29 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -1212,7 +1212,7 @@ export const zh = defineLocale({fileReadMaxChars: 'Hermes 单次文件读取可读取的最大字符数。',approvals: {mode: 'Hermes 如何处理需要显式审批的命令。',- timeout: '消息平台上的审批提示在超时前等待的时长。应用和终端会一直等到你回复。'+ timeout: '审批提示在超时前等待的时长。'},security: {redactSecrets: '尽可能从模型可见内容中隐藏检测到的密钥。'diff --git a/apps/desktop/src/plugins/hermes-bots/group-turns.ts b/apps/desktop/src/plugins/hermes-bots/group-turns.tsindex 60853841ee8..9a6e5b21cf8 100644--- a/apps/desktop/src/plugins/hermes-bots/group-turns.ts+++ b/apps/desktop/src/plugins/hermes-bots/group-turns.ts@@ -807,8 +807,8 @@ export async function answerGroupClarify(try {if (entry.kind === 'approval') {- // A generous answer deadline, not the generic request timeout: a stalled- // socket must not reject an answer the backend still applies (#60654).+ // Ride the backend's approvals.timeout (300s default), not the generic+ // request timeout — the user owns the full approval window (#60654).await requestForBot(member,'approval.respond',@@ -1021,12 +1021,6 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<nullconst { member, thread, dispatchEpoch, stored, liveRuntime, runtimeIds, before, binding } = contextconst started = Date.now()let deadline = started + GROUP_TURN_TIMEOUT_MS- // The hard cap guards against a runaway member, not a human deciding: time- // a member spends blocked on the user's clarify/approval answer pushes it- // out, so a prompt left open never expires under the room (the backend- // holds Desktop prompts until they are answered).- let hardCap = started + GROUP_TURN_HARD_CAP_MS- let lastPolled = started// 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.@@ -1082,13 +1076,6 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<null// hold the turn open: the member isn't stalling, it's waiting on us.const awaitingUser = syncGroupClarify(context.group, member, thread, state)const done = !busy && !awaitingUser- const polledAt = Date.now()-- if (awaitingUser) {- hardCap += polledAt - lastPolled- }-- lastPolled = polledAt// 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 only@@ -1132,12 +1119,11 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<nullreturn null}- // Still visibly working — or waiting on the user's answer to a prompt:- // extend the deadline (never past the hard cap, which waiting on the user- // pushes out). A pending question must outlive the base turn timeout or- // it dies unanswered at 3 minutes.+ // Still visibly working — or waiting on the user's answer to a clarify:+ // extend the deadline (never past the hard cap). A pending question must+ // outlive the base turn timeout or it dies unanswered at 3 minutes.if (busy || awaitingUser) {- deadline = Math.min(hardCap, Math.max(deadline, polledAt + GROUP_TURN_TIMEOUT_MS))+ deadline = Math.min(started + GROUP_TURN_HARD_CAP_MS, Math.max(deadline, Date.now() + GROUP_TURN_TIMEOUT_MS))}}@@ -1145,10 +1131,10 @@ async function pollGroupMemberTurn(context: GroupTurnPollContext): Promise<nullreturn null}- // Timeout — clear any still-mirrored question card and read as a pass. The- // marker written at submit stays, so the finished reply is posted late into- // the RIGHT thread instead of vanishing; it stops being "live" when this- // poll returns.+ // Timeout — clear any still-mirrored question card (the server-side+ // clarify timeout runs its own course) and read as a pass. The marker written+ // at submit stays, so the finished reply is posted late into the RIGHT thread+ // instead of vanishing; it stops being "live" when this poll returns.recordGroupActivity(context.group, {kind: 'timed-out',member: groupMemberKey(member),diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.tsindex d90dd37c48e..f47dfa846af 100644--- a/apps/desktop/src/sdk/index.ts+++ b/apps/desktop/src/sdk/index.ts@@ -2059,9 +2059,9 @@ export type { ProfileSessionPreview, SessionListRow } from '@hermes/shared'/** THE compact-number formatter — every user-facing count/token figure goes* through here (1230 → "1.2k", 1_500_000 → "1.5M"). Don't hand-roll `/1000`. */export { compactNumber } from '@hermes/shared'-/** Client deadline for `approval.respond`, counted from the answer: generous so- * a plugin answering an approval never rejects its own RPC while the backend- * still applies the decision (#60654). */+/** Client deadline for `approval.respond`: matches the backend's+ * `approvals.timeout` (300s) so a plugin answering an approval never rejects+ * its own RPC while the backend still applies the decision (#60654). */export { APPROVAL_RESPOND_TIMEOUT_MS } from '@hermes/shared'/** Hermes' reasoning levels, so a plugin surfacing a thinking depth uses the* same scale as the rest of the app (labels: `reasoningEffortLabel`). */diff --git a/apps/desktop/src/store/prompts.ts b/apps/desktop/src/store/prompts.tsindex 659df0e52ee..fd0c253aae8 100644--- a/apps/desktop/src/store/prompts.ts+++ b/apps/desktop/src/store/prompts.ts@@ -345,13 +345,13 @@ export async function replayPendingApproval(gateway: ApprovalGateway | null, ses* surface. Returns after the backend has the decision.*/-// #55433: `approval.respond` otherwise rides the generic 30s RPC deadline. During-// a long LLM stream the gateway's WS writes can stall well past 30s while the-// turn is still live and the approval is still pending (the backend holds a-// Desktop approval until it is answered) — the client gave up with "request-// timed out: approval.respond" on an answer the backend went on to apply. Give-// the RPC a generous deadline (plus margin for the write to drain), and retry-// once on a deadline failure:+// #55433: the backend honors an answer for the whole `approvals.timeout` window+// (default 300s), but `approval.respond` otherwise rides the generic 30s RPC+// deadline. During a long LLM stream the gateway's WS writes can stall well past+// 30s while the turn is still live and the approval is still pending — the+// client gives up with "request timed out: approval.respond" long before the+// backend would. Give the RPC a deadline that covers the backend window (300s+// plus margin for the write to drain), and retry once on a deadline failure:// `resolve_gateway_approval` pops the queue entry before committing, so a// duplicate resolve is a harmless `resolved: 0`.export const APPROVAL_RESPOND_REQUEST_TIMEOUT_MS = 330_000diff --git a/apps/shared/src/json-rpc-gateway.ts b/apps/shared/src/json-rpc-gateway.tsindex a628caf1868..945a6d6e7d3 100644--- a/apps/shared/src/json-rpc-gateway.ts+++ b/apps/shared/src/json-rpc-gateway.ts@@ -38,12 +38,14 @@ export interface GatewayClientOptions {const ANY = '*'const DEFAULT_REQUEST_TIMEOUT_MS = 120_000-// `approval.respond` deadline, counted from the user's click. The prompt itself-// has no answer window — the backend holds a Desktop approval until it is-// answered — so this only bounds the answer's round trip, generously: during a-// long stream WS writes can stall well past the generic deadline while the-// decision still lands, and a client that gave up early froze on a card that was-// actually resolved (#60654, #55433).+// `approval.respond` rides the SAME deadline the backend grants the user to+// answer: tools/approval_context.py reads `approvals.timeout` (default 300s —+// gateway push notifications may not be seen for minutes). A shorter client+// timeout races that window: answer at t=130s and the frontend has already+// rejected its own RPC while the backend happily applies the decision — the+// desktop shows "request timed out" and freezes on a card that is actually+// resolved (#60654). Match the backend default so the client only gives up+// when the backend itself fails the approval closed.export const APPROVAL_RESPOND_TIMEOUT_MS = 300_000const isGatewayReady = (event: GatewayEvent): event is GatewayEvent<'gateway.ready'> => event.type === 'gateway.ready'