Forbidden: upstream connect error or disconnect/reset before headers. reset reason: connection termination #6774

Open
opened 2026-02-16 18:05:14 -05:00 by yindo · 2 comments
Owner

Originally created by @passerhub on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

  1. 当本地大模型服务出现title描述的问题的时候,opencode就停止了当前任务,不再重试.
  2. 如果给opencode新的提示: "继续" / "重试",opencode 就开始了无尽的工作,自我提示用户要求继续或者重试,然后把干过的活在一次次的重复,基本就停不下来了.

Plugins

oh-my-opencode

OpenCode version

1.1.25

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

与终端无关, vscode/tmux/bash都可以重现.

Originally created by @passerhub on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description 1. 当本地大模型服务出现title描述的问题的时候,opencode就停止了当前任务,不再重试. 2. 如果给opencode新的提示: "继续" / "重试",opencode 就开始了无尽的工作,自我提示用户要求继续或者重试,然后把干过的活在一次次的重复,基本就停不下来了. ### Plugins oh-my-opencode ### OpenCode version 1.1.25 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04 ### Terminal 与终端无关, vscode/tmux/bash都可以重现.
yindo added the bug label 2026-02-16 18:05:14 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

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

  • #3088: Indefinitely retry to fetch (same indefinite retry behavior)
  • #7825: Improperly formed request (endless loop after interruption and continue)
  • #6430: Endless loop of TimeoutOverflowWarning (timeout causing infinite loop)
  • #7645: TUI client CPU 100% when server shuts down (process in tight retry loop)
  • #1712: Implement exponential back-off when hitting rate limits (rate limit continuous retries)

The core issue appears to be that when OpenCode encounters a connection error from a local model service, it either stops retrying or enters an infinite retry loop when asked to continue. This suggests a systematic problem with how retry logic and error recovery are handled for transient failures.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #3088: Indefinitely retry to fetch (same indefinite retry behavior) - #7825: Improperly formed request (endless loop after interruption and continue) - #6430: Endless loop of TimeoutOverflowWarning (timeout causing infinite loop) - #7645: TUI client CPU 100% when server shuts down (process in tight retry loop) - #1712: Implement exponential back-off when hitting rate limits (rate limit continuous retries) The core issue appears to be that when OpenCode encounters a connection error from a local model service, it either stops retrying or enters an infinite retry loop when asked to continue. This suggests a systematic problem with how retry logic and error recovery are handled for transient failures. Feel free to ignore if none of these address your specific case.
Author
Owner

@passerhub commented on GitHub (Jan 31, 2026):

Forbidden: upstream connect error or disconnect/reset before headers. reset reason: connection termination

这个错误出现在使用反向代理访问大模型的偶发错误,一旦发生,agent会停止工作,除非人工干预.特别是sub agent,不切换过去是很难发现的.

希望能把这个error归为类似502/504的错误,opencode可以持续重试,一般会成功的.

Image
@passerhub commented on GitHub (Jan 31, 2026): Forbidden: upstream connect error or disconnect/reset before headers. reset reason: connection termination 这个错误出现在使用反向代理访问大模型的偶发错误,一旦发生,agent会停止工作,除非人工干预.特别是sub agent,不切换过去是很难发现的. 希望能把这个error归为类似502/504的错误,opencode可以持续重试,一般会成功的. <img width="2059" height="257" alt="Image" src="https://github.com/user-attachments/assets/f5d7adc1-0918-4be8-9748-af67988581b0" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6774