Skip to content

mini-swe-agent hangs while the provider stalls mid tool-call stream #874

Description

@N0zoM1z0

Describe the bug

Summary

If an OpenAI-compatible provider starts a tool call and then stalls before sending the tool-call arguments, mini-swe-agent does not return control within the bounded run.

The standalone reproducer installs public mini-swe-agent==2.4.2, starts a local mock provider, sends the beginning of a Bash tool call, deliberately delays the argument chunk, and verifies that mini-swe-agent reaches the bounded timeout or signal path while provider traffic has already been observed.

Affected target

  • Target: mini-swe-agent
  • Affected version checked with the public reproducer: 2.4.2
  • Current public latest checked on 2026-06-22: 2.4.2
  • Environment: Linux x86_64 Docker, public package install
  • Provider/model: OpenAI-compatible local mock provider, gpt-4o

Steps to reproduce

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It installs the affected CLI version from the public package registry, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/5e36ccd5b37ac13c0f3aca035de6d197

The Gist contains mini-swe-agent-hang-between-chunks.reproduce.py. Download and run:

gh gist clone 5e36ccd5b37ac13c0f3aca035de6d197 mini-swe-agent-hang-between-chunks-reproducer
cd mini-swe-agent-hang-between-chunks-reproducer
python3 mini-swe-agent-hang-between-chunks.reproduce.py

To reuse an already-built local image:

python3 mini-swe-agent-hang-between-chunks.reproduce.py --skip-build

Expected successful reproduction output includes:

provider_requests_at_least: observed=101 expected>=1
timeout_or_signal: returncode=137 timed_out=True
RUN_REPRODUCED
REPRODUCED

Actual behavior

mini-swe-agent begins processing the provider's tool-call stream but does not return control before the reproducer's bounded timeout when the provider pauses between tool-call chunks.

Expected behavior

mini-swe-agent should enforce bounded provider-stream timeouts and return a controlled error when a provider stalls mid tool-call stream.

Public-upstream status

This report targets stock public mini-swe-agent==2.4.2, which is the current PyPI latest checked on 2026-06-22. No upstream issue has been filed from this draft yet. This is separate from the repeated-tool and child-process cleanup reports because it validates bounded handling of a stalled provider stream.

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