Skip to content

Add bounded timeout for direct subagent tool waits #365

Closed

Description

@1jehuang

A direct subagent call waits indefinitely if the child session never produces a final answer; there is no bounded timeout for direct subagent waits.

Credit: originally proposed in PR #311. This repo no longer accepts external PRs, so the problem is tracked here instead.

Activity

  1. added
    from-pr
    on Jun 12, 2026
  2. added
    triage: reproducible
    autonomous: likely
    priority: medium
    on Jun 25, 2026
  3. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Triage: Confirmed. The direct subagent path (handle_run_subagent in crates/jcode-app-core/src/server/client_actions.rs:329-336) awaits the spawned tool task with no timeout, and the underlying subagent tool (crates/jcode-app-core/src/tool/task.rs:218) calls agent.run_once_capture(&params.prompt).await with no bounded wait. If the child session never produces a final answer (stuck/hung model turn), the direct call blocks indefinitely.

    Fix path: wrap the await in a tokio::time::timeout (configurable, with a sane default) and surface a timeout error/partial result. Minor judgment needed on default duration and whether to return partial transcript on timeout, so autonomous: likely. From PR #311.

  4. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Fixed in b96dfa47 (pending release). Built and tests pass on Linux. See commit message for the specific change for this issue.

  5. added
    triage: fixed-pending-release
    and removed
    triage: reproducible
    on Jun 25, 2026
  6. 1jehuang commented on Jun 28, 2026

    @1jehuang
    OwnerAuthor

    Released in v0.32.0. Run jcode update to get it.

  7. removed
    triage: fixed-pending-release
    on Jun 28, 2026
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

    autonomous: likelyfrom-prpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions