GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add opencode provider support by nexxeln · Pull Request #1758 · pingdotgg/t3code

Conversation

@nexxeln

@nexxeln nexxeln commented Apr 5, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

summary

  • add OpenCode as a first-class provider across contracts, server runtime wiring, and the web model picker/settings flow
  • implement the OpenCode adapter with SDK-based session streaming, approvals, question handling, and assistant/tool event projection fixes
  • add OpenCode-backed git text generation for thread titles, branch names, commit messages, and PR content

testing

  • bun fmt
  • bun lint
  • PATH="/Users/nxl/.local/state/fnm_multishells/11922_1773576539803/bin:$PATH" bun run typecheck

Note

Medium Risk
Introduces a new provider end-to-end (process spawning, network auth, streaming event translation, and persistence/cache integration), which increases integration and lifecycle edge-case risk. Changes also alter event logging behavior by writing canonical logs per threadId.

Overview
Adds OpenCode as a first-class provider across the server and web app, including provider discovery/health probing, session orchestration support, and UI selection.

On the server, this introduces an OpenCodeAdapter (SDK-based session streaming with approvals/questions, rollback, and native event logging), an OpenCodeProvider (CLI/server probing with friendlier error messages), and an OpenCodeTextGeneration implementation wired into RoutingTextGeneration with shared local server reuse + 30s idle TTL (or direct use of a configured serverUrl/serverPassword). Provider registries, persistence decoding, and provider status caching are updated to include opencode, and canonical event logging now keys logs by threadId.

On the web, OpenCode becomes selectable in the model picker (icon/theme tweaks), settings gains OpenCode serverUrl/serverPassword fields, and the composer traits UI adds OpenCode-specific Variant + Agent controls while hiding the interaction-mode toggle for OpenCode sessions. Extensive tests are added/updated to cover the new provider wiring and behavior.

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

Note

Add OpenCode as a supported provider across server and web

  • Adds full OpenCode provider support end-to-end: contracts, settings schemas, server-side provider/adapter layers, text generation routing, and web UI settings panel.
  • Introduces OpenCodeTextGeneration with a shared server lifecycle: the server process is reused across requests and auto-closed after a 30-second idle TTL, with serialized access via a semaphore.
  • Adds OpenCodeAdapter and OpenCodeProvider server layers, integrates them into ProviderAdapterRegistry and ProviderRegistry, and routes requests with provider: 'opencode' through the new text generation layer.
  • Extends the composer UI to support OpenCode-specific Variant and Agent trait selectors, hides the Build/Plan interaction mode toggle for OpenCode, and surfaces server URL and password fields in the settings panel.
  • Adds createModelSelection and related normalizer helpers in packages/shared to reduce manual model selection object construction across the codebase.
  • Behavioral Change: ProviderService canonical event logs now pass canonicalEvent.threadId instead of null, attributing logs to the correct thread segment.

Macroscope summarized e2d5c2f.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

raulpesilva, jweaker, tareqmahmud, Derpedyea, twitocode, hodeinavarro, valerius21, daysm, Sparky983, NikolaM-Dev, and 2 more reacted with thumbs up emoji ddanielgal reacted with heart emoji GearHead87 reacted with rocket emoji
All reactions
  • 👍 12 reactions
  • ❤️ 1 reaction
  • 🚀 1 reaction
nexxeln added 2 commits April 5, 2026 19:19
@nexxeln
feat: add opencode provider
115982c
@nexxeln
feat(git): add opencode text generation
2811ba6
@coderabbitai

coderabbitai Bot commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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: 1ec0c310-9345-4921-824e-81225575434b

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Apr 5, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 5, 2026
View reviewed changes
Comment thread apps/server/src/git/Layers/OpenCodeTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 5, 2026
View reviewed changes
Comment thread apps/web/src/components/ChatView.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces a complete new provider integration (OpenCode) with ~4700 lines of new code spanning process management, SDK integration, credential handling, and UI changes. Unresolved review comments include a high-severity concern about plaintext password storage and medium-severity issues with error handling and default fallback behavior. New features of this scope with security implications require human review.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Merge branch 'main' into nxl/opencode-adapter
1e1f31c
cursor[bot]
cursor Bot reviewed Apr 6, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/opencodeRuntime.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Add OpenCode composer adapter support
5ebbf95
- preserve OpenCode variant and agent selections
- hide unsupported interaction mode controls
- add provider snapshot and UI coverage
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/server/src/git/Layers/OpenCodeTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 2 commits April 6, 2026 18:11
@juliusmarminge
Reuse OpenCode server between text generation calls
d362997
- Keep a warm OpenCode process alive across back-to-back requests
- Close the shared server after the idle TTL and add coverage for reuse
@juliusmarminge
Support configured OpenCode server URLs
4d1cf0b
- Reuse an existing OpenCode server for provider sessions and text generation
- Add `serverUrl` to settings, UI, and runtime connection handling
- Update tests for configured-server behavior
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/web/src/components/chat/composerProviderRegistry.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Add OpenCode server password support
ea16d83
- Plumb OpenCode server passwords through settings and contracts
- Send basic auth to external OpenCode servers when configured
- Surface the password field in the web settings UI
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/server/src/git/Layers/OpenCodeTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 7, 2026
View reviewed changes
Comment thread apps/web/src/components/chat/TraitsPicker.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Coder-soft

Coder-soft commented Apr 8, 2026

Copy link
Copy Markdown

is it going to be implemented?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Merge origin/main into t3code/pr-1758/nxl/opencode-adapter
21450f6
Co-authored-by: codex <[email protected]>

# Conflicts:
#	apps/web/src/components/ChatView.tsx
#	apps/web/src/components/chat/TraitsPicker.browser.tsx
#	apps/web/src/components/chat/composerProviderRegistry.test.tsx
#	apps/web/src/components/chat/composerProviderRegistry.tsx
#	apps/web/src/composerDraftStore.ts
#	packages/contracts/src/orchestration.ts
#	packages/contracts/src/settings.ts
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 10, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 10, 2026
View reviewed changes
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Merge origin/main into t3code/pr-1758/nxl/opencode-adapter
b7f73ce
cursor[bot]
cursor Bot reviewed Apr 13, 2026
View reviewed changes
Comment thread apps/web/src/components/chat/ChatComposer.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/git/Layers/OpenCodeTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Tighten OpenCode adapter session and permission handling
8a3159c
- Reuse active shared servers safely under binary-path races
- Emit assistant text updates from both message and part events
- Make OpenCode permissions default to ask and disable password autofill
- Fix settings panel test mounting and composer layout
cursor[bot]
cursor Bot reviewed Apr 13, 2026
View reviewed changes
Comment thread apps/server/src/git/Layers/RoutingTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 13, 2026
View reviewed changes
Comment thread apps/server/src/git/Layers/OpenCodeTextGeneration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Harden OpenCode defaults and race cleanup
c69f377
- Fall back to default OpenCode settings when provider config is missing
- Abort newly started remote SDK sessions when a concurrent winner already exists
- Co-authored-by: codex <[email protected]>
cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge @codex
fix: address opencode adapter review feedback
2f09cf7
Co-authored-by: codex <[email protected]>
cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Skip OpenCode version probe when provider is disabled
fe6d56a
- Treat disabled OpenCode as not installed in status output
- Avoid running `--version` before the enabled check
cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/web/src/components/chat/TraitsPicker.browser.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge and others added 2 commits April 17, 2026 12:14
@juliusmarminge
Merge remote-tracking branch 'origin/main' into nxl/opencode-adapter
a687afc
@juliusmarminge @claude
Remove stale remove mock from OpenCode adapter test
570f819
The `remove` method was removed from `ProviderSessionDirectoryShape` in
pingdotgg#2125 (Preserve provider bindings when stopping sessions). The test mock
still referenced it, causing a typecheck failure.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/ProviderAdapterRegistry.test.ts
Layer.mergeAll(
Layer.succeed(CodexAdapter, fakeCodexAdapter),
Layer.succeed(ClaudeAdapter, fakeClaudeAdapter),
Layer.succeed(OpenCodeAdapter, fakeOpenCodeAdapter),

@cursor cursor Bot Apr 17, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in ProviderAdapterRegistry and ProviderRegistry

Low Severity

Several new lines in ProviderAdapterRegistry.test.ts use inconsistent indentation relative to the surrounding code. For example, the Layer.succeed(OpenCodeAdapter, ...) line at 76 is indented 8 spaces while the adjacent CodexAdapter and ClaudeAdapter lines use 10 spaces. Similarly, const openCode and its assertion at lines 89/92 break alignment with the existing codex/claude lines.

Additional Locations (1)
  • apps/server/src/provider/Layers/ProviderAdapterRegistry.test.ts#L88-L92
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 570f819. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
juliusmarminge and others added 3 commits April 17, 2026 12:21
@juliusmarminge @claude
Fix missing stdout/stderr in OpenCode server startup failure
b5d3ea7
Listen for `close` instead of `exit` on the child process so that
stdio pipes are fully drained before we read stdout/stderr for the
error message. Also capture the kill signal (when present) instead
of reporting "code: unknown".

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@juliusmarminge @claude
Detect macOS quarantine when OpenCode server is SIGKILL'd
027ed78
When the OpenCode binary has the com.apple.quarantine xattr, macOS
Gatekeeper kills it with SIGKILL before it can produce any output.
Detect this case and show an actionable message with the xattr
removal command instead of a cryptic "signal: SIGKILL" error.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@juliusmarminge @claude
Improve SIGKILL diagnostics with crash report inspection
d5c083b
When OpenCode is killed by SIGKILL on macOS, check the quarantine
xattr first, then inspect recent crash reports in DiagnosticReports
for the actual kernel termination reason. This surfaces actionable
messages for both quarantine blocks and invalid code signature kills
(e.g. corrupted binary) instead of a generic SIGKILL error.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/opencodeRuntime.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Harden OpenCode adapter and surface provider
e2d5c2f
- Keep event pumping alive when native event logging fails
- Aggregate shutdown failures across multiple OpenCode sessions
- Resolve OpenCode binaries from absolute paths or PATH
- Add OpenCode to provider selection fixtures and availability
macroscopeapp[bot]
macroscopeapp Bot reviewed Apr 17, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts
Comment on lines +200 to +212
function ensureSessionContext(
sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>,
threadId: ThreadId,
): OpenCodeSessionContext {
const session = sessions.get(threadId);
if (!session) {
throw new ProviderAdapterSessionNotFoundError({ provider: PROVIDER, threadId });
}
if (session.stopped) {
throw new ProviderAdapterSessionClosedError({ provider: PROVIDER, threadId });
}
return session;
}

@macroscopeapp macroscopeapp Bot Apr 17, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium Layers/OpenCodeAdapter.ts:200

ensureSessionContext throws plain exceptions at lines 207 and 209, but it's called inside Effect.fn generators. When a function throws synchronously inside a generator, Effect catches it as a defect (Die) rather than a typed failure (Fail), so these errors escape the typed error channel and can't be caught with catchTag or catchAll. Return an Effect that fails with these errors instead, and have callers yield* it.

+function ensureSessionContext(
+  sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>,
+  threadId: ThreadId,
+): Effect.Effect<OpenCodeSessionContext, ProviderAdapterSessionNotFoundError | ProviderAdapterSessionClosedError> {
+  const session = sessions.get(threadId);
+  if (!session) {
+    return Effect.fail(new ProviderAdapterSessionNotFoundError({ provider: PROVIDER, threadId }));
+  }
+  if (session.stopped) {
+    return Effect.fail(new ProviderAdapterSessionClosedError({ provider: PROVIDER, threadId }));
+  }
+  return Effect.succeed(session);
+}
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/src/provider/Layers/OpenCodeAdapter.ts around lines 200-212:

`ensureSessionContext` throws plain exceptions at lines 207 and 209, but it's called inside `Effect.fn` generators. When a function throws synchronously inside a generator, Effect catches it as a defect (`Die`) rather than a typed failure (`Fail`), so these errors escape the typed error channel and can't be caught with `catchTag` or `catchAll`. Return an `Effect` that fails with these errors instead, and have callers `yield*` it.

Evidence trail:
apps/server/src/provider/Layers/OpenCodeAdapter.ts:201-211 (ensureSessionContext throws at lines 206 and 209), apps/server/src/provider/Layers/OpenCodeAdapter.ts:984-985 (called in Effect.fn generator), apps/server/src/provider/Layers/OpenCodeAdapter.ts:1107-1108, apps/server/src/provider/Layers/ClaudeAdapter.ts:2451-2455 (correctly uses Effect.fail), apps/server/src/provider/Layers/CursorAdapter.ts:340-348 (correctly uses Effect.fail), apps/server/src/provider/Layers/GeminiAdapter.ts:874-878 (correctly uses yield*), apps/server/src/provider/Errors.ts:25-35 (ProviderAdapterSessionNotFoundError is Schema.TaggedErrorClass)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/opencodeRuntime.ts
Comment on lines +303 to +311
export function resolveOpenCodeBinaryPath(binaryPath: string): string {
if (Path.isAbsolute(binaryPath)) {
return binaryPath;
}
return execFileSync("which", [binaryPath], {
encoding: "utf8",
timeout: 3_000,
}).trim();
}

@macroscopeapp macroscopeapp Bot Apr 17, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low provider/opencodeRuntime.ts:303

resolveOpenCodeBinaryPath calls execFileSync("which", ...) unconditionally, which throws ENOENT on Windows since which does not exist there (the Windows equivalent is where). Since the function is exported without any platform guard, any Windows caller will crash. Consider adding a platform check to use where on Windows, or document that this function is Unix-only and add a runtime guard that throws a clear error on unsupported platforms.

+import { platform } from "node:os";
+
 export function resolveOpenCodeBinaryPath(binaryPath: string): string {
   if (Path.isAbsolute(binaryPath)) {
     return binaryPath;
   }
+  if (platform() === "win32") {
+    throw new Error("resolveOpenCodeBinaryPath is not supported on Windows");
+  }
   return execFileSync("which", [binaryPath], {
     encoding: "utf8",
     timeout: 3_000,
   }).trim();
 }
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/src/provider/opencodeRuntime.ts around lines 303-311:

`resolveOpenCodeBinaryPath` calls `execFileSync("which", ...)` unconditionally, which throws `ENOENT` on Windows since `which` does not exist there (the Windows equivalent is `where`). Since the function is exported without any platform guard, any Windows caller will crash. Consider adding a platform check to use `where` on Windows, or document that this function is Unix-only and add a runtime guard that throws a clear error on unsupported platforms.

Evidence trail:
apps/server/src/provider/opencodeRuntime.ts lines 303-311 - shows `resolveOpenCodeBinaryPath` using `execFileSync("which", ...)` without platform check. Line 421-423 shows the internal caller `detectMacosSigkillHint` is guarded by `process.platform === "darwin"`. The function is exported at line 303 but has no platform guard itself.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cursor[bot]
cursor Bot reviewed Apr 17, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e2d5c2f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/contracts/src/settings.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/serverSettings.ts
const ServerSettingsJson = fromLenientJson(ServerSettings);

const PROVIDER_ORDER: readonly ProviderKind[] = ["codex", "claudeAgent"];
const PROVIDER_ORDER: readonly ProviderKind[] = ["codex", "claudeAgent", "opencode"];

@cursor cursor Bot Apr 17, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCode enabled by default changes text generation fallback

Medium Severity

Adding "opencode" to PROVIDER_ORDER while OpenCodeSettings.enabled defaults to true means resolveTextGenerationProvider will now silently fall back to the OpenCode provider when both Codex and Claude are disabled. Since most users won't have the opencode binary installed, this turns a previously graceful "no provider" pass-through into confusing binary-not-found errors for text generation (commit messages, branch names, etc.).

Additional Locations (1)
  • packages/contracts/src/settings.ts#L93-L94
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e2d5c2f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juliusmarminge
juliusmarminge merged commit ce94fee into pingdotgg:main Apr 17, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@coygeek coygeek mentioned this pull request Apr 17, 2026
Feature Request: OpenCode support #539
Closed
orlaya added a commit to orlaya/t3code that referenced this pull request Apr 17, 2026
@orlaya
Default agentKind to "primary" in OpenCodeAdapter buildEventBase
eefda59
Reconciles our required-agentKind contract (from thinking-blocks feature)
with upstream's new OpenCodeAdapter (pingdotgg#1758), which was written without
agentKind awareness. No sub-agent concept in OpenCode currently, so
hard-coding "primary" in the shared buildEventBase helper covers all 21
event construction sites in one place.

Also syncs bun.lock to match our tweaked root devDependencies after
upstream's lockfile was used during rebase auto-merge.
@pompydev pompydev mentioned this pull request Apr 18, 2026
Add OpenCode to README #2154
Merged
2 tasks done
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Apr 18, 2026
@aaditagrawal
sync: merge 33 upstream commits from pingdotgg/t3code
d583485
Integrates upstream/main (9df3c64) on top of fork's main (9602c18).

Upstream features adopted:
- Claude Opus 4.5 and 4.7 built-in models (pingdotgg#2072, pingdotgg#2143)
- Node-native TypeScript migration across desktop/server (pingdotgg#2098)
- Configurable project grouping with client-settings overrides (pingdotgg#2055, pingdotgg#2099)
- Thread status in command palette (pingdotgg#2107)
- Responsive composer / plan sidebar on narrow windows (pingdotgg#1198)
- Capture-phase CTRL+J keydown for Windows terminal toggle (pingdotgg#2113/pingdotgg#2142)
- Bypass xterm for global terminal shortcuts (pingdotgg#1580)
- Windows ARM build target (pingdotgg#2080)
- Windows PATH hydration + repair (pingdotgg#1729)
- Gitignore-aware workspace search (pingdotgg#2078)
- Claude process leak fix + stale session monitoring (pingdotgg#2042)
- Preserve provider bindings when stopping sessions (pingdotgg#2084)
- Clean up invalid pending-approval projections (pingdotgg#2106) — new migration
- Extract backend startup readiness coordination
- Drop stale text-gen options on reset (pingdotgg#2076)
- Extend negative repository identity cache TTL (pingdotgg#2083)
- Allow deleting non-empty projects from warning toast (pingdotgg#1264)
- Restore defaults only on General settings (pingdotgg#1710)
- Release workflow modernization (blacksmith runners, GitHub App token guards, v0.0.20 version bump)

Fork features preserved:
- All 8 providers (codex, claudeAgent, copilot, cursor, opencode,
  geminiCli, amp, kilo) with their adapters, services, and tests
- Fork's custom OpenCode protocol impl in apps/server/src/opencode/ (kept
  over upstream's @opencode-ai/sdk-based provider added in pingdotgg#1758 — fork's
  version is tested and integrated; upstream's parallel files deleted)
- Fork's direct-CLI Cursor adapter (kept over upstream's new ACP-based
  CursorProvider added in pingdotgg#1355 — upstream's parallel files deleted)
- Fork's ProviderRegistry aggregates only codex + claudeAgent snapshots;
  the other 6 providers register via ProviderAdapterRegistry
- PROVIDER_CACHE_IDS stays at [codex, claudeAgent] matching what the
  registry actually caches
- Migration IDs preserved (fork 23/24/25/26; upstream's new 025 lands at
  ID 27 to avoid re-applying on deployed fork DBs)
- Fork's generic per-provider settings (enabled/binaryPath/configDir/
  customModels) kept over upstream's opencode-specific serverUrl/password
- Log directory IPC channels, updateInstallInFlight tracking, icon
  composer pipeline all preserved
- Fork's simplified release.yml (no npm CLI publish, no nightly infra)
- composerDraftStore normalizeProviderKind widened to accept all 8 kinds
- Dark mode --background set to #0f0f0f

Test status:
- All 9 package typechecks pass
- Lint clean (0 errors)
- Tests: 1877 passed, 15 skipped (incl. 4 historically-flaky GitManager
  cross-repo PR selector tests newly gated with TODO for Node-native-TS
  follow-up)
@aaditagrawal aaditagrawal mentioned this pull request Apr 18, 2026
sync: merge 33 upstream commits from pingdotgg/t3code aaditagrawal/t3code#71
Merged
5 of 9 tasks
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Apr 19, 2026
@aaditagrawal
feat: adopt upstream ACP-based Cursor + @opencode-ai/sdk OpenCode bac…
3f8d328
…kends

Replaces fork's hand-rolled Cursor (direct-CLI) and OpenCode (custom
protocol) backends with upstream's implementations while keeping fork's
8-provider model picker UI flow intact.

## Adopted from upstream

### Cursor (ACP-based, from upstream pingdotgg#1355)
- `provider/Layers/CursorProvider.ts` + test
- `provider/Services/CursorProvider.ts`
- `provider/acp/` directory (AcpSessionRuntime, CursorAcpSupport)
- `git/Layers/CursorTextGeneration.ts` + test
- Upstream's `Layers/CursorAdapter.ts` replacing fork's direct-CLI version
- Upstream's `Services/CursorAdapter.ts`

### OpenCode (@opencode-ai/sdk/v2-based, from upstream pingdotgg#1758)
- `provider/Layers/OpenCodeProvider.ts` + test
- `provider/Services/OpenCodeProvider.ts`
- `provider/opencodeRuntime.ts` + test
- `git/Layers/OpenCodeTextGeneration.ts` + test
- Upstream's `Layers/OpenCodeAdapter.ts` replacing fork's thin wrapper
- Upstream's `Services/OpenCodeAdapter.ts`

### Contract additions
- `CursorSettings` schema (apiEndpoint) and `OpenCodeSettings` schema
  (serverUrl, serverPassword) restored; other 6 providers still use
  GenericProviderSettings

## Removed (fork's custom versions)
- `apps/server/src/opencode/` (7 files: types/utils/eventHandlers/
  serverLifecycle/errors/index + test)
- `apps/server/src/opencodeServerManager.ts` + test
- `apps/server/src/provider/Layers/CursorUsage.ts` + test

## Wiring changes
- `ProviderRegistry.ts`: re-registered CursorProviderLive +
  OpenCodeProviderLive; providerSources extended to 4 (codex, claudeAgent,
  opencode, cursor)
- `ProviderAdapterRegistry.ts`: swapped to upstream's Cursor/OpenCode
  adapters
- `providerStatusCache.ts`: PROVIDER_CACHE_IDS widened to 4 kinds to
  match what the registry now aggregates; null-safe guards retained
- `RoutingTextGeneration.ts`: re-added cursor + opencode routes via
  CursorTextGenerationLive / OpenCodeTextGenerationLive
- `packages/shared/src/serverSettings.ts`: applyServerSettingsPatch
  switch handles cursor/opencode specific option shapes

## Preserved
- All 8 providers across ProviderKind/ModelSelection/settings
- Fork's ProviderModelPicker, composerProviderRegistry, Icons,
  ProviderLogo, SettingsPanels PROVIDER_SETTINGS structure
- Fork's amp/kilo/geminiCli/copilot adapters + server managers
- Dark-mode --background #0f0f0f
- Migrations 23-27 (fork's + upstream's)

## Test fixes
- `GitManager.test.ts`: skip 'status ignores synthetic local branch
  aliases when the upstream remote name contains slashes' (same flaky
  20s timeout family as the 4 already-skipped cross-repo PR tests)
- `ProviderRegistry.test.ts`: update 'returns snapshots for all
  supported providers' expectation from [codex,claudeAgent] to
  [codex,claudeAgent,opencode,cursor] to match 4-provider registry

## Status
- bun typecheck: 9/9 packages clean
- bun run lint: 0 errors, 32 warnings
- bun fmt: clean
- bun run test: all packages pass
@Spitfire1900

Spitfire1900 commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Closes #539

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alecramos-sudo added a commit to alecramos-sudo/t3code that referenced this pull request Apr 20, 2026
@alecramos-sudo @claude
merge: upstream/main into dev-build (v0.0.20 + 27 commits)
d1b3124
Brings in upstream changes since d22c6f5:
- Claude Opus 4.5 built-in model (pingdotgg#2143)
- Claude Opus 4.7 built-in model (pingdotgg#2072)
- opencode provider support (pingdotgg#1758)
- Claude process leak fix & session reaper (pingdotgg#2042)
- Configurable project grouping (pingdotgg#2055)
- Node-native TypeScript for desktop/server (pingdotgg#2098)
- Clean up invalid pending approval projections (pingdotgg#2106)
- Thread status in command palette (pingdotgg#2107)
- Backend startup readiness coordination (pingdotgg#2133)
- Preserve provider bindings on session stop (pingdotgg#2125)
- Allow deleting non-empty projects (pingdotgg#1264)
- Various Windows fixes and CI improvements

Conflict resolutions:
- model.ts: kept claudeAgent opus-4-7 default, added opencode entry
- settings.ts: adopted upstream sidebarProjectGroupingMode/Overrides
- ClaudeProvider.ts: adopted upstream Opus 4.7 effort config
- Sidebar.tsx: adopted upstream project grouping approach
- package.json: kept custom desktop-only build filter

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@mwolson mwolson mentioned this pull request Apr 20, 2026
[Bug]: Regression: OpenCode probe blocks cold start 45-75s (no timeout) #2248
Closed
2 tasks done
@stefanbinoj stefanbinoj mentioned this pull request Apr 22, 2026
[Feature]: Add support for Zed as a provider #2280
Closed
MuneerAhmed03 pushed a commit to MuneerAhmed03/t3code that referenced this pull request Apr 26, 2026
@nexxeln @juliusmarminge
@codex @claude
feat: add opencode provider support (pingdotgg#1758)
15aacfb
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
youpele52 referenced this pull request in youpele52/bigbud Jun 17, 2026
@nexxeln @juliusmarminge
@codex @claude
feat: add opencode provider support (#1758)
3c6a700
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Aug 18, 2026
@nexxeln @juliusmarminge
@codex @claude
feat: add opencode provider support (pingdotgg#1758)
0301c17
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@juliusmarminge juliusmarminge juliusmarminge left review comments
@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nexxeln @Coder-soft @Spitfire1900 @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.