Skip to content

Adaptive review#137

Merged
LinceMathew merged 3 commits into
mainfrom
adaptive-review
Jul 3, 2026
Merged

Adaptive review#137
LinceMathew merged 3 commits into
mainfrom
adaptive-review

Conversation

@LinceMathew

Copy link
Copy Markdown
Contributor

Summary

Provisions Adaptive Review support during git-lrc setup by creating a second, cheaper "helper" AI connector alongside the existing "leader" connector.

Today, git-lrc setup only creates one Gemini connector (gemini-2.5-flash). Adaptive Review on the LiveReview backend uses a leader/helper model pair — a strong model for full reviews and a lightweight model for cheaper/faster passes. This PR makes setup provision both automatically:

  • Adds a Role field ("leader" / "helper") to CreateConnectorRequest and ConnectorRemote, threaded through connector creation, config rendering, and the API response.
  • After the existing leader connector is created, setup now also creates a Gemini Flash-Lite helper connector (gemini-2.5-flash-lite), reusing the same free Gemini key — no second key prompt required.
  • Helper connector creation is best-effort: if it fails, setup does not fail overall. The org falls back to leader-only and can configure a helper connector later; a warning is printed and logged.
  • config/ai_connectors.go now writes role = "..." into the rendered TOML for every connector, defaulting empty/legacy roles to "leader" for backward compatibility with older configs.
  • Refactored setup/connectors.go to remove duplication between CreateGeminiConnector and CreateGeminiHelperConnector: extracted a shared createConnector() helper (network call, status check, error handling) and a defaultAPIURL() helper reused by ValidateGeminiKey too.

Linked Issue

Add the issue link this PR fulfills.

Validation

  • go build ./... — passes.
  • go test ./setup/... ./internal/appui/... ./config/... — passes.
  • New/updated unit tests:
    • setup/connectors_test.go: helper connector sends role="helper" + lite model + reused key; leader connector sends role="leader" + default model.
    • internal/appui/ui_connectors_test.go: config rendering writes role = "leader" for explicit-leader and empty-role (legacy) connectors, and role = "helper" for helper connectors.

Checklist

  • This PR fulfills an agreed issue.
  • I kept the change narrow and scoped.
  • I ran the most specific relevant validation and described it above.
  • If I changed behavior, I called that out clearly in this PR.
  • If I touched UI, I attached a GIF or video walkthrough. This is required. (N/A — CLI setup output only, no UI)
  • If I changed storage/ responsibilities, I updated storage/storage_status.md and ran make check-status-doc. (N/A — no storage/ changes)
  • If I changed network/ responsibilities, I updated network/network_status.md and ran make check-status-doc. (N/A — network/ package itself untouched; only callers changed)
  • If this change touches security, disclosure flow, credentials, storage, network behavior, or remote data handling, I reviewed SECURITY.md and updated related documentation if needed. (Reuses the existing validated Gemini key for a second connector — no new credential handling introduced; please confirm this doesn't need a SECURITY.md note.)

shrsv and others added 3 commits July 2, 2026 14:55
LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
LiveReview Pre-Commit Check: ran (iter:3, coverage:0%)
@LinceMathew LinceMathew merged commit 5089086 into main Jul 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants