Skip to content

fix: increase OpenCode server startup timeout from 5s to 30s#4132

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/increase-opencode-server-timeout
Jul 19, 2026
Merged

fix: increase OpenCode server startup timeout from 5s to 30s#4132
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/increase-opencode-server-timeout

Conversation

@UtkarshUsername

@UtkarshUsername UtkarshUsername commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What Changed

Bumped OpenCode server startup timeout from 5s to 30s (DEFAULT_OPENCODE_SERVER_TIMEOUT_MS in opencodeRuntime.ts).

Why

OpenCode server startup time is highly variable under system load. Raw child_process.spawn benchmarks on a Windows machine showed:

Run Time to opencode server listening
1 19.6s
2 16.9s

Under normal conditions opencode serve starts in ~5-7s, but during T3 Code startup, when git operations, port discovery, provider refresh, and diagnostics queries all compete for resources, startup routinely exceeds 15s. The previous 15s timeout still caused Timed out waiting for OpenCode server start errors.

30s provides sufficient headroom for worst-case startup without meaningfully delaying failure detection (the process will exit with an error long before 30s if something is truly broken).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Single default constant change for startup polling only; no auth, data, or API behavior changes.

Overview
Raises the default wait for the OpenCode serve process to print opencode server listening from 5s to 30s via DEFAULT_OPENCODE_SERVER_TIMEOUT_MS in opencodeRuntime.ts. Callers can still override with timeoutMs on startOpenCodeServerProcess / connectToOpenCodeServer.

This targets false Timed out waiting for OpenCode server start failures when startup is slowed by concurrent T3 Code work (git, port discovery, provider refresh, etc.), where cold starts can exceed the old limit.

Reviewed by Cursor Bugbot for commit 4afa23f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Increase OpenCode server startup timeout from 5s to 30s

Raises DEFAULT_OPENCODE_SERVER_TIMEOUT_MS in opencodeRuntime.ts from 5,000ms to 30,000ms to reduce false timeout failures when waiting for the OpenCode server to begin listening.

Macroscope summarized 4afa23f.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b5e498ea-3f6d-4c84-ad0d-d1429971d634

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jul 18, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Simple timeout constant increase (5s → 30s) with no logic changes. The unresolved review comment references incorrect values and appears stale. This is a low-risk configuration tweak.

You can customize Macroscope's approvability policy. Learn more.

@UtkarshUsername UtkarshUsername changed the title Increase OpenCode server startup timeout from 5s to 10s fix: increase OpenCode server startup timeout from 5s to 10s Jul 18, 2026
@UtkarshUsername
UtkarshUsername marked this pull request as draft July 18, 2026 18:24
Comment thread apps/server/src/provider/opencodeRuntime.ts Outdated
Raw Node.js benchmarks on this machine show opencode serve takes
16-20s under load to reach the 'listening' state. The previous 15s
timeout was not enough headroom.
@UtkarshUsername UtkarshUsername changed the title fix: increase OpenCode server startup timeout from 5s to 10s fix: increase OpenCode server startup timeout from 5s to 30s Jul 18, 2026
@UtkarshUsername
UtkarshUsername marked this pull request as ready for review July 18, 2026 21:13
@juliusmarminge
juliusmarminge merged commit 398140a into pingdotgg:main Jul 19, 2026
14 checks passed
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 20, 2026
pingdotgg#4112, pingdotgg#4132, pingdotgg#4134, pingdotgg#4006, pingdotgg#4137) (#171)

* [codex] Route OpenCode missing-session errors through Effect (pingdotgg#3608)

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit d0b9f8d)

* [codex] canonicalize client timestamps (pingdotgg#4112)

(cherry picked from commit da3c203)

* fix: increase OpenCode server startup timeout from 5s to 30s (pingdotgg#4132)

(cherry picked from commit 398140a)

* fix(shared): delete unused agentAwareness phase predicates (pingdotgg#4134)

(cherry picked from commit e8ff6bc)

* perf(client): defer active thread cache writes (pingdotgg#4006)

(cherry picked from commit 765e1b5)

* fix(client): use lightweight connection probe (pingdotgg#4137)

(cherry picked from commit 2640e6d)

* fix(client): adapt deferred thread cache tests for fork warm-cache

Fork warm-cache seeding stays on synchronizing and must not re-persist
active turns. Gate the seed persistence write with shouldPersistThread
and drive the pingdotgg#4006 regression test to live via a socket snapshot.

Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>

---------

Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Maxwell Young <maxtheyoung@gmail.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Kriday Dave <technocratix902@gmail.com>
Co-authored-by: Chris Michael Guzman <67719167+Chrrxs@users.noreply.github.com>
Co-authored-by: eeinarsson <128746408+eeinarsson@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 20, 2026
…ingdotgg#3749, pingdotgg#4159) (#172)

* [codex] Route OpenCode missing-session errors through Effect (pingdotgg#3608)

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit d0b9f8d)

* [codex] canonicalize client timestamps (pingdotgg#4112)

(cherry picked from commit da3c203)

* fix: increase OpenCode server startup timeout from 5s to 30s (pingdotgg#4132)

(cherry picked from commit 398140a)

* fix(shared): delete unused agentAwareness phase predicates (pingdotgg#4134)

(cherry picked from commit e8ff6bc)

* perf(client): defer active thread cache writes (pingdotgg#4006)

(cherry picked from commit 765e1b5)

* fix(client): use lightweight connection probe (pingdotgg#4137)

(cherry picked from commit 2640e6d)

* fix(client): adapt deferred thread cache tests for fork warm-cache

Fork warm-cache seeding stays on synchronizing and must not re-persist
active turns. Gate the seed persistence write with shouldPersistThread
and drive the pingdotgg#4006 regression test to live via a socket snapshot.

Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>

* feat(web): themed sidebar header art for nightly and dev builds (pingdotgg#4130)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
(cherry picked from commit 53e3c98)

* feat: add headless `t3 connect` setup for SSH hosts (pingdotgg#3749)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 7a820ab)

* Refine T3 Connect authorization surfaces (pingdotgg#4159)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 2b180a2)

---------

Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Maxwell Young <maxtheyoung@gmail.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Kriday Dave <technocratix902@gmail.com>
Co-authored-by: Chris Michael Guzman <67719167+Chrrxs@users.noreply.github.com>
Co-authored-by: eeinarsson <128746408+eeinarsson@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
Co-authored-by: maria <maria@kuuro.net>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants