Add OpenCode provider support#9
Merged
mdemirhan merged 6 commits intoApr 16, 2026
Merged
Conversation
Introduce OpenCode as a first-class provider across discovery, parsing, indexing, search, settings, and history rendering. Add a SQLite-backed OpenCode adapter that reads session data from �[1m�[22m, exposes stable logical session sources, and normalizes tool and edit payloads through the existing provider pipeline. Keep the change set focused by extending the shared materialized-source flow only where needed for database-backed sessions. Add changed-path expansion, generic tool-edit extraction for OpenCode writes, default discovery roots, and the small UI and app-state updates required to surface OpenCode in settings and provider-driven state. Cover the new provider with focused discovery, parser, indexing, tool-parsing, settings, and app-state tests, including a migration that heals older default saved provider selections so OpenCode appears for existing installs without overriding intentional custom subsets.
Fold the OpenCode follow-up fixes into a single commit by tightening renderer shortcut handling, platform-boundary compatibility, provider-aware test fixtures, and type-safe test data updates required by the expanded provider set. Stabilize the App pagination shortcut coverage by making the Cmd+Left/Right test use an explicit multi-page history fixture and wait for the pager to become navigable before asserting the shortcut transition. Keep the OpenCode provider branch green across lint, platform-boundary checks, typecheck, test, and coverage verification.
506d19b to
d9f0ffd
Compare
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
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
Add OpenCode as a new provider in Code Trail with support for discovery, parsing,
indexing, search, settings, and history rendering.
What Changed
opencodeto the provider contracts and metadataopencode.dbWhy
OpenCode session history lives in a SQLite database rather than transcript files, so it needs provider-specific discovery and loading while still fitting the existing indexing and renderer flow. This change keeps the integration narrowly scoped and avoids unrelated refactors.
Validation
ELECTRON_RUN_AS_NODE=1 ./apps/desktop/node_modules/.bin/electron ./node_modules/vitest/vitest.mjs run packages/core/src/discovery/discoverSingleFile.test.ts packages/core/src/discovery/discoverSessionFiles.test.ts packages/core/src/parsing/providerParsers.test.ts packages/core/src/indexing/indexSessions.integration.test.ts apps/desktop/src/main/appStateStore.test.ts apps/desktop/src/renderer/components/messages/toolParsing.test.ts apps/desktop/src/renderer/components/SettingsView.test.tsxbun run desktop:buildTest Coverage
apps/desktop/src/main/appStateStore.test.tsopencode, while preserving intentional custom subsets.apps/desktop/src/renderer/components/SettingsView.test.tsxOpenCode data rootpath.apps/desktop/src/renderer/components/messages/toolParsing.test.tsfilePath,content,oldString, andnewStringnormalize into the shared tool parsing flow.packages/core/src/discovery/discoverSessionFiles.test.tsopencode.dband changed-path expansion from the database file to logical session sources.packages/core/src/discovery/discoverSingleFile.test.tspackages/core/src/indexing/indexSessions.integration.test.tspackages/core/src/parsing/providerParsers.test.tsScreenshots