feat(analysis): add local agent runners and OpenCode - #316
Open
lesbass wants to merge 1 commit into
Open
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
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.
What does this PR do?
Adds an extensible analysis runner selector so Code Insights can reuse locally authenticated Claude Code, Codex, or OpenCode installations instead of requiring a separate API key. It also adds OpenCode Zen/Go as a remote provider and refreshes the suggested OpenAI, Anthropic, and Gemini model catalogs.
--runner api|claude|codex|opencode; keeps--nativeas a Claude-compatible alias.insights, SessionEnd hooks, and queued analysis./modelsdiscovery.Type of change
Related issue
Closes #315
Test plan
pnpm test— all tests pass (CLI 587, dashboard 15, server 583)pnpm build— no build errorsManual integration checks:
opencode-go/deepseek-v4-flash) accepted stdin in non-interactive JSON mode and returned the expected JSONL text event with all permissions denied.opencode models opencode-goreturned the current authenticated Go catalog.Notes for reviewer
The existing
AnalysisRunnerabstraction is retained.runner_type = nativequeue rows remain supported and normalize to Claude, so existing installations do not need a database migration.The OpenCode remote client selects the endpoint shape from the model family: Responses for GPT models, Messages for Claude/Minimax/Qwen models, and OpenAI-compatible Chat Completions for the remaining Zen/Go catalog. The base URL remains customizable.
Local agent token counts remain zero in
analysis_usage, matching the existing Claude native behavior because those calls are accounted for by the agent subscription rather than a Code Insights API key.