Skip to content

Commit 425e2ae

Browse files
authored
Merge branch 'main' into split/vscode-lm-streaming-b
2 parents a6ea398 + 754a916 commit 425e2ae

184 files changed

Lines changed: 12183 additions & 764 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/label-pr-review-state.yml‎

Lines changed: 127 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
# This workflow only reads PR metadata and never checks out or executes PR code.
1515
# pull_request_target gives fork PRs a token that can update labels and comments.
1616
pull_request_target:
17-
types: [opened, reopened, ready_for_review, synchronize, review_requested, review_request_removed, labeled, unlabeled]
17+
types: [opened, reopened, ready_for_review, converted_to_draft, synchronize, review_requested, review_request_removed, labeled, unlabeled]
1818
pull_request_review:
1919
types: [submitted, dismissed]
2020
# Fork review events have a read-only token. CodeRabbit's status-comment update
@@ -81,13 +81,21 @@ jobs:
8181
color: '5319e7',
8282
description: 'Required CI passed; CodeRabbit review is active',
8383
},
84+
{
85+
name: 'community-approved',
86+
color: 'c2e0c6',
87+
description: 'Fresh community approval on the current head; maintainer review still required',
88+
},
8489
];
8590
const guideMarker = '<!-- zoo-code-pr-review-process -->';
8691
const codeRabbitLabelMarkerPrefix = '<!-- coderabbit-review-label:';
8792
const codeRabbitLogin = 'coderabbitai[bot]';
8893
const codeRabbitLogins = new Set([codeRabbitLogin, 'coderabbitai']);
8994
const codeRabbitActiveLabel = 'coderabbit-review-active';
9095
const codeRabbitEligibleBotLogins = new Set(['zoomote[bot]']);
96+
// Advisory priority signal only — kept outside stateLabels so it never
97+
// replaces or blocks the review-state queue labels.
98+
const communityApprovedLabel = 'community-approved';
9199
const reviewGateName = 'Zoo Code / PR review gate';
92100
const reconciliationCheckName = 'Zoo Code / reconcile PR review state';
93101
@@ -310,6 +318,48 @@ jobs:
310318
}
311319
}
312320
321+
// Reconciles the advisory community-approved label. The label means
322+
// "fresh community code approval for the current head; maintainer
323+
// review still required" — it is a priority signal only and never
324+
// grants merge authority. Every reconciliation branch routes through
325+
// this one helper with a single decision:
326+
// 'add' — stable head, maintainer queue, qualifying fresh approval
327+
// 'remove' — known non-maintainer phase, known head change, or
328+
// invalidated approval (known invalidation beats uncertainty)
329+
// 'preserve' — unknown mergeability, or a permission lookup that
330+
// fails only in the community check, with no known
331+
// invalidation. A lookup failure that also blocks
332+
// maintainer classification fails the PR and removes
333+
// the label through the outer catch instead.
334+
// A failed community label update is advisory: it must not clear the
335+
// queue label or fail the review gate, so errors are logged, not thrown.
336+
async function reconcileCommunityApproval(pr, decision) {
337+
if (isReadOnlyRun && isForkPR(pr)) return;
338+
if (decision === 'preserve') return;
339+
const hasLabel = pr.labels.some(label => label.name === communityApprovedLabel);
340+
try {
341+
if (decision === 'add' && !hasLabel) {
342+
await github.rest.issues.addLabels({
343+
owner, repo, issue_number: pr.number, labels: [communityApprovedLabel],
344+
});
345+
pr.labels.push({ name: communityApprovedLabel });
346+
} else if (decision === 'remove' && hasLabel) {
347+
await github.rest.issues.removeLabel({
348+
owner, repo, issue_number: pr.number, name: communityApprovedLabel,
349+
});
350+
pr.labels = pr.labels.filter(label => label.name !== communityApprovedLabel);
351+
}
352+
} catch (error) {
353+
if (decision === 'remove' && error.status === 404) {
354+
pr.labels = pr.labels.filter(label => label.name !== communityApprovedLabel);
355+
return;
356+
}
357+
core.warning(
358+
`PR #${pr.number}: could not ${decision} ${communityApprovedLabel}: ${error.message}`
359+
);
360+
}
361+
}
362+
313363
function codeRabbitLabelHead(comment) {
314364
const markerPattern = new RegExp(`${codeRabbitLabelMarkerPrefix}([a-f0-9]{40}) -->`);
315365
const match = comment?.body?.match(markerPattern);
@@ -419,7 +469,10 @@ jobs:
419469
420470
return `${guideMarker}\n### Review status\n\n${authorNote}\n\n` +
421471
`**Current step:** ${phaseMessage(phase)}${phaseHelp}\n\n` +
422-
'Review-state labels are managed by this workflow; do not edit them manually.' +
472+
'Review-state labels are managed by this workflow; do not edit them manually. ' +
473+
'`community-approved` is managed the same way — do not add or remove it manually. ' +
474+
'It signals a fresh community code approval for the current head as an advisory ' +
475+
'priority only; maintainer review is still required.' +
423476
labelMarker;
424477
}
425478
@@ -497,6 +550,7 @@ jobs:
497550
const existingGuide = await findReviewGuide(pr);
498551
await setCodeRabbitReviewActive(pr, false);
499552
await reconcileLabels(pr, null);
553+
await reconcileCommunityApproval(pr, 'remove');
500554
await updateReviewGuide(pr, 'configuration-error', existingGuide);
501555
continue;
502556
}
@@ -518,6 +572,7 @@ jobs:
518572
await updateReviewGate(pr, 'conflict', false);
519573
await setCodeRabbitReviewActive(pr, false);
520574
await reconcileLabels(pr, 'has-conflicts');
575+
await reconcileCommunityApproval(pr, 'remove');
521576
await updateReviewGuide(pr, 'conflict', existingGuide);
522577
continue;
523578
}
@@ -623,6 +678,7 @@ jobs:
623678
await updateReviewGate(pr, ciPending ? 'ci-pending' : 'ci-failed', false);
624679
await setCodeRabbitReviewActive(pr, false);
625680
await reconcileLabels(pr, null);
681+
await reconcileCommunityApproval(pr, 'remove');
626682
await updateReviewGuide(
627683
pr,
628684
ciPending ? 'ci-pending' : 'ci-failed',
@@ -642,7 +698,10 @@ jobs:
642698
// block the PR or indicate the author needs to act.
643699
const latest = new Map();
644700
for (const r of reviews) {
645-
const reviewer = r.user.login.toLowerCase();
701+
// Ghost accounts have no usable identity; their reviews carry
702+
// no actionable state for either review loop.
703+
const reviewer = r.user?.login?.toLowerCase();
704+
if (!reviewer) continue;
646705
const reviewerKey = codeRabbitLogins.has(reviewer) ? codeRabbitLogin : reviewer;
647706
if (r.state === 'DISMISSED') {
648707
latest.delete(reviewerKey);
@@ -742,6 +801,43 @@ jobs:
742801
freshMaintainerReviews.push(review);
743802
}
744803
}
804+
// Community approval eligibility reuses the decisive per-reviewer
805+
// reduction above: the reviewer's latest decisive review (selected
806+
// by review id, not array order) must be an approval on the current
807+
// head. Ghost accounts, bots, CodeRabbit, and the PR author are
808+
// already excluded there; comments are neutral. Permission results
809+
// are shared with maintainer classification through permissionFor:
810+
// a 404 qualifies an otherwise valid reviewer, while a lookup
811+
// failure is unknown permission and never counts as community
812+
// eligibility. One eligible approval is enough; bot-authored PRs
813+
// follow the same rule. A known invalidation — an approval that
814+
// was dismissed, replaced, or left behind by a head change —
815+
// takes priority over any lookup uncertainty.
816+
const approvedByReviewer = new Set();
817+
for (const r of reviews) {
818+
const reviewer = r.user?.login?.toLowerCase();
819+
if (reviewer && r.state === 'APPROVED') approvedByReviewer.add(reviewer);
820+
}
821+
let communityApprovalFresh = false;
822+
let communityPermissionUncertain = false;
823+
let communityApprovalInvalidated = false;
824+
for (const [reviewer, review] of latestHumanReview) {
825+
if (review.state === 'APPROVED' && review.commit_id === pr.head.sha) {
826+
let permission;
827+
try {
828+
permission = await permissionFor(review.user.login);
829+
} catch (error) {
830+
communityPermissionUncertain = true;
831+
continue;
832+
}
833+
if (!['admin', 'maintain', 'write'].includes(permission)) {
834+
communityApprovalFresh = true;
835+
break;
836+
}
837+
} else if (approvedByReviewer.has(reviewer)) {
838+
communityApprovalInvalidated = true;
839+
}
840+
}
745841
const automatedAuthor = pr.user?.type === 'Bot';
746842
const codeRabbitEligibleAuthor = !automatedAuthor ||
747843
codeRabbitEligibleBotLogins.has(pr.user?.login.toLowerCase());
@@ -793,15 +889,24 @@ jobs:
793889
phase = 'approved';
794890
}
795891
892+
// Advisory community label decision for the branches below.
893+
// Non-maintainer phases always remove it; the maintainer queue
894+
// refines the decision after the head/mergeability refetch.
895+
let communityDecision = 'remove';
796896
if (desiredLabel === 'awaiting-maintainer') {
797897
const { data: latestPrDetail } = await github.rest.pulls.get({
798898
owner, repo, pull_number: pr.number,
799899
});
900+
// A head change since the event fetch invalidates every
901+
// approval, even if another check is uncertain.
902+
const headChanged = Boolean(latestPrDetail.head?.sha) &&
903+
latestPrDetail.head.sha !== pr.head.sha;
800904
if (latestPrDetail.mergeable === false && latestPrDetail.mergeable_state === 'dirty') {
801905
core.info(`PR #${pr.number}: has merge conflicts — labeling has-conflicts`);
802906
await updateReviewGate(pr, 'conflict', false);
803907
await setCodeRabbitReviewActive(pr, false);
804908
await reconcileLabels(pr, 'has-conflicts');
909+
await reconcileCommunityApproval(pr, 'remove');
805910
await updateReviewGuide(pr, 'conflict', existingGuide);
806911
continue;
807912
}
@@ -815,8 +920,23 @@ jobs:
815920
error.preserveStateLabels = true;
816921
throw error;
817922
}
923+
// Unknown mergeability alone, with an unchanged head and no
924+
// known invalidation, preserves an existing label and never adds it.
925+
await reconcileCommunityApproval(
926+
pr,
927+
headChanged || communityApprovalInvalidated ? 'remove' : 'preserve'
928+
);
818929
continue;
819930
}
931+
communityDecision = headChanged
932+
? 'remove'
933+
: communityApprovalFresh
934+
? 'add'
935+
: communityApprovalInvalidated
936+
? 'remove'
937+
: communityPermissionUncertain
938+
? 'preserve'
939+
: 'remove';
820940
}
821941
822942
core.info(
@@ -842,6 +962,7 @@ jobs:
842962
await updateReviewGuide(pr, phase, existingGuide);
843963
}
844964
await reconcileLabels(pr, desiredLabel);
965+
await reconcileCommunityApproval(pr, communityDecision);
845966
if (readyForMaintainer) {
846967
await updateReviewGate(pr, phase, true);
847968
}
@@ -864,6 +985,9 @@ jobs:
864985
} catch (cleanupError) {
865986
metadataErrors.push(cleanupError);
866987
}
988+
// A global failure that clears the maintainer queue clears the
989+
// advisory community signal too.
990+
await reconcileCommunityApproval(pr, 'remove');
867991
}
868992
const detail = error.status
869993
? `${error.message} (HTTP ${error.status}${error.response?.data?.message ? `: ${error.response.data.message}` : ''})`

‎.vscode/launch.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": ["--extensionDevelopmentPath=${workspaceFolder}/src"],
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}/src", "--disable-extensions"],
1414
"sourceMaps": true,
1515
"outFiles": ["${workspaceFolder}/src/dist/**/*.js"],
1616
"preLaunchTask": "${defaultBuildTask}",

‎CHANGELOG.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Zoo Code Changelog
22

3+
## [3.86.0]
4+
5+
- ✨ **New model support:** Use GPT-6.1 Sol, get the corrected Claude Opus 5.5 output budget, and select DeepSeek V4.1 Flash on OpenCode Go.
6+
- 🧭 **Reliable task aborts and interruptions:** Preserve the first abort reason, reset stream-abort state for each request, and stop interrupted tasks from replaying rejected subtasks.
7+
- 🛠️ **Dependable tools, prompts, and UI streaming:** Keep streamed tool arguments intact, enforce MCP tool policy, prevent invented line numbers, and smooth chat updates.
8+
9+
### Model Support
10+
11+
- Add GPT-6.1 Sol support for OpenAI (#1863 by @WebMad, PR #1864 by @WebMad)
12+
- Correct the Claude Opus 5.5 output budget (#1853 by @jaszhix, PR #1854 by @jaszhix)
13+
- Add DeepSeek V4.1 Flash metadata for OpenCode Go (#1648 by @carloslato, PR #1659 by @PierrunoYT)
14+
15+
### Task Reliability
16+
17+
- Preserve the first abort reason when a task stops (#1802 by @edelauna, PR #1811 by @edelauna)
18+
- Reset stream-abort state for each API request (#1801 by @edelauna, PR #1812 by @edelauna)
19+
- Prevent interrupted tasks from replaying rejected subtasks (#1714 by @huankimtran, PR #1726 by @edelauna)
20+
21+
### Tools, Prompts, and Streaming
22+
23+
- Preserve streamed native tool-call arguments across partial chunks (#695 by @awschmeder, PR #700 by @awschmeder)
24+
- Truncate VS Code LM tool results safely within the context window (PR #1606 by @simurg79)
25+
- Validate native MCP tool calls through the shared tool-policy layer (#1646 by @DaubnerF, PR #1724 by @DaubnerF)
26+
- Prevent invented line numbers in `apply_diff` prompts (PR #641 by @faitno)
27+
- Warn against including line numbers in `search_replace`, `edit_file`, and `read_file` inputs (#716 by @edelauna, PR #1685 by @myk1yt)
28+
- Batch repeated tool preambles in the chat UI (#1656 by @petersjostrom, PR #1658 by @PierrunoYT)
29+
- Avoid flushing throttled UI state for partial say messages (#1851 by @daewoongoh, PR #1852 by @daewoongoh)
30+
- Keep markdown-sourced open-file requests inside the workspace (PR #1762 by @easonLiangWorldedtech)
31+
- Use `127.0.0.1` for the development server to avoid IPv6 localhost resolution issues (#1588 by @hnbdr, PR #1589 by @hnbdr)
32+
33+
### Code Index and Maintenance
34+
35+
- Introduce workspace scopes behind the code-index registry (PR #1766 by @WebMad)
36+
- Add code-index feature scopes and centralize status subscriptions (PR #1768 by @WebMad)
37+
- Centralize code-index workspace scopes and enablement (PR #1778 by @WebMad)
38+
- Use immutable code-index configuration snapshots (#1788 by @WebMad, PR #1815 by @WebMad)
39+
- Separate code-index service factories and embedder validation (#1816 by @WebMad, PR #1818 by @WebMad)
40+
- Extract code-index scan execution without changing behavior (#1819 by @WebMad, PR #1834 by @WebMad)
41+
- Extract code-index single-file preparation (PR #1836 by @WebMad)
42+
- Update `lru-cache` to 11.5.3 (PR #1583 by @app/renovate)
43+
- Update Mocha to 11.8.0 (PR #1585 by @app/renovate)
44+
- Document P1 persisted ownership and the run-state kernel target architecture (PR #1706 by @app/zoomote)
45+
- Add a community-approved label for community code approvals (#1872 by @edelauna, PR #1873 by @app/zoomote)
46+
- Merge the **previous v3.84.0 release preparation** after its publication; this is prior-release housekeeping, not a v3.86.0 feature (PR #1810 by @taltas)
47+
348
## [3.84.0]
449

550
- ✨ **New SOTA models added:** Use GPT-6 Sol, GPT-6 Luna, and Claude Opus 5.5 across supported providers.

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pnpm install
134134

135135
### Review Process
136136

137-
Ready-for-review PRs must pass required CI checks, address actionable review feedback, and receive fresh maintainer or CODEOWNER approval after automated review completes for the latest commit. Automated review may add a guidance comment and managed state labels; contributors should follow the indicated next step rather than editing those labels directly. New commits reset review state for the updated code.
137+
Ready-for-review PRs must pass required CI checks, address actionable review feedback, and receive fresh maintainer or CODEOWNER approval after automated review completes for the latest commit. Automated review may add a guidance comment and managed state labels; contributors should follow the indicated next step rather than editing those labels directly. New commits reset review state for the updated code. A `community-approved` label marks a fresh community approval on the latest commit while the PR waits for maintainer review. It is an advisory priority signal for maintainers; it does not replace maintainer review or any required check, and it is managed by the review workflow.
138138

139139
Automated review supports maintainers but does not replace human approval. Outside contributors cannot direct CodeRabbit through comments; eligible reviews restart automatically after required CI passes, and maintainers handle any exceptional restart. Warnings are advisory unless repository policy says otherwise, and native GitHub required-check, CODEOWNER, and review protections remain authoritative for merging.
140140

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Zoo Code builds on the foundation created by Roo Code and continues to expand it
4646
- **More dependable terminal and editing workflows** — fixes for premature terminal completion, task-state races, context management, diff editing, and provider-specific tool use.
4747
- **More control over your workspace** — rules management, per-mode MCP restrictions, multi-root path controls, model reasoning options, and completion change review actions.
4848

49-
## What's New in v3.84.0
49+
## What's New in v3.86.0
5050

51-
- ✨ **New SOTA models added:** Use GPT-6 Sol, GPT-6 Luna, and Claude Opus 5.5 across supported providers.
52-
- 🧭 **More reliable tasks and subtasks:** Keep delegated modes isolated, preserve subtask links after repeated stops, and protect orchestrator settings when slash commands switch modes.
53-
- 🛠️ **More dependable terminal, provider, and code-search behavior:** Improve terminal behavior across Windows and non-English environments, strengthen provider responses and cancellation, and make code search use the correct workspace more consistently.
51+
- ✨ **New model support:** Use GPT-6.1 Sol, get the corrected Claude Opus 5.5 output budget, and select DeepSeek V4.1 Flash on OpenCode Go.
52+
- 🧭 **Reliable task aborts and interruptions:** Preserve the first abort reason, reset stream-abort state for each request, and stop interrupted tasks from replaying rejected subtasks.
53+
- 🛠️ **Dependable tools, prompts, and UI streaming:** Keep streamed tool arguments intact, enforce MCP tool policy, prevent invented line numbers, and smooth chat updates.
5454

5555
<details>
5656
<summary>🌐 Available languages</summary>

0 commit comments

Comments
 (0)