@in-the-loop-labs/pair-review 5.3.3 → 5.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/bin/git-diff-lines +2 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/skills/analyze/scripts/git-diff-lines +104 -25
- package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
- package/public/css/pr.css +162 -46
- package/public/css/styles.css +0 -12
- package/public/js/components/AIPanel.js +3 -2
- package/public/js/components/AnalysisConfigModal.js +4 -1
- package/public/js/components/ChatPanel.js +15 -8
- package/public/js/components/PanelGroup.js +115 -21
- package/public/js/components/SuggestionNavigator.js +16 -3
- package/public/js/local.js +7 -12
- package/public/js/modules/diff-renderer.js +13 -0
- package/public/js/modules/file-comment-manager.js +19 -10
- package/public/js/modules/hunk-parser.js +39 -2
- package/public/js/modules/panel-resizer.js +41 -3
- package/public/js/modules/pierre-bridge.js +11 -2
- package/public/js/modules/suggestion-manager.js +128 -33
- package/public/js/pr.js +132 -29
- package/public/js/repo-settings.js +35 -19
- package/public/js/utils/git-paths.js +140 -0
- package/public/js/utils/smart-truncate.js +88 -0
- package/public/local.html +6 -0
- package/public/pr.html +6 -0
- package/src/ai/analyzer.js +15 -13
- package/src/ai/antigravity-provider.js +44 -24
- package/src/ai/codex-provider.js +67 -64
- package/src/ai/cursor-agent-provider.js +4 -4
- package/src/ai/muse-provider.js +68 -3
- package/src/ai/summary-generator.js +8 -5
- package/src/git/diff-flags.js +26 -12
- package/src/git/worktree.js +21 -43
- package/src/github/client.js +0 -88
- package/src/github/impl/graphql/pending-review-comments.js +5 -1
- package/src/github/submit-pr-context.js +56 -0
- package/src/local-review.js +34 -17
- package/src/main.js +80 -106
- package/src/routes/executable-analysis.js +14 -15
- package/src/routes/local.js +3 -5
- package/src/routes/pr.js +18 -105
- package/src/setup/pr-setup.js +1 -1
- package/src/setup/stack-setup.js +1 -1
- package/src/utils/diff-annotator.js +175 -25
- package/src/utils/diff-file-content.js +4 -26
- package/src/utils/diff-file-list.js +178 -42
- package/src/utils/git-paths.js +77 -0
- package/src/utils/paths.js +1 -25
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Copyright 2026 Tim Perkins (tjwp) | SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Git path decoding, shared by the server and the browser.
|
|
4
|
+
*
|
|
5
|
+
* pair-review runs every path-producing git command with core.quotePath=false,
|
|
6
|
+
* so non-ASCII names come out verbatim. Git still C-quotes a path that contains
|
|
7
|
+
* a control character, `"` or `\`: `tab<TAB>name.js` appears in a `diff --git`
|
|
8
|
+
* header as `"a/tab\tname.js"`. Diff text cached by older versions (written
|
|
9
|
+
* with git's default core.quotePath=true) also carries octal-escaped UTF-8
|
|
10
|
+
* (`"a/caf\303\251.js"`) until the review is refreshed.
|
|
11
|
+
*
|
|
12
|
+
* The browser reads paths straight out of the diff text (parseUnifiedDiff keys
|
|
13
|
+
* patches by them, Local mode builds its file list from them, Pierre names
|
|
14
|
+
* files from them), so it decodes headers exactly like the server. This file
|
|
15
|
+
* is the ONE implementation: src/utils/git-paths.js re-exports it for the
|
|
16
|
+
* server, and pr.html / local.html load it for the browser.
|
|
17
|
+
*/
|
|
18
|
+
(function () {
|
|
19
|
+
const QUOTED_PATH = '"(?:[^"\\\\]|\\\\.)*"';
|
|
20
|
+
const DIFF_GIT_PATHS_RE = new RegExp(`^(${QUOTED_PATH}|a\\/.+?) (${QUOTED_PATH}|b\\/.+)$`);
|
|
21
|
+
const DECODE_ESCAPES = { a: '\x07', b: '\b', t: '\t', n: '\n', v: '\v', f: '\f', r: '\r' };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Decode a git C-quoted path (including octal-escaped UTF-8 bytes). An
|
|
25
|
+
* unquoted value is returned unchanged: git always quotes a path that
|
|
26
|
+
* begins with `"`, so a leading quote is unambiguous.
|
|
27
|
+
* @param {string} value - Path as printed by git
|
|
28
|
+
* @returns {string} Real path
|
|
29
|
+
*/
|
|
30
|
+
function decodeGitPath(value) {
|
|
31
|
+
if (typeof value !== 'string' || value.length < 2 || !value.startsWith('"') || !value.endsWith('"')) {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
const encoder = new TextEncoder();
|
|
35
|
+
const bytes = [];
|
|
36
|
+
for (const match of value.slice(1, -1).matchAll(/\\([0-7]{1,3}|.)|([^\\]+)/gs)) {
|
|
37
|
+
if (match[2] !== undefined) {
|
|
38
|
+
bytes.push(...encoder.encode(match[2]));
|
|
39
|
+
} else if (/^[0-7]/.test(match[1])) {
|
|
40
|
+
bytes.push(parseInt(match[1], 8) & 0xff);
|
|
41
|
+
} else {
|
|
42
|
+
bytes.push(...encoder.encode(DECODE_ESCAPES[match[1]] ?? match[1]));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// ignoreBOM: a name that begins with U+FEFF keeps it (the default decoder
|
|
46
|
+
// would strip a leading EF BB BF as a byte order mark).
|
|
47
|
+
return new TextDecoder('utf-8', { ignoreBOM: true }).decode(new Uint8Array(bytes));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Parse the old and new paths from a `diff --git` header line. Either side
|
|
52
|
+
* may be C-quoted independently.
|
|
53
|
+
*
|
|
54
|
+
* An unquoted header for an unrenamed file is `a/<p> b/<p>`, split at its
|
|
55
|
+
* midpoint, so a name containing ` b/` (`x b/y.js`) still parses. Other
|
|
56
|
+
* unquoted headers split at the first ` b/`; parsePatchPaths corrects a
|
|
57
|
+
* rename or copy from its `rename from` / `rename to` lines.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} headerLine - First line of a per-file patch
|
|
60
|
+
* @returns {{ oldPath: string, newPath: string }|null} Decoded paths without
|
|
61
|
+
* their `a/` / `b/` prefixes, or null when the line is not a git header
|
|
62
|
+
*/
|
|
63
|
+
function parseDiffGitPaths(headerLine) {
|
|
64
|
+
if (typeof headerLine !== 'string' || !headerLine.startsWith('diff --git ')) return null;
|
|
65
|
+
const rest = headerLine.slice('diff --git '.length);
|
|
66
|
+
|
|
67
|
+
const half = (rest.length - 1) / 2;
|
|
68
|
+
if (Number.isInteger(half) && rest.startsWith('a/') && rest.startsWith(' b/', half)) {
|
|
69
|
+
const oldPath = rest.slice(2, half);
|
|
70
|
+
if (oldPath === rest.slice(half + 3)) {
|
|
71
|
+
return { oldPath, newPath: oldPath };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const match = rest.match(DIFF_GIT_PATHS_RE);
|
|
76
|
+
if (!match) return null;
|
|
77
|
+
const oldPath = decodeGitPath(match[1]);
|
|
78
|
+
const newPath = decodeGitPath(match[2]);
|
|
79
|
+
if (!oldPath.startsWith('a/') || !newPath.startsWith('b/')) return null;
|
|
80
|
+
return { oldPath: oldPath.slice(2), newPath: newPath.slice(2) };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Extended header lines git prints between `diff --git` and the first hunk
|
|
84
|
+
// can name the old and new paths explicitly. Copies use `copy from/to`.
|
|
85
|
+
const PATCH_PATH_LINE_RE = /^(?:rename|copy) (from|to) (.+)$/;
|
|
86
|
+
// Lines that end the extended header: nothing after them names a path.
|
|
87
|
+
const PATCH_HEADER_END_RE = /^(?:@@|--- |\+\+\+ |Binary files |GIT binary patch$|diff --git )/;
|
|
88
|
+
// Longest git extended header: old mode, new mode, similarity index,
|
|
89
|
+
// rename from, rename to, index. Lines past this never name a path.
|
|
90
|
+
const MAX_EXTENDED_HEADER_LINES = 8;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Resolve the old and new paths of one per-file patch.
|
|
94
|
+
*
|
|
95
|
+
* A renamed or copied file's unquoted `diff --git` header is ambiguous when
|
|
96
|
+
* a path contains ` b/` (`git mv 'x b/y.js' z.js` prints
|
|
97
|
+
* `diff --git a/x b/y.js b/z.js`). Git also prints `rename from` /
|
|
98
|
+
* `rename to` (or `copy from` / `copy to`) lines that each hold exactly one
|
|
99
|
+
* path, so those win over the header split. Every other patch has the same
|
|
100
|
+
* path on both sides, which parseDiffGitPaths splits unambiguously.
|
|
101
|
+
*
|
|
102
|
+
* @param {string|string[]} patch - Per-file patch text, or the diff's lines
|
|
103
|
+
* @param {number} [start=0] - Index of the `diff --git` line when `patch` is
|
|
104
|
+
* an array of lines
|
|
105
|
+
* @returns {{ oldPath: string, newPath: string }|null} Decoded paths, or null
|
|
106
|
+
* when the first line is not a git header
|
|
107
|
+
*/
|
|
108
|
+
function parsePatchPaths(patch, start = 0) {
|
|
109
|
+
const lines = typeof patch === 'string'
|
|
110
|
+
? patch.split('\n', MAX_EXTENDED_HEADER_LINES + 1)
|
|
111
|
+
: patch;
|
|
112
|
+
if (!Array.isArray(lines)) return null;
|
|
113
|
+
const paths = parseDiffGitPaths(lines[start]);
|
|
114
|
+
if (!paths) return null;
|
|
115
|
+
|
|
116
|
+
const end = Math.min(lines.length, start + 1 + MAX_EXTENDED_HEADER_LINES);
|
|
117
|
+
for (let i = start + 1; i < end; i++) {
|
|
118
|
+
const line = lines[i];
|
|
119
|
+
if (PATCH_HEADER_END_RE.test(line)) break;
|
|
120
|
+
const match = line.match(PATCH_PATH_LINE_RE);
|
|
121
|
+
if (!match) continue;
|
|
122
|
+
if (match[1] === 'from') {
|
|
123
|
+
paths.oldPath = decodeGitPath(match[2]);
|
|
124
|
+
} else {
|
|
125
|
+
paths.newPath = decodeGitPath(match[2]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return paths;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const GitPaths = { decodeGitPath, parseDiffGitPaths, parsePatchPaths };
|
|
132
|
+
|
|
133
|
+
if (typeof window !== 'undefined') {
|
|
134
|
+
window.GitPaths = GitPaths;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (typeof module !== 'undefined' && module.exports) {
|
|
138
|
+
module.exports = GitPaths;
|
|
139
|
+
}
|
|
140
|
+
})();
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright 2026 The pair-review Authors | SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* SmartTruncate - single-line truncation; the full text shows as a native
|
|
4
|
+
* `title` only when clipped. Modes: 'end' (titles) and 'start' (paths, keeps
|
|
5
|
+
* the file name). Use SmartTruncate.apply(el, opts), or just the
|
|
6
|
+
* `smart-truncate` class for 'end'.
|
|
7
|
+
*/
|
|
8
|
+
class SmartTruncate {
|
|
9
|
+
static ROOT_CLASS = 'smart-truncate';
|
|
10
|
+
static START_CLASS = 'smart-truncate--start';
|
|
11
|
+
static TEXT_CLASS = 'smart-truncate__text';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {HTMLElement} el
|
|
15
|
+
* @param {Object} [options]
|
|
16
|
+
* @param {'start'|'end'} [options.mode='end']
|
|
17
|
+
* @param {string} [options.fullText] - Tooltip text; defaults to textContent
|
|
18
|
+
* @returns {HTMLElement} el
|
|
19
|
+
*/
|
|
20
|
+
static apply(el, options = {}) {
|
|
21
|
+
if (!el) return el;
|
|
22
|
+
const { mode = 'end', fullText } = options;
|
|
23
|
+
|
|
24
|
+
el.classList.add(SmartTruncate.ROOT_CLASS);
|
|
25
|
+
|
|
26
|
+
// 'start' needs an isolated LTR wrapper inside the RTL box (see pr.css)
|
|
27
|
+
const first = el.firstElementChild;
|
|
28
|
+
const wrapper = el.childNodes.length === 1 && first?.classList.contains(SmartTruncate.TEXT_CLASS)
|
|
29
|
+
? first
|
|
30
|
+
: null;
|
|
31
|
+
if (mode === 'start') {
|
|
32
|
+
el.classList.add(SmartTruncate.START_CLASS);
|
|
33
|
+
if (!wrapper) {
|
|
34
|
+
const inner = el.ownerDocument.createElement('span');
|
|
35
|
+
inner.className = SmartTruncate.TEXT_CLASS;
|
|
36
|
+
inner.append(...el.childNodes);
|
|
37
|
+
el.appendChild(inner);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
el.classList.remove(SmartTruncate.START_CLASS);
|
|
41
|
+
wrapper?.replaceWith(...wrapper.childNodes);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (typeof fullText === 'string') {
|
|
45
|
+
el.dataset.fullText = fullText;
|
|
46
|
+
} else {
|
|
47
|
+
delete el.dataset.fullText;
|
|
48
|
+
}
|
|
49
|
+
return el;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static isTruncated(el) {
|
|
53
|
+
return !!el?.isConnected && el.scrollWidth > el.clientWidth;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static getFullText(el) {
|
|
57
|
+
if (!el) return '';
|
|
58
|
+
if (typeof el.dataset?.fullText === 'string') return el.dataset.fullText;
|
|
59
|
+
return (el.textContent || '').trim();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Runs on every hover, before the browser reads `title` for its tooltip,
|
|
63
|
+
// so it stays correct after resizes. With no `title`, an ancestor's title
|
|
64
|
+
// (e.g. a collapsed card's "Dismissed") shows as before.
|
|
65
|
+
static onMouseOver(event) {
|
|
66
|
+
const el = event.target.closest?.(`.${SmartTruncate.ROOT_CLASS}`);
|
|
67
|
+
if (!el) return;
|
|
68
|
+
const text = SmartTruncate.isTruncated(el) ? SmartTruncate.getFullText(el) : '';
|
|
69
|
+
// An empty `title` would also hide an ancestor's tooltip, so remove it
|
|
70
|
+
if (text) {
|
|
71
|
+
el.title = text;
|
|
72
|
+
} else {
|
|
73
|
+
el.removeAttribute('title');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (typeof document !== 'undefined') {
|
|
79
|
+
document.addEventListener('mouseover', SmartTruncate.onMouseOver);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (typeof window !== 'undefined') {
|
|
83
|
+
window.SmartTruncate = SmartTruncate;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (typeof module !== 'undefined' && module.exports) {
|
|
87
|
+
module.exports = { SmartTruncate };
|
|
88
|
+
}
|
package/public/local.html
CHANGED
|
@@ -569,6 +569,9 @@
|
|
|
569
569
|
<!-- DOMPurify sanitizes rendered markdown HTML (must load before markdown.js) -->
|
|
570
570
|
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.6/dist/purify.min.js"></script>
|
|
571
571
|
|
|
572
|
+
<!-- Git path decoding (diff --git header parsing; must load before pr.js) -->
|
|
573
|
+
<script src="/js/utils/git-paths.js"></script>
|
|
574
|
+
|
|
572
575
|
<!-- Markdown renderer utility -->
|
|
573
576
|
<script src="/js/utils/markdown.js"></script>
|
|
574
577
|
|
|
@@ -583,6 +586,9 @@
|
|
|
583
586
|
<!-- Category emoji mapping -->
|
|
584
587
|
<script src="/js/utils/category-emoji.js"></script>
|
|
585
588
|
|
|
589
|
+
<!-- Truncation with full-text title -->
|
|
590
|
+
<script src="/js/utils/smart-truncate.js"></script>
|
|
591
|
+
|
|
586
592
|
<!-- Suggestion UI utility -->
|
|
587
593
|
<script src="/js/utils/suggestion-ui.js"></script>
|
|
588
594
|
|
package/public/pr.html
CHANGED
|
@@ -374,6 +374,9 @@
|
|
|
374
374
|
<!-- DOMPurify sanitizes rendered markdown HTML (must load before markdown.js) -->
|
|
375
375
|
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.6/dist/purify.min.js"></script>
|
|
376
376
|
|
|
377
|
+
<!-- Git path decoding (diff --git header parsing; must load before pr.js) -->
|
|
378
|
+
<script src="/js/utils/git-paths.js"></script>
|
|
379
|
+
|
|
377
380
|
<!-- Markdown renderer utility -->
|
|
378
381
|
<script src="/js/utils/markdown.js"></script>
|
|
379
382
|
|
|
@@ -388,6 +391,9 @@
|
|
|
388
391
|
<!-- Category emoji mapping -->
|
|
389
392
|
<script src="/js/utils/category-emoji.js"></script>
|
|
390
393
|
|
|
394
|
+
<!-- Truncation with full-text title -->
|
|
395
|
+
<script src="/js/utils/smart-truncate.js"></script>
|
|
396
|
+
|
|
391
397
|
<!-- Suggestion UI utility -->
|
|
392
398
|
<script src="/js/utils/suggestion-ui.js"></script>
|
|
393
399
|
|
package/src/ai/analyzer.js
CHANGED
|
@@ -15,7 +15,8 @@ const { buildFileLineCountMap, validateSuggestionLineNumbers } = require('../uti
|
|
|
15
15
|
const { getPromptBuilder } = require('./prompts');
|
|
16
16
|
const { formatValidFiles } = require('./prompts/shared/valid-files');
|
|
17
17
|
const { ADVERSARIAL_VERIFICATION_SECTION } = require('./prompts/shared/adversarial-verification');
|
|
18
|
-
const { GIT_DIFF_FLAGS } = require('../git/diff-flags');
|
|
18
|
+
const { GIT_DIFF_FLAGS, GIT_PATH_CONFIG } = require('../git/diff-flags');
|
|
19
|
+
const { splitNulPaths } = require('../utils/git-paths');
|
|
19
20
|
const {
|
|
20
21
|
buildAnalysisLineNumberGuidance,
|
|
21
22
|
buildOrchestrationLineNumberGuidance: buildOrchestrationGuidance,
|
|
@@ -1003,10 +1004,10 @@ Do NOT create suggestions for any files not in this list. If you cannot find iss
|
|
|
1003
1004
|
async getChangedFilesList(worktreePath, prMetadata) {
|
|
1004
1005
|
try {
|
|
1005
1006
|
const { stdout } = await execPromise(
|
|
1006
|
-
`git diff ${GIT_DIFF_FLAGS} ${prMetadata.base_sha}...${prMetadata.head_sha} --name-only`,
|
|
1007
|
+
`git ${GIT_PATH_CONFIG} diff ${GIT_DIFF_FLAGS} ${prMetadata.base_sha}...${prMetadata.head_sha} --name-only -z`,
|
|
1007
1008
|
{ cwd: worktreePath }
|
|
1008
1009
|
);
|
|
1009
|
-
return stdout
|
|
1010
|
+
return splitNulPaths(stdout);
|
|
1010
1011
|
} catch (error) {
|
|
1011
1012
|
logger.warn(`Could not get changed files list: ${error.message}`);
|
|
1012
1013
|
return [];
|
|
@@ -1027,27 +1028,27 @@ Do NOT create suggestions for any files not in this list. If you cannot find iss
|
|
|
1027
1028
|
try {
|
|
1028
1029
|
// Get modified tracked files (unstaged)
|
|
1029
1030
|
const { stdout: unstaged } = await execPromise(
|
|
1030
|
-
`git diff ${GIT_DIFF_FLAGS} --name-only`,
|
|
1031
|
+
`git ${GIT_PATH_CONFIG} diff ${GIT_DIFF_FLAGS} --name-only -z`,
|
|
1031
1032
|
{ cwd: localPath }
|
|
1032
1033
|
);
|
|
1033
1034
|
|
|
1034
1035
|
// Get untracked files
|
|
1035
1036
|
const { stdout: untracked } = await execPromise(
|
|
1036
|
-
|
|
1037
|
+
`git ${GIT_PATH_CONFIG} ls-files -z --others --exclude-standard`,
|
|
1037
1038
|
{ cwd: localPath }
|
|
1038
1039
|
);
|
|
1039
1040
|
|
|
1040
|
-
const unstagedFiles = unstaged
|
|
1041
|
-
const untrackedFiles = untracked
|
|
1041
|
+
const unstagedFiles = splitNulPaths(unstaged);
|
|
1042
|
+
const untrackedFiles = splitNulPaths(untracked);
|
|
1042
1043
|
const allFiles = [...unstagedFiles, ...untrackedFiles];
|
|
1043
1044
|
|
|
1044
1045
|
// Include staged files when scope includes staged
|
|
1045
1046
|
if (options.includeStaged) {
|
|
1046
1047
|
const { stdout: staged } = await execPromise(
|
|
1047
|
-
`git diff ${GIT_DIFF_FLAGS} --cached --name-only`,
|
|
1048
|
+
`git ${GIT_PATH_CONFIG} diff ${GIT_DIFF_FLAGS} --cached --name-only -z`,
|
|
1048
1049
|
{ cwd: localPath }
|
|
1049
1050
|
);
|
|
1050
|
-
const stagedFiles = staged
|
|
1051
|
+
const stagedFiles = splitNulPaths(staged);
|
|
1051
1052
|
allFiles.push(...stagedFiles);
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
@@ -1341,10 +1342,11 @@ ${description || '(No description provided)'}
|
|
|
1341
1342
|
const isLocal = prMetadata.reviewType === 'local';
|
|
1342
1343
|
if (isLocal) {
|
|
1343
1344
|
// For local mode, diff against HEAD to see working directory changes
|
|
1344
|
-
|
|
1345
|
+
const localCmd = `git ${GIT_PATH_CONFIG} diff ${GIT_DIFF_FLAGS} HEAD`;
|
|
1346
|
+
return suffix ? `${localCmd} ${suffix}` : localCmd;
|
|
1345
1347
|
}
|
|
1346
1348
|
// For PR mode, diff between base and head commits
|
|
1347
|
-
const baseCmd = `git diff ${GIT_DIFF_FLAGS} ${prMetadata.base_sha}...${prMetadata.head_sha}`;
|
|
1349
|
+
const baseCmd = `git ${GIT_PATH_CONFIG} diff ${GIT_DIFF_FLAGS} ${prMetadata.base_sha}...${prMetadata.head_sha}`;
|
|
1348
1350
|
return suffix ? `${baseCmd} ${suffix}` : baseCmd;
|
|
1349
1351
|
}
|
|
1350
1352
|
|
|
@@ -2408,9 +2410,9 @@ If you are unsure, use "NEW" - it is correct for the vast majority of suggestion
|
|
|
2408
2410
|
try {
|
|
2409
2411
|
// Step 1: Detect primary language(s) from changed files
|
|
2410
2412
|
// For local mode, use git diff HEAD; for PR mode, use base...head
|
|
2411
|
-
const diffCmd = this.buildGitDiffCommand(prMetadata, '--name-only');
|
|
2413
|
+
const diffCmd = this.buildGitDiffCommand(prMetadata, '--name-only -z');
|
|
2412
2414
|
const { stdout: changedFiles } = await execPromise(diffCmd, { cwd: worktreePath });
|
|
2413
|
-
const files = changedFiles
|
|
2415
|
+
const files = splitNulPaths(changedFiles);
|
|
2414
2416
|
|
|
2415
2417
|
const languages = this.detectLanguages(files);
|
|
2416
2418
|
logger.info(`Detected languages: ${languages.join(', ')}`);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the official successor to the Gemini CLI.
|
|
7
7
|
*
|
|
8
8
|
* ============================================================================
|
|
9
|
-
* HOW THIS ADAPTER DRIVES `agy` (verified against agy 1.0.16)
|
|
9
|
+
* HOW THIS ADAPTER DRIVES `agy` (verified against agy 1.0.16; models re-verified against 1.3.5)
|
|
10
10
|
* ============================================================================
|
|
11
11
|
* The Antigravity CLI's non-interactive "print" mode (`agy -p`) IS a real
|
|
12
12
|
* agentic loop — it reads files, searches the tree, and runs shell commands to
|
|
@@ -94,16 +94,35 @@ const TIMEOUT_BACKSTOP_GRACE_MS = 15000;
|
|
|
94
94
|
* We curate the Gemini-family models here — Antigravity is the Gemini CLI's
|
|
95
95
|
* successor and its native models are Gemini. Ordered thorough -> balanced ->
|
|
96
96
|
* fast, matching the other providers' pickers. Gemini 3.8 Flash at high effort
|
|
97
|
-
* is the
|
|
97
|
+
* is the default: it is the strongest Gemini every agy plan can run
|
|
98
98
|
* (DeepSWE v1.1 73.7, Terminal-Bench 2.1 89.4 — on par with GPT-6 Astra and
|
|
99
|
-
* Muse 1.3), so "Flash" now describes latency, not capability. Gemini
|
|
100
|
-
* (
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
99
|
+
* Muse 1.3), so "Flash" now describes latency, not capability. Gemini 4 Argon
|
|
100
|
+
* (Oct 2026) is Google's new frontier model, but agy gates it to Google AI
|
|
101
|
+
* Ultra and eligible Enterprise subscriptions; on any other plan agy exits 1
|
|
102
|
+
* with `"Gemini 4 Argon" is unavailable: ... available to Ultra plan
|
|
103
|
+
* subscribers`, so it is an explicit thorough-tier choice and never the
|
|
104
|
+
* default. It also never LEADS the thorough tier: provider-switch paths
|
|
105
|
+
* (AnalysisConfigModal.selectProvider, RepoSettingsPage) map the previous
|
|
106
|
+
* model's tier onto the first model of that tier here, so a thorough Claude
|
|
107
|
+
* selection switched to Antigravity must land on a model every plan can run.
|
|
108
|
+
* agy (1.3.5) recognizes Argon only by its bare display name —
|
|
109
|
+
* `Gemini 4 Argon (High)`, `gemini-4-argon`, and `gemini-4-argon-high` are all
|
|
110
|
+
* "not recognized" — and runs it at the server-default effort, which is High.
|
|
111
|
+
* Gemini 3.8 Flash at medium effort is the balanced entry and at low effort
|
|
112
|
+
* the sole fast-tier entry, which also makes it the JSON-extraction model
|
|
113
|
+
* (getFastTierModel() picks the first `tier: 'fast'` model — position in this
|
|
114
|
+
* array does not matter). Retired ids (3.5 Flash) are kept as aliases of their
|
|
115
|
+
* 3.8 Flash counterparts so saved selections keep working.
|
|
116
|
+
*
|
|
117
|
+
* Deprecated: gemini-3.1-pro-high, gemini-3.1-pro-low (alias gemini-3.1-pro) —
|
|
118
|
+
* agy 1.3.5 no longer offers 3.1 Pro ("not recognized as a known model").
|
|
119
|
+
* They are deliberately NOT aliased onto another model (3.8 Flash is a
|
|
120
|
+
* different line; Argon is plan-gated). The browser resolvers fall back to the
|
|
121
|
+
* provider default for a saved selection that is no longer in the catalog;
|
|
122
|
+
* headless, MCP, and saved-council runs pass the id through and agy fails with
|
|
123
|
+
* an unknown-model error.
|
|
124
|
+
*
|
|
125
|
+
* `agy` also exposes Claude and GPT-OSS models; those remain reachable via a
|
|
107
126
|
* `providers.antigravity.models` config override but are intentionally left
|
|
108
127
|
* out of the default picker to keep the cross-provider model-mismatch guard
|
|
109
128
|
* and the UX unambiguous.
|
|
@@ -117,30 +136,31 @@ const ANTIGRAVITY_MODELS = [
|
|
|
117
136
|
name: '3.8 Flash (High)',
|
|
118
137
|
tier: 'thorough',
|
|
119
138
|
tagline: 'Frontier Review',
|
|
120
|
-
description: 'Gemini 3.8 Flash at high effort is the strongest Gemini on agy — DeepSWE v1.1 73.7, Terminal-Bench 2.1 89.4, on par with GPT-6 Astra and Muse 1.3. "Flash" now means latency, not capability. Uses the thorough prompt set.',
|
|
139
|
+
description: 'Gemini 3.8 Flash at high effort is the strongest Gemini available on every agy plan — DeepSWE v1.1 73.7, Terminal-Bench 2.1 89.4, on par with GPT-6 Astra and Muse 1.3. "Flash" now means latency, not capability. Uses the thorough prompt set.',
|
|
121
140
|
badge: 'Recommended',
|
|
122
141
|
badgeClass: 'badge-recommended',
|
|
123
142
|
default: true
|
|
124
143
|
},
|
|
125
144
|
{
|
|
126
|
-
id: 'gemini-
|
|
127
|
-
|
|
128
|
-
|
|
145
|
+
id: 'gemini-4-argon',
|
|
146
|
+
// agy rejects every effort-suffixed form for Argon; the bare display name
|
|
147
|
+
// is the only accepted --model value, and it runs at High (Argon's default).
|
|
148
|
+
cliName: 'Gemini 4 Argon',
|
|
149
|
+
name: '4 Argon',
|
|
129
150
|
tier: 'thorough',
|
|
130
|
-
tagline: '
|
|
131
|
-
description: '
|
|
132
|
-
badge: '
|
|
151
|
+
tagline: 'Frontier — Ultra Plan',
|
|
152
|
+
description: 'Gemini 4 Argon (Oct 2026), Google\'s frontier model, at its default High effort. Requires a Google AI Ultra or eligible Gemini Enterprise subscription — on other plans agy refuses it as unavailable. Uses the thorough prompt set.',
|
|
153
|
+
badge: 'Ultra Plan',
|
|
133
154
|
badgeClass: 'badge-power'
|
|
134
155
|
},
|
|
135
156
|
{
|
|
136
|
-
id: 'gemini-3.
|
|
137
|
-
cliName: 'Gemini 3.
|
|
138
|
-
|
|
139
|
-
name: '3.1 Pro (Low)',
|
|
157
|
+
id: 'gemini-3.8-flash-medium',
|
|
158
|
+
cliName: 'Gemini 3.8 Flash (Medium)',
|
|
159
|
+
name: '3.8 Flash (Medium)',
|
|
140
160
|
tier: 'balanced',
|
|
141
|
-
tagline: '
|
|
142
|
-
description: '
|
|
143
|
-
badge: '
|
|
161
|
+
tagline: 'Standard Review',
|
|
162
|
+
description: 'Gemini 3.8 Flash at medium effort — a faster, cheaper middle ground for routine PRs',
|
|
163
|
+
badge: 'Balanced',
|
|
144
164
|
badgeClass: 'badge-balanced'
|
|
145
165
|
},
|
|
146
166
|
{
|