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
2121 import type { SimpleGit } from 'simple-git';
2222 import { debug, formatNumber, warn } from '../logger.js';
2323
24+/** Must match **`FORK_PR_BASE_REMOTE`** in **`git-conflicts.ts`** (fork PR base remote name). */
25+const GIT_SCAN_FORK_BASE_REMOTE = 'upstream';
26+
2427 /** One warning per process per workdir+reason when merge base for prr-fix scan is missing (pill-output #559). */
2528 const warnedScanBaseFallback = new Set<string>();
2629 /** One warning per process per workdir when git log --grep scan throws (non-fatal degrade). */
@@ -49,10 +52,26 @@ function scanCacheKey( · 22 unmodified lines
4952 return `${workdir}\0${branch}\0${headSha}\0${base}\0${resolvedBaseLabel}`;
5053 }
5154
52−/** Resolve `origin/<prBase>` or first existing of origin/main|master|develop for `base..branch` log range. */
53−async function resolveScanBaseBranch(git: SimpleGit, prBaseBranch?: string): Promise<string | null> {
55+/**
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+ */
59+async function resolveScanBaseBranch(
60+ git: SimpleGit,
61+ prBaseBranch?: string,
62+ preferUpstreamForPrBase?: boolean
63+): Promise<string | null> {
5464 const prBase = prBaseBranch?.trim();
5565 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+ }
5675 const prRef = `origin/${prBase}`;
5776 try {
5877 await git.raw(['rev-parse', '--verify', prRef]);
@@ -98,6 +117,11 @@ export interface ScanCommittedFixesOptions { · 39 unmodified lines
98117 * rely on `-n 100`; using the real PR base matches pill/external audits expecting a proper merge range.
99118 */
100119 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;
101125 }
102126
103127 /**
@@ -139,7 +163,7 @@ export async function scanCommittedFixes( · 35 unmodified lines
139163 ): Promise<string[]> {
140164 let resolvedBase: string | null = null;
141165 try {
142− resolvedBase = await resolveScanBaseBranch(git, opts?.prBaseBranch);
166+ resolvedBase = await resolveScanBaseBranch(git, opts?.prBaseBranch, opts?.useUpstreamPrBaseForGitRecovery);
143167 } catch (error) {
144168 debug('resolveScanBaseBranch failed', { error });
145169 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