Skip to content

[BUG] Frontend crash : tapClientLookup Index out of bounds when tool returns unexpected data #44562

Closed as duplicate

Description

@Huangwenboiiii

Bug Description

Hermes Desktop GUI 前端在工具返回非预期数据结构时,出现 tapClientLookup: Index out of bounds 错误,导致界面卡死/白屏,看起来像程序崩溃。

Steps to Reproduce

在 Hermes Desktop GUI 中使用 skill_manage、memory 或 cronjob 等工具
当工具返回的数据格式与前端预期不一致时
前端抛出 tapClientLookup: Index X out of bounds (length: N) 错误
聊天界面渲染异常,可能卡死或白屏

Expected Behavior

工具调用返回后,前端正常渲染对话消息和工具结果,界面保持响应。即使工具返回非标准或空结果,前端也不应崩溃。

Actual Behavior

工具返回非预期数据结构时,前端抛出 tapClientLookup: Index X out of bounds (length: N) 错误,React 触发 error-boundary。表现为聊天界面白屏、消息渲染失败或界面卡死。

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

OS: Windows 10
Hermes Desktop Version: 检查设置里的版本号
Browser: 内置 Chromium (Electron)
Model Provider: custom (agnes-2.0-flash)
Logs: C:\Users\Administrator\AppData\Local\hermes\logs\desktop.log

Operating System

Windows 11

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

错误发生在 index-CFGMLHc8.js:801:11970 的 Nqt 函数中
错误发生在 UserMessage React 组件渲染时
触发频率:在多次工具调用失败后容易出现(日志中观察到 6 次)
环境:Windows 10, Hermes Desktop GUI
日志文件位置:C:\Users\Administrator\AppData\Local\hermes\logs\desktop.log

[hermes] [renderer console] Error: tapClientLookup: Index 67 out of bounds (length: 17) [hermes] [renderer console] [error-boundary:root] Error: tapClientLookup: Index 67 out of bounds (length: 17) at Nqt (file:///.../index-CFGMLHc8.js:801:11970) at UserMessage () at oEe (file:///.../index-CFGMLHc8.js:70:56089) at Ok (file:///.../index-CFGMLHc8.js:68:26113)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. Huangwenboiiii commented on Jun 12, 2026

    @Huangwenboiiii
    Author
  2. added
    type/bugSomething isn't working
    P3Low — cosmetic, nice to have
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    on Jun 12, 2026
  3. AIalliAI commented on Jun 12, 2026

    @AIalliAI

    Verified — the crash is real, but this is a duplicate of #41693, and the fix already landed on main a couple of hours before this issue was filed.

    Verification against your logs:

    Fix: PR #44493 (merged 2026-06-11T22:52Z, commit d221e36) adds a MessageRenderBoundary around each message in apps/desktop/src/components/assistant-ui/thread-virtualizer.tsx. It swallows this specific transient throw and recovers on the next consistent snapshot instead of unwinding to the root boundary, so the app no longer goes blank.

    One correction on the trigger: the error isn't caused by tools "returning unexpected data structures". tapClientLookup is internal to the @assistant-ui/store dependency — it throws (instead of returning undefined) when a still-subscribed component reads a stale index against a replaced, shorter message/parts list (upstream: assistant-ui/assistant-ui#4051, assistant-ui/assistant-ui#3652). Bursts of failing tool calls just mutate the message list fast enough to hit that race; the tool output content is irrelevant.

    What to do: update to a Hermes Desktop build at or after commit d221e369 (any build from main after 2026-06-11T22:52Z).

    Recommend closing this as a duplicate of #41693 / fixed by #44493.

  4. tamio0800 commented on Jun 12, 2026

    @tamio0800

    Looking at the logs you shared — there's a compression event right before the crash:

    compressed 418 → 11 msgs, ~144,716 → ~1,348 tokens
    

    The error is Index 67 out of bounds (length: 17). Index 67 lines up with the pre-compression history size; length 17 is post-compression. My guess is the frontend's tool-call index cache doesn't reset when auto-compression fires, so the next render tries to dereference a position that no longer exists.

    Quick way to confirm: reproduce in a session that triggers compression, then call a tool immediately after. If the crash only happens post-compression, that's the culprit — not the specific tools (skill_manage, memory, etc.).

  5. added
    comp/desktopElectron desktop app (apps/desktop/*)
    duplicateThis issue or pull request already exists
    and removed
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    on Jun 27, 2026
  6. alt-glitch commented on Jun 27, 2026

    @alt-glitch

    This was generated by AI during triage.

    Duplicate of #45403 (the open canonical issue for this tapClientLookup: Index N out of bounds desktop crash — same @assistant-ui/store index race). The crash is real and was verified in this thread, and the fix has already landed on main via #44493 / salvage #52704 (which closes the earlier #41693). Tracking the fix on #45403.

  7. mrZhangTianye commented on Jul 4, 2026

    @mrZhangTianye

    I’m hitting the same issue on macOS. Simple chat works, but any terminal/skill/tool invocation hangs or breaks the desktop UI.

    Observed logs:

    • tapClientLookup: Index 4 out of bounds (length: 0)
    • slash_worker appears during tool calls
    • terminal/execute_code tool calls may enter approval_pending or fail silently
    • desktop app becomes unresponsive after tool/skill invocation

    Repro:

    1. Open Hermes Desktop
    2. Send: "用 terminal 执行 echo hello,并返回结果。"
    3. Simple chat replies, but terminal/tool call does not return; UI may hang.

    This looks related to #44562 and #45403. Is PR #58110 expected to fix this, and is there a released build containing it?

  8. GottZ commented on Aug 3, 2026

    @GottZ

    This was generated by AI during triage.

    Summary

    Three PRs address the stale assistant-ui lookup race behind #44562 or its root-boundary fallout: #41787 adds unbounded root recovery, #52704 adds bounded root recovery, and #64310 restores and updates that bounded recovery after its removal from main. The contributor evidence identifies #44562 as a duplicate of the broader crash tracked in #45403 rather than a malformed tool-result bug.

    Related pull requests

    Duplicates

    #41787 and #52704 implement substantially the same root-boundary mitigation, with #52704 superseding #41787 by bounding retries; #64310 is the current restoration and extension of the #52704 implementation after its removal from main.

    Suggested consolidation

    Keep #64310 open with a salvage path: retain its restored bounded root-only recovery, current-and-legacy lookup matcher, StrictMode handling, and focused regression coverage. Treat merged #52704 as the best existing fix and reference implementation, keep closed #41787 as superseded by #52704, and consolidate #44562 under canonical race issue #45403 while #64308 tracks the removal regression.

    Complex graph

    flowchart LR
        classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
        classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
        classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
        classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
        classDef best stroke-width:3px,stroke:#b45309
        classDef target stroke-width:3px,stroke:#4338ca
        I41693(["issue #41693 (closed)"])
        I44562(["issue #44562 (open)"])
        I64308(["issue #64308 (open)"])
        subgraph Dup41787 ["PRs duplicating each other"]
            P41787["PR #41787 (closed)"]
            P52704["PR #52704 (merged)"]
            P64310["PR #64310 (open)"]
        end
        P41787 -.->|partial| I44562
        P52704 -->|best fix| I44562
        P64310 -->|fixes| I44562
        P41787 -.->|partial| I41693
        P52704 -->|best fix| I41693
        P64310 -->|fixes| I41693
        P41787 -.->|partial| I64308
        P52704 -->|fixes| I64308
        P64310 -->|best fix| I64308
        class I41693 closed
        class I44562 open
        class I64308 open
        class I44562 target
        class P41787 closed
        class P52704 merged
        class P64310 open
        class P52704 best
        class P52704 best
        class P64310 best
        click I41693 "https://github.com/NousResearch/hermes-agent/issues/41693"
        click I44562 "https://github.com/NousResearch/hermes-agent/issues/44562"
        click I64308 "https://github.com/NousResearch/hermes-agent/issues/64308"
        click P41787 "https://github.com/NousResearch/hermes-agent/pull/41787"
        click P52704 "https://github.com/NousResearch/hermes-agent/pull/52704"
        click P64310 "https://github.com/NousResearch/hermes-agent/pull/64310"
    
    Loading

    Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

    Cross-PR triage: Reviewed 3 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 28 kB of PR diffs, 26 kB of issue/PR text, 16 kB of discussion (14 comments), 14 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  9. teknium1 commented on Sep 14, 2026

    @teknium1
    Collaborator

    Closing as duplicate of #45403, which stays open as the canonical tracker for the @assistant-ui lookup-race class. The message-render and root/contrib boundary recoveries are on main via c4ba4770eb (#52704) and df7e1784c7 (#81232, @OutThisLife); remaining variants are tracked in #45403.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/desktopElectron desktop app (apps/desktop/*)duplicateThis issue or pull request already existssweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions