Skip to content

[search_debug_actions] long-running queries block the game's main thread #6

Closed

Description

@Timer80

rimworld/search_debug_actionsblocks the game's main thread for a long time when searching with broad keywords (e.g. Recalculate), which causes:

  1. Game freeze/hang: animation and input become unresponsive, frame rate collapses, and system-level AppHang detection can be triggered;
  2. MCP-side request timeout at 30s (tools/call timeout of 30000ms), leaving the tool call stuck;
  3. Other main-thread-based debug features in-game (UnityExplorer, debug menu, etc.) are likewise unavailable during the search.

I have tried writing a similar solution (reinventing the wheel), which solved this problem to some extent. Here is a document for your reference.
issue-search-debug-actions.en.md

If the fix is done, please submit an issue to (https://github.com/Timer80/UESDdebuger-RimworldAutoAICodingDebuger), and I will directly move this feature to rimbridgeserver.

Activity

  1. pardeike commented on Oct 7, 2026

    @pardeike
    Owner

    Fixed by #10 (thanks @beverage), merged for the next release.

    The cause was that search opened every generated submenu (childGetter), such as the per-def spawn lists and the quest generators, which test-run quest scripts. Search now walks only the static tree; generated submenus are listed with expandable=true and their entries become searchable once something opens them, for example list_debug_action_children on Actions\Spawn thing.... The time-budgeted breadth-first walk from 2.2.0 stays as a guard.

    Measured on RimWorld 1.6 with DLCs and 30 mods: Recalculate 16 ms on the main menu, Toggle Job Logging and Generate quest 16-17 ms in a colony, 2,193 nodes searched. After opening Spawn thing... (1,407 entries, 30 ms) a search covers 3,600 nodes in 32 ms.

    @Timer80, you asked for a note on your repository once this was fixed; I'll leave that to you to pick up from here.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions