Skip to content

In-process desktop (Tauri) core runtime still uses the default 2 MiB worker stack — subagent delegation can crash it #3159

Closed

Description

@sanil-23

Follow-up to #3155.

#3155 fixes the standalone openhuman-core run JSON-RPC server by setting thread_stack_size(16 MiB) on its tokio runtime (src/core/cli.rs), so a sub-agent delegation no longer overflows the default 2 MiB worker stack and aborts the process (SIGABRT, thread 'tokio-rt-worker' has overflowed its stack).

The in-process desktop core runs on a different runtime — the Tauri host's tokio runtime (app/src-tauri), spawned via core_process::CoreProcessHandle — which is not covered by that change and still uses the default 2 MiB worker stack. The same crash is therefore still reachable in the shipped desktop app whenever the orchestrator delegates to a sub-agent with a large tool surface / prompt.

Repro / mechanism

Identical to #3155: orchestrator runs a research-style tool → subagent_runner dispatches a sub-agent at spawn_depth=1 → the nested agent-turn future overflows the worker stack. Reproduced for the CLI path by driving chat-harness-subagent.spec.ts against a real openhuman-core (core aborts with Abort trap: 6, fatal runtime error: stack overflow).

Fix

Apply the same thread_stack_size(16 MiB) to the tokio runtime that the embedded desktop core runs on (and ideally any other multi-thread runtime in src/core/* that can run an agent turn — agent_cli, call, etc.). Consider a shared constant so the value stays in sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions