[Bug]: OpenCode turn fails with “Endpoint is unavailable” in T3 Code while identical CLI run completes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
-
Install/configure OpenCode
1.18.13on Windows 11 and enable the OpenCode provider in T3 Code. -
Select the following model and options in T3 Code:
- Model:
opencode-go/qwen3.8-max - Agent/mode:
Plan - Runtime permissions:
Full access - Working directory: a local repository
- Model:
-
Send a repository-analysis prompt which requires multiple file reads/tool calls, for example:
We are planning Milestone 2 — Work Package 2.4 (M2 WP2.4) for the Touchline Intelligence project.
Inspect the repository context, completed M2 work, especially WP2.1-WP2.3, and the documented objectives and dependencies of M2 WP2.4.
Do not implement anything and do not modify any files. Produce only an execution-ready implementation plan for M2 WP2.4.
- Observe that T3 Code successfully executes several Read and Bash tool calls, then fails after approximately 20–50 seconds with:
Upstream request failed: Endpoint is unavailable.
- Start an external OpenCode server:
& "C:\Tools\bin\opencode-t3.exe" serve --hostname=127.0.0.1
--port=4096
- Confirm that it is healthy at:
http://127.0.0.1:4096/global/health
Response:
{"healthy":true,"version":"1.18.13"}
- Configure T3 Code to use that external server:
-
Repeat the T3 Code task. It still fails with the same Endpoint is unavailable message.
-
Run the equivalent task directly through OpenCode CLI, attached to the same server:
& "C:\Tools\bin\opencode-t3.exe" run --attach "http://127.0.0.1:4096"
--dir "C:\root\projects\football ml" --agent plan
--model "opencode-go/qwen3.8-max" `
"We are planning Milestone 2 — Work Package 2.4 (M2 WP2.4) for the Touchline Intelligence project. Inspect the repository context, completed M2 work, especially WP2.1-WP2.3, and the documented objectives and dependencies of M2 WP2.4. Do not implement anything and do not modify any files. Produce only an execution-ready implementation plan for M2 WP2.4."
- The direct CLI invocation successfully completes the entire repository-analysis task and produces the final implementation plan, even after substantially more file reads and a much larger tool result than the T3 Code run.
Expected behavior
T3 Code should complete the OpenCode turn successfully, matching the behavior of the equivalent direct OpenCode CLI invocation using the same server, model, agent, repository, and prompt.
If the upstream provider actually rejects a continuation request, T3 Code should preserve and display the underlying structured error/status information instead of only reporting the generic Endpoint is unavailable message.
Actual behavior
T3 Code starts the OpenCode session correctly and successfully executes several Read and Bash tool calls.
During a later model continuation after tool results, the turn fails with:
Upstream request failed: Endpoint is unavailable.
The failure reproduces both:
when T3 Code starts/manages the OpenCode server itself;
when T3 Code connects to an externally started, healthy OpenCode server.
The identical long-running task succeeds when executed directly through OpenCode CLI against the same external server, using the same model, plan agent, working directory, and prompt.
A short direct CLI request also succeeds:
& "C:\Tools\bin\opencode-t3.exe" run --attach "http://127.0.0.1:4096"
--dir "C:\root\projects\football ml" --agent plan
--model "opencode-go/qwen3.8-max" `
"Only reply with OK. Do not use tools."
Result:
OK
This suggests the failure is specific to T3 Code's OpenCode session/request/event lifecycle rather than the OpenCode binary, authentication, model availability, local server, or repository task itself.
Impact
Major degradation or frequent failure
Version or commit
T3 Code Desktop: T3 Code (Nightly): 0.0.32-nightly.20260805.1005 OpenCode CLI/server: 1.18.13
Environment
- OS: Windows 11 - T3 Code: Desktop application - OpenCode CLI/server:
1.18.13- OpenCode binary configured in T3 Code:C:\Tools\bin\opencode-t3.exe- Normal PATH OpenCode version:1.18.13- Model:opencode-go/qwen3.8-max- Agent/mode:plan- Runtime permissions:Full access- External server test URL:http://127.0.0.1:4096- External server health response:{"healthy":true,"version":"1.18.13"}- Repository working directory contains a space:C:\root\projects\football ml- The same model works in the OpenCode Desktop application and direct OpenCode CLI.
Logs or stack traces
T3 Code work log:
Upstream request failed: Endpoint is unavailable.
Observed behavior before the failure:
- OpenCode session starts successfully.
- Multiple Read and Bash tool calls complete successfully.
- Failure occurs during a later model continuation after tool results.
External OpenCode server health:
{"healthy":true,"version":"1.18.13"}
OpenCode versions:
C:\Tools\bin\opencode-t3.exe --version
1.18.13
opencode --version
1.18.13
Direct CLI control test:
- Same server
- Same model: opencode-go/qwen3.8-max
- Same agent: plan
- Same repository
- Same long prompt
- Completed successfully and returned the full final implementation plan.
Screenshots, recordings, or supporting files
Ekran görüntüsü 2026-08-05 135501.png
Ekran görüntüsü 2026-08-05 141847.png
Ekran görüntüsü 2026-08-05 141835.png
Ekran görüntüsü 2026-08-05 142005.png
Workaround
Run the affected task directly through the OpenCode Desktop application or OpenCode CLI instead of T3 Code.
Connecting T3 Code to an externally started OpenCode server does not resolve the issue.
Example working CLI invocation:
powershell
& "C:\Tools\bin\opencode-t3.exe" run
--attach "http://127.0.0.1:4096" --dir "<repository-path>"
--agent plan `
--model "opencode-go/qwen3.8-max"
""
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the apps/server area and reproduce the failure using the supplied T3 Code setup, then compare its session and event lifecycle with the successful attached OpenCode CLI run. Trace the later model continuation after tool results and preserve structured upstream error details; done means the long-running repository-analysis task completes through T3 Code or exposes the underlying status instead of only the generic message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100