Skip to content

OpenCode repeatedly retries after a mid-tool provider disconnect #32286

Closed as not planned

Description

@N0zoM1z0

Description

If the provider connection closes after a streamed tool call has been delivered but before a clean message completion, OpenCode repeatedly retries the provider interaction instead of failing boundedly.

In the latest local verification run, OpenCode made 588 provider requests and saw 588 mid-stream connection closures before the reproducer timeout killed the process.

Plugins

None. The standalone reproducer sets OPENCODE_DISABLE_DEFAULT_PLUGINS=1.

OpenCode version

1.17.4

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 builds [email protected] from the public npm package, 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/5861579c2e83fed87126293bf76bbbcf

gh gist clone 5861579c2e83fed87126293bf76bbbcf opencode-post-tool-transient-disconnect-reproducer
cd opencode-post-tool-transient-disconnect-reproducer
python3 opencode-post-tool-transient-disconnect.reproduce.py

To reuse an already-built local image:

python3 opencode-post-tool-transient-disconnect.reproduce.py --skip-build

Expected successful reproduction output includes:

provider_requests=588
closed_mid_stream=588
process_timed_out=True
REPRODUCED

Screenshot and/or share link

Not applicable; this is a non-interactive CLI/provider protocol reproducer.

Operating System

Linux x86_64 Docker, using node:24-bookworm-based target image.

Terminal

Non-interactive CLI run from Python subprocess.

Activity

  1. github-actions commented on Jun 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The core symptom (provider disconnect causing unbounded retries) appears closely related to the retry-cap issues above. It may be worth confirming whether a fix to those would also address the post-tool-delivery disconnect case described here.

  2. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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