Skip to content

[Bug] "tapClientLookup: Index 1 out of bounds (length: 0)" & "MessagePartText can only be used inside text or reasoning message parts" & "Duplicate key toolCallId" #10288

Closed

Description

@frostyautumnleaf

The Issues

Issue 1. Sometimes randomly when clicking "New chat" the program just crashes with the message tapClientLookup: Index 1 out of bounds (length: 0) and needs to be restarted.

Image

Issue 2. When I started a generation in a project and I clicked on a previous chat from the sidebar, the program crashed with the message: MessagePartText can only be used inside text or reasoning message parts.

Image

Issue 3. Randomly just got "Duplicate key toolCallId-w6z0JOve4MSAloqXmo4iSGABmSSVkQTC:0acbb2e2-955a-4b9a-9b45-92ac44e2b9be:142 in tapResources" when not doing anything.

Image

Environment

Where are you using Unsloth?

  • Unsloth desktop application
  • Unsloth web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:
Latest CachyOS Desktop

GPU model(s) and accelerator backend:
NVIDIA CUDA

Unsloth Version
v0.1.806-beta
Package Version
2026.9.2
Desktop App Version
0.1.806-beta
llama.cpp Version
b10715-mix-86bd2d3

What happened?

Issue 1. Not exactly sure how to reproduce, it just randomly happens when clicking "New chat".
Issue 2. I started a generation in a project and then I clicked on a previous chat and then it crashed.

Diagnostics and logs

I searched all the files and could not find any relevant files that mention the errors. Even tauri.log does not include lines from the time the errors happened.

Activity

  1. added
    feature request
    on Sep 4, 2026
  2. modelpath-dev commented on Sep 4, 2026

    @modelpath-dev

    I'll work on this. Could you assign it to me?

    I'll reproduce from the report, fix the failure path, and add a test so it stays fixed.

  3. indrajeetapache commented on Sep 4, 2026

    @indrajeetapache
    Contributor

    Neither error string lives in Unsloth’s source. They come from @assistant-ui:

    tapClientLookup: Index 1 out of bounds (length: 0) — empty new thread while a message leaf from the previous thread is still mounted (assistant-ui#5948)
    MessagePartText can only be used inside text or reasoning message parts. — same thread-switch race, part-type / index mismatch (assistant-ui#5118)
    Studio currently pins @assistant-ui/[email protected] (with @assistant-ui/[email protected]). Upstream fixes for these races landed later (~0.14.28 for the MessagePartText case; empty-list New-chat needs the newer store / ~0.15.x line).

    Why Studio hits this often:

    New chat → switchToNewThread() installs an empty message list — classic #5948 window.
    Switching chats mid-generation keeps the runtime alive on purpose (stream keepalive) instead of remounting — that rebinds the UI to another thread’s store while old message parts are still subscribed, which is exactly the race upstream describes.
    So this isn’t a wrong Unsloth MessagePartText wiring; it’s a vulnerable dependency pin plus our keepalive / thread-switch design exercising a known library race. Throws happen inside useSyncExternalStore’s snapshot read, so a normal React error boundary around the markdown leaf usually won’t contain them — the whole app tears down, which matches “needs restart” and empty tauri.log.

    Suggested path

    Short term: treat as known @assistant-ui thread-switch race on the current pin; workaround is avoid rapid New chat / mid-run switches when possible.
    Real fix: plan an @assistant-ui/* upgrade (breaking), or an interim patch-package on the store / part hooks if upgrade has to wait.
    Happy to help with the upgrade/patch PR once maintainers pick a direction. @danielhanchen

  4. changed the title [-][Bug] tapClientLookup: Index 1 out of bounds (length: 0) & MessagePartText can only be used inside text or reasoning message parts.[/-] [+][Bug] "tapClientLookup: Index 1 out of bounds (length: 0)" & "MessagePartText can only be used inside text or reasoning message parts"[/+] on Sep 12, 2026
  5. frostyautumnleaf commented on Sep 30, 2026

    @frostyautumnleaf
    ContributorAuthor

    Got a new one:

    Image
  6. changed the title [-][Bug] "tapClientLookup: Index 1 out of bounds (length: 0)" & "MessagePartText can only be used inside text or reasoning message parts"[/-] [+][Bug] "tapClientLookup: Index 1 out of bounds (length: 0)" & "MessagePartText can only be used inside text or reasoning message parts" & "Duplicate key toolCallId"[/+] on Sep 30, 2026
  7. danielhanchen commented on Oct 12, 2026

    @danielhanchen
    Member

    Fixed! Sorry on the delay. Switching chats while a reply was still generating (most often from a project page) could leave a message from the old chat looking itself up in the new, still-empty chat, which crashed the app with tapClientLookup: Index 1 out of bounds or MessagePartText can only be used inside text or reasoning message parts. That is fixed in #13352, and the Duplicate key toolCallId crash was fixed earlier in #12442.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

  8. frostyautumnleaf commented on Oct 12, 2026

    @frostyautumnleaf
    ContributorAuthor

    12. Fixed! Sorry on the delay. Switching chats while a reply was still generating (most often from a project page) could leave a message from the old chat looking itself up in the new, still-empty chat, which crashed the app with tapClientLookup: Index 1 out of bounds or MessagePartText can only be used inside text or reasoning message parts. That is fixed in #13352, and the Duplicate key toolCallId crash was fixed earlier in #12442.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

    Thank you!

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

    bugfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions