Uh oh!
There was an error while loading. Please reload this page.
fix(llm): stop dumping HTML gateway bodies into provider errors - #36359
fix(llm): stop dumping HTML gateway bodies into provider errors#363591837620622 wants to merge 1 commit into
Conversation
V2 TUI retry notices can print full nginx HTML pages when a provider returns HTTP 503 with an HTML body (issue anomalyco#35640). Root cause: - RequestExecutor.providerMessage appends response bodies <= 500 chars without detecting HTML/gateway pages - ProviderError.message() can also surface HTML already embedded in APICallError.message before responseBody HTML guards run Minimal fix: - Omit HTML (and oversized) bodies from providerMessage - Harden ProviderError.message for HTML in msg/responseBody, with clear 502/503/504 copy - Add executor regression test for nginx-style 503 HTML Fixesanomalyco#35640
1837620622
commented
Jul 11, 2026
Ready for reviewMinimal fix for #35640 (raw nginx HTML in V2 TUI retry notices).
Happy to tweak copy if maintainers prefer a different 503 phrasing. |
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: Related PR:
The other results (PR #34010 about response stream errors and PR #24218 about reasoning models) appear to be related to different aspects of provider/LLM handling and don't seem to be duplicates of the current PR. |
1837620622
commented
Jul 11, 2026
Review ping 🙏 Stops nginx/HTML gateway bodies from being inlined into provider/TUI retry errors (#35640). Regression test included; checks green. |
Ported from upstream anomalyco#36359.
Ported from upstream anomalyco#36359.
* fix(llm): stop dumping HTML gateway bodies into provider errors Ported from upstream anomalyco#36359. * fix(provider): anchor HTML-body detection and fix dcode auth hint Addresses Opus review of PR #26: isHtmlMarkup was unanchored so a real error message mentioning <html> was misclassified as a gateway page and discarded; anchor it like the executor's detector. Also fix the 401 hint to say 'dcode auth login' (was 'opencode'). Adds error.ts regression tests.
1837620622
commented
Jul 17, 2026
Gentle follow-upStill ready for review. Stops nginx/HTML gateway bodies from being inlined into provider/TUI retry errors (#35640). Regression test included; checks green. Thanks! |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes#35640
Type of change
What does this PR do?
When a provider (or proxy) returns an HTML error page such as nginx HTTP 503, the V2 TUI retry notice prints the entire HTML document inline:
Confirmed root causes:
packages/llm/src/route/executor.ts—providerMessage()appends response bodies ≤ 500 characters with no HTML detectionpackages/opencode/src/provider/error.ts— if HTML is already embedded inAPICallError.message, the existingresponseBodyHTML guards never runMinimal fix (aligned with V1 #15406 intent):
RequestExecutor.providerMessageProvider request failed with HTTP {status}ProviderError.messageProvider temporarily unavailable (HTTP …)executor.test.tsreason.messagePlain-text short bodies (e.g.
"busy") still surface as before.How did you verify your code works?
HTTP 503+ nginx HTML)Author
35034498+1837620622@users.noreply.github.com(GitHub-verified)Checklist