jatinot ·
view on GitHub ↗ ·
graph: workspace 365ee7cde142
## What this PR does
Fixes the PR-review agent's data pipeline (camelCase/snake_case property mismatch and truncation bugs starved it of actual PR content) and refreshes provider model lists to current lineups.
- **Content loading fix**: `prTools` now reads the camelCase `baseBranch`/`headBranch`/`baseSha`/`headSha` properties the indexer actually writes (previously mismatched, so `prClient.getFileContent` was never called and content came back as `(PR client not available)`). SHAs are now preferred over branch names, and `PRClient.getFileContent` gains a `repoOverride` param so fork PRs fetch from the head repo instead of failing.
- **Truncation overhaul**: `get_pr_file_change` now truncates each field independently (diff/content capped separately, `*_truncated` flags, line-numbered content, `startLine`/`endLine` paging) instead of hard-cutting a combined 8k JSON blob mid-stream; stored patch cap raised 5k→50k chars; GitHub PR files fetch paginated past 100 entries.
- **Verdict guardrail**: review runner (`reviewRunner.ts` + new `pr/reviewParse.ts`) tracks which changed files were actually inspected via `enforceInspectionCoverage` and downgrades APPROVE→COMMENT if files were skipped; comment line-snapping capped at ±3 lines (previously unbounded/first-line fallback).
- **Schema/type changes**: `PRSummary`/`types.ts` gain `base_sha`, `head_sha`, `head_repo`; indexer writes `baseSha`/`headSha`/`headRepo` node properties; `ReviewResult.tsx` parsing logic extracted to React-free `ui/src/pr/reviewParse.ts` and re-exported (import path preserved).
- **Model refresh**: Anthropic/OpenAI/Gemini model lists and defaults updated to July 2026 lineups; `ChatPanel` now falls back to `defaultModel` via `resolveModelChoice` when a stored model ID no longer exists in the provider list (avoids pinning dropdown to a retired ID).
Risk: high fan-in on `indexPRIntoGraph` (13 call sites), `makePRTools`/`makePR` (12 each) and `detectProvider` (18) means the property/schema changes and truncation behavior ripple across most PR-review and provider-detection code paths; 155 symbols touched across 15 files with 41 external call sites raises regression surface for both PR indexing and chat provider selection.
| symbol | kind | fan-in | file |
|---|---|---|---|
detectProvider |
Function | 5 | ui/src/chat/providers.ts |
sendMessage |
Function | 4 | ui/src/appComponents/ChatPanel.tsx |
indexPRIntoGraph |
Function | 4 | ui/src/pr/indexer.ts |
sendMessage |
Function | 4 | ui/src/appComponents/ChatPanel.tsx |
indexPRIntoGraph |
Function | 4 | ui/src/pr/indexer.ts |
makePRTools |
Function | 3 | ui/src/chat/prTools.ts |
getPRDetail |
Method | 3 | ui/src/pr/client.ts |
createReview |
Method | 3 | ui/src/pr/client.ts |
postComment |
Method | 3 | ui/src/pr/client.ts |
ghFetch |
Function | 3 | ui/src/pr/githubPR.ts |
makePRTools |
Function | 3 | ui/src/chat/prTools.ts |
getPRDetail |
Method | 3 | ui/src/pr/client.ts |
createReview |
Method | 3 | ui/src/pr/client.ts |
postComment |
Method | 3 | ui/src/pr/client.ts |
detectProviderproviders.test.ts
File
ui/src/chat/__tests__/providers.test.ts:?indexPRIntoGraphhandleIndexPR
Function
ui/src/appComponents/PRListPanel.tsx:128handleIndexAll
Function
ui/src/appComponents/PRListPanel.tsx:140makePRToolscreateChatAgent
Function
ui/src/chat/agent.ts:64getPRDetailhandleSelectPR
Function
ui/src/appComponents/PRListPanel.tsx:116handleIndexAll
Function
ui/src/appComponents/PRListPanel.tsx:140handleLookup
Function
ui/src/appComponents/PRListPanel.tsx:163createReviewhandleSubmitReview
Function
ui/src/appComponents/PRDetailPanel.tsx:182client.test.ts
File
ui/src/pr/__tests__/client.test.ts:?