Commit Graph

4 Commits

Author SHA1 Message Date
decolua
058ceace48 fix(opencode): declare forceStream on transport for free-tier SSE aggregation
Declares forceStream: true so chatCore properly converts upstream
forced-stream responses to JSON for non-streaming callers.

Co-authored-by: anojndr <anojndr@gmail.com>
Co-authored-by: TEGAR-SRC <tegararrahman17@gmail.com>
Co-authored-by: yxxrn <yxxrn@users.noreply.github.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-18 17:32:52 +07:00
decolua
93837af09f fix(opencode): fix free tier 403 error and improve China region handling
- Force stream:true and cloak decoy tools (bash, read) for OpenCode free tier
- Support connection testing for opencode in testUtils
- Expand error message slice limits in auth and ping to preserve workspace link
- Add concise China region link chip in provider detail page

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-18 16:57:06 +07:00
ErfanBagheri404
0c6ab4f99b fix(opencode): reuse one stable upstream session per identity to stop 429s
Follow-up to the canonical-session fix: with no explicit session,
every request minted a fresh x-opencode-session, and upstream free-tier
quota is accounted per session. That burns through quota and surfaces
as 429 FreeUsageLimitError with growing reset-after delays, while the
real CLI reuses one long-lived session per conversation.

- Stable canonical session per downstream identity (connectionId, else
  auth-header hash, else shared default), evicted after
  MEMORY_CONFIG.sessionTtlMs like the other session stores.
- Deterministic x-opencode-request per message (stable across retries,
  like the CLI user message id); valid downstream ids preserved.
- 6 more unit tests (22 total).
2026-09-17 18:03:58 +07:00
anojndr
6091ff597e fix(opencode): resolve 403 FreeTierError with canonical session format and valid User-Agent
OpenCode upstream validates free-tier requests: User-Agent must be opencode/<version> (>= 1.17.0) and x-opencode-session must match canonical ses_ format. Default OPENCODE_UA to opencode/1.18.31, generate canonical descending session IDs, provide deterministic foreign session translation, and isolate credentials per-request.
2026-09-17 18:03:20 +07:00