Skip to content

docs(failure-modes): document sse read timeouts and fix chunktimeout example - #522

Open
basiliskus wants to merge 4 commits into
mainfrom
docs/sse-read-timeout
Open

basiliskus wants to merge 4 commits into
mainfrom
docs/sse-read-timeout

Conversation

@basiliskus

@basiliskus basiliskus commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

docs/KNOWN_FAILURE_MODES.md §9 recommended "chunkTimeout": 5000 (5 seconds) and a
requestTimeout key that OpenCode does not read. Copied as-is, the 5-second value would
abort nearly every long model response with SSE read timed out.

This replaces the example with the timeouts the usai-provider kit actually sets
(timeout 10 min, chunkTimeout 2 min under provider.usai.options), adds the
SSE read timed out retry symptom and its causes (long reasoning,
large tool-call generation, or a stall on the proxy/Zscaler/USAi path), notes that
OpenCode retries automatically (capped at five since 1.18.17), that chunkTimeout has no
default before 1.18.27 so the kit's 2 minutes is what introduces the idle timeout, and shows
how to raise or disable it per project.

Related Issues

Fixes #521

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read CONTRIBUTING.md
  • My commits follow the Conventional Commits format
  • I have tested my changes locally
  • I have updated documentation as needed
  • I have not included any secrets, API keys, or sensitive information

Test Results

  • Pinned markdownlint (npx --prefix .github/linters markdownlint-cli2 docs/KNOWN_FAILURE_MODES.md): 0 errors.
  • Kit defaults read from the pinned usai-provider kit (agentic-coding-patterns
    6c6753c, v1.9.0), files/home/usai-config/opencode.jsonc.
  • Version boundaries checked against OpenCode source at tags: chunkTimeout gains its
    300000 default in packages/opencode/src/provider/provider.ts at v1.18.27 (absent through
    v1.18.26); RETRY_MAX_RETRIES = 5 appears in packages/opencode/src/session/retry.ts at
    v1.18.17 (absent at v1.18.16). The devenv-opencode:1.0.0 image used by acq runs
    OpenCode 1.18.23 (opencode --version in a live sandbox), so it has the retry cap but no
    chunkTimeout default.
  • Provider retry (attempt N): … is Paseo's wording (found in its app bundle), not
    OpenCode's TUI, hence the generic symptom text.

Additional Notes

Upstream context: anomalyco/opencode#17578 (large tool calls stalling the stream) and
anomalyco/opencode#51879 (open; would stop SSE keep-alive comments from resetting the
timer, which may make these timeouts appear more often).

AI-assisted; reviewed by the author.

basiliskus and others added 2 commits September 30, 2026 12:30
…example

Section 9 suggested "chunkTimeout": 5000 (5 seconds) and a requestTimeout key
that OpenCode does not read. Copied as-is, that would abort nearly every long
response with "SSE read timed out". Replace it with the timeouts the
usai-provider kit actually sets, explain the SSE read timeout and its automatic
retry, and show how to raise chunkTimeout per project.
@basiliskus basiliskus self-assigned this Oct 7, 2026
The quoted "Provider retry (attempt N)" text is Paseo's, not OpenCode's; describe the
notice generically. State that chunkTimeout has no default before OpenCode 1.18.27 (the
kit's 2 minutes is what introduces the idle timeout) and that `false` disables it. Replace
"if retries also fail" with the actual behavior: capped at five since 1.18.17, unbounded
before. Link the kit's opencode.jsonc for current values.

Refs: #521
@basiliskus
basiliskus marked this pull request as ready for review October 7, 2026 20:33
@basiliskus
basiliskus requested a review from a team as a code owner October 7, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] KNOWN_FAILURE_MODES §9 recommends a 5s chunkTimeout that causes "SSE read timed out"

2 participants