Skip to content

fix(util): retry broken-pipe transport failures - #56307

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
sdivyanshu90:retry-broken-pipes
Oct 17, 2026
Merged

rekram1-node merged 2 commits into
anomalyco:devfrom
sdivyanshu90:retry-broken-pipes

Conversation

@sdivyanshu90

@sdivyanshu90 sdivyanshu90 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #56305

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Recognize EPIPE as a transient transport failure in the shared retry classifier. Broken-pipe errors now use the existing bounded retry budget, including when the code is nested beneath the client's transport error.

How did you verify your code works?

From packages/util, using Bun 1.4.3:

  • bun run test src/retry.test.ts --rerun-each 10: 80 passed. All three new cases fail before the fix; they cover message/code detection, nested causes, recovery, and the attempt limit.
  • A local reproduction with the real V2 OpenCode.make() client fails after one request before the fix and succeeds on the second afterward. Its fetch option injects the broken-pipe error; no live server failure is assumed.
  • bun typecheck: passed.
  • Focused Oxlint, Prettier, and git diff --check: passed.

Repository-wide verification on the shared baseline passed lint with existing warnings, then stopped at an uninstalled Console workspace dependency (@tsconfig/node22).

Screenshots / recordings

Not applicable; no rendered UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #54160

@sdivyanshu90

Copy link
Copy Markdown
Contributor Author

Hi @kitlangton, could you please review this PR whenever you have some time. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I ran the reproduction script from #56305: on the base, a nested EPIPE transport error stops after one attempt, and with this change it's retried and succeeds on the second attempt. ECONNRESET behaves the same as before. The retry tests pass (the three new cases fail on the base), and typecheck passes for packages/util.

The only places that use the default retry check are HTTP calls in packages/app, so the new epipe match won't make other kinds of errors retry by accident.

Public API: unchanged.

Related: #54160

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.

V2 bootstrap retry stops on broken-pipe transport errors

2 participants