-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(app): add opencode sidecar support as AI provider #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
louis030195
wants to merge
8
commits into
main
Choose a base branch
from
feat/opencode-sidecar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds OpenCode as an AI provider option in the screenpipe app. OpenCode is an agentic coding AI that can be spawned as a sidecar process, similar to how Openwork integrates it. Changes: - Add opencode.rs with sidecar management (spawn, stop, info, check commands) - Register OpenCode commands in main.rs - Add OpencodeState to manage the sidecar process - Add "opencode" to AIProviderType enum in Rust and TypeScript - Add OpenCode provider card in AI presets settings - Add OpenCode option in AI presets selector - Create use-opencode.tsx React hook for frontend integration - Add placeholder opencode.png icon The OpenCode sidecar exposes an HTTP server that the app can communicate with for AI chat functionality. It supports authentication via random UUID credentials and dynamic port allocation. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Major rework of OpenCode integration: - OpenCode is NOT an OpenAI-compatible provider, so it cannot be added as a simple AI preset. Instead, create a dedicated OpenCode chat UI. Changes: - Remove OpenCode from AIProviderType enum (not OpenAI-compatible) - Remove OpenCode from AI presets UI - Create dedicated /opencode route with OpenCodeChat component - Update opencode.rs with: - Proper Windows cleanup support - App exit cleanup via cleanup_opencode() - Health check polling before returning from start - Better error messages with install instructions - Add @opencode-ai/sdk dependency for proper API integration - Use session.promptAsync with parts for sending messages - Add event listeners for opencode_log, opencode_terminated, opencode_error The OpenCode integration now: 1. Starts OpenCode sidecar on demand 2. Uses OpenCode's native SDK for communication 3. Shows proper install instructions if not available 4. Cleans up properly on app exit Co-Authored-By: Claude Opus 4.5 <[email protected]>
…loud proxy - Add Chat/Code tab switcher in global chat dialog header - OpenCodeChat component uses @opencode-ai/sdk for proper API integration - Bundle opencode as sidecar (added to tauri.macos.conf.json externalBin) - Auto-configure opencode to use screenpipe-cloud AI proxy (Vertex AI credits) - Pass user's screenpipe token for authentication (zero friction) - Support Windows/Linux/macOS with proper process cleanup - Health check polling before returning from start Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add OpenCode as AI provider type (openai, ollama, custom, screenpipe-cloud, opencode) - OpenCode shows as preset option in settings alongside other providers - Auto-start OpenCode sidecar when preset is selected - Use OpenCode SDK for messaging when provider is opencode - Remove tab-based UI - single unified chat experience - Requires login (uses screenpipe user token for auth) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add opencode to Windows and Linux externalBin configs - Delete unused opencode-chat.tsx and opencode page - Add project directory picker with localStorage persistence - Improve message polling with smart completion detection - Show project name in header when OpenCode is active - Allow changing project folder from header button - Better loading states and error messages Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add OpenCode download to pre_build.js for macOS (arm64, x86_64) and Linux - Download from GitHub releases (v0.0.55) - Remove opencode from Windows config (no Windows binary available) - Add availability check in global chat - Show "not available on Windows" message when OpenCode preset selected on Windows Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update to new OpenCode repo (anomalyco/opencode v1.1.45) - Add Windows binary download in pre_build.js - Add opencode back to Windows externalBin config - All platforms now supported: macOS, Linux, Windows Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove bundled OpenCode binary from externalBin configs. Instead, install OpenCode via bun in the background when the app starts. If installation fails, the OpenCode preset is simply hidden from the UI. - Remove opencode from externalBin in all platform configs - Remove download code from pre_build.js - Add opencode_install command that runs bun add -g opencode-ai - Add background availability check and install in AIPresets component - Emit opencode_installed event when installation completes - Conditionally render OpenCode card only when available Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds OpenCode as a dedicated feature in the screenpipe app. OpenCode is an agentic coding AI that can be spawned as a sidecar process.
Important: OpenCode is NOT an OpenAI-compatible API, so it cannot be a simple AI preset. Instead, this PR creates a dedicated OpenCode chat interface at
/opencode.Architecture
Changes
Rust Backend (
src-tauri/src/opencode.rs)opencode_start(projectDir)- Spawns OpenCode on a random port with:opencode_stop()- Kills the sidecar (supports macOS, Linux, Windows)opencode_info()- Returns current sidecar stateopencode_check()- Checks if OpenCode is availablecleanup_opencode()- Called on app exit to clean upFrontend
/opencoderoute - Dedicated OpenCode chat pageOpenCodeChatcomponent - Full chat UI with:useOpencodehook - React hook for sidecar management with event listenersDependencies
@opencode-ai/sdkfor proper API integrationWhat's NOT included
Test plan
/opencode🤖 Generated with Claude Code