History

feat(prr): providers, rotation, merge/thread UX, and docs

- First-class LLM providers: Ollama, LM Studio, OpenRouter, NVIDIA Cloud (shared clients, config, max_tokens compat, reachability, pill parity). - llm-api: honor PRR_LLM_PROVIDER for openrouter/nvidiacloud; sync public provider in isAvailable; explicit provider fails checkStatus without key. - validateAndFilterModels: env key fallbacks for OpenRouter/NVIDIA; keep rotation when /v1/models is empty; align needs* with llm-api provider. - Local probes: classify connection failures via Error.cause chain. - GitHub: mergeable polling, fork/upstream base handling, pr-mergeable helper. - Thread working reactions; thread-replies and reporter robustness. - ElizaCloud retry policy, final-audit fallback, conflict/merge and state improvements; contributor-sheet tool; tests and catalog refresh. - README, CHANGELOG, DEVELOPMENT, AGENTS, MODELS, .env.example: WHYs for provider selection, rotation validation, and local backends.

Odilitime committed 6 months ago

Commit 0d3cdad1 parent 257434e125 files · +6702 −576Browse files

Showing the changes to shared/git/git-commit-scan.ts (1 of 125 files). Show all

Unified · Split

shared/git/git-commit-scan.ts+27−3
@@ -21,6 +21,9 @@ · 20 unmodified lines
21import type { SimpleGit } from 'simple-git';21import type { SimpleGit } from 'simple-git';
22import { debug, formatNumber, warn } from '../logger.js';22import { debug, formatNumber, warn } from '../logger.js';
23 23
24/** Must match **`FORK_PR_BASE_REMOTE`** in **`git-conflicts.ts`** (fork PR base remote name). */
25const GIT_SCAN_FORK_BASE_REMOTE = 'upstream';
26
24/** One warning per process per workdir+reason when merge base for prr-fix scan is missing (pill-output #559). */27/** One warning per process per workdir+reason when merge base for prr-fix scan is missing (pill-output #559). */
25const warnedScanBaseFallback = new Set<string>();28const warnedScanBaseFallback = new Set<string>();
26/** One warning per process per workdir when git log --grep scan throws (non-fatal degrade). */29/** One warning per process per workdir when git log --grep scan throws (non-fatal degrade). */
@@ -49,10 +52,26 @@ function scanCacheKey( · 22 unmodified lines
49 return `${workdir}\0${branch}\0${headSha}\0${base}\0${resolvedBaseLabel}`;52 return `${workdir}\0${branch}\0${headSha}\0${base}\0${resolvedBaseLabel}`;
50}53}
51 54
52/** Resolve `origin/<prBase>` or first existing of origin/main|master|develop for `base..branch` log range. */55/**
53async function resolveScanBaseBranch(git: SimpleGit, prBaseBranch?: string): Promise<string | null> {56 * Resolve **`upstream/<prBase>`** then **`origin/<prBase>`** (when fork recovery), else **`origin/<prBase>`**,
57 * then first existing of **`origin/main|master|develop`** for **`base..branch`** `git log` range.
58 */
59async function resolveScanBaseBranch(
60 git: SimpleGit,
61 prBaseBranch?: string,
62 preferUpstreamForPrBase?: boolean
63): Promise<string | null> {
54 const prBase = prBaseBranch?.trim();64 const prBase = prBaseBranch?.trim();
55 if (prBase) {65 if (prBase) {
66 if (preferUpstreamForPrBase) {
67 const upRef = `${GIT_SCAN_FORK_BASE_REMOTE}/${prBase}`;
68 try {
69 await git.raw(['rev-parse', '--verify', upRef]);
70 return upRef;
71 } catch {
72 /* upstream missing or not fetched — try origin */
73 }
74 }
56 const prRef = `origin/${prBase}`;75 const prRef = `origin/${prBase}`;
57 try {76 try {
58 await git.raw(['rev-parse', '--verify', prRef]);77 await git.raw(['rev-parse', '--verify', prRef]);
@@ -98,6 +117,11 @@ export interface ScanCommittedFixesOptions { · 39 unmodified lines
98 * rely on `-n 100`; using the real PR base matches pill/external audits expecting a proper merge range.117 * rely on `-n 100`; using the real PR base matches pill/external audits expecting a proper merge range.
99 */118 */
100 prBaseBranch?: string;119 prBaseBranch?: string;
120 /**
121 * When true (fork PR with **`base.repo` ≠ head**), **`resolveScanBaseBranch`** prefers **`upstream/<prBase>`**
122 * so **`prr-fix:`** recovery matches GitHub’s merge base. Requires **`upstream`** ref (see setup prefetch).
123 */
124 useUpstreamPrBaseForGitRecovery?: boolean;
101}125}
102 126
103/**127/**
@@ -139,7 +163,7 @@ export async function scanCommittedFixes( · 35 unmodified lines
139): Promise<string[]> {163): Promise<string[]> {
140 let resolvedBase: string | null = null;164 let resolvedBase: string | null = null;
141 try {165 try {
142 resolvedBase = await resolveScanBaseBranch(git, opts?.prBaseBranch);166 resolvedBase = await resolveScanBaseBranch(git, opts?.prBaseBranch, opts?.useUpstreamPrBaseForGitRecovery);
143 } catch (error) {167 } catch (error) {
144 debug('resolveScanBaseBranch failed', { error });168 debug('resolveScanBaseBranch failed', { error });
145 resolvedBase = null;169 resolvedBase = null;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t