Skip to content

Commit c1378c6

Browse files
committed
Merge upstream/main (08d05eb) into blanket-auto-deny-commands
Resolve the 22-file / 92-hunk conflict surface: - adopt-main (17 files): the four add/add Zoo-Code-Org#1505 duplicates (effective-tool-policy.ts, effective-tool-policy.spec.ts, build-tools.spec.ts, generateSystemPrompt.spec.ts), the P-theme sections/{capabilities,objective,rules,skills}.ts + system.ts + their specs + ask-mode-prompt.snap, filter-tools-for-mode.ts + its spec, zoo-gateway.spec.ts, restart-persistence.test.ts (main's Zoo-Code-Org#1663 polling supersedes the branch poll rewrite). - generateSystemPrompt.ts: adopt-main; the branch D-adjacent provider-state snapshot call-site (disabledTools + modelInfo args to SYSTEM_PROMPT) is identical to main's — no re-apply needed. - presentAssistantMessage.ts: keep main's buildToolRequirements(disabledTools, modelInfo?.info) call (matches the adopted two-arg policy API); the branch AutoApprovalContext threading survived the auto-merge. - presentAssistantMessage-custom-tool.spec.ts, Task.ts, Task.spec.ts: take main's side of every conflicted hunk (branch hunks were P/L-theme duplicates of main's Zoo-Code-Org#1505/Zoo-Code-Org#1625 rework); branch D-theme glue outside the conflict regions is preserved by the auto-merge. - Delete src/core/prompts/tools/__tests__/effective-tool-policy-warn.spec.ts: mechanical orphan of the adopt-main resolution — main's effective-tool-policy.ts never exported warnProtocolToolOverrides, so the branch-only spec cannot compile at the merged head. - presentAssistantMessage-auto-deny.spec.ts (branch-only, non-conflicting): add the getTaskMode mock the merged impl now requires (main Zoo-Code-Org#1625 reads the task-local mode); test-double drift invisible to the textual merge.
2 parents a5be701 + 08d05eb commit c1378c6

86 files changed

Lines changed: 6255 additions & 739 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.

‎.coderabbit.yaml‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,19 @@ reviews:
4848
instructions: >-
4949
Act as an adversarial second-opinion reviewer. Verify PR claims against implementation and
5050
contracts. Trace changed inputs through normal, boundary, error, cancellation, retry, and
51-
default paths and their consumers. Seek plausible counterexamples and regressions from removed
52-
safeguards. Identify assumptions in changed code that depend on facts outside the diff. First
53-
verify repository conventions, tests, and related implementations. When a potential finding
54-
depends on external behavior, use web search and prefer official documentation, specifications,
55-
or upstream repositories. Report only concrete, actionable conflicts or failure modes, citing
56-
the relevant repository location or external source. Prioritize correctness, security, data loss,
57-
lifecycle, and test gaps. Do not report generic best practices, unsupported concerns, speculative
58-
style comments, or unrelated refactors. When changed code introduces a local implementation of a
59-
cross-cutting concern, check whether it bypasses or duplicates an established repository abstraction
60-
or nearby convention. Report only a concrete inconsistency with behavioral or maintenance impact,
61-
and allow intentional deviations.
51+
default paths and their direct test counterparts. Do not flag defects in files not changed by
52+
this PR unless the defect is directly triggered by changed code and cannot be detected in the
53+
changed file alone. Seek plausible counterexamples and regressions from removed safeguards.
54+
Identify assumptions in changed code that depend on facts outside the diff. First verify
55+
repository conventions, tests, and related implementations. When a potential finding depends on
56+
external behavior, use web search and prefer official documentation, specifications, or upstream
57+
repositories. Report only concrete, actionable conflicts or failure modes, citing the relevant
58+
repository location or external source. Prioritize correctness, security, data loss, lifecycle,
59+
and test gaps. Do not report generic best practices, unsupported concerns, speculative style
60+
comments, or unrelated refactors. When changed code introduces a local implementation of a
61+
cross-cutting concern, check whether it bypasses or duplicates an established repository
62+
abstraction or nearby convention. Report only a concrete inconsistency with behavioral or
63+
maintenance impact, and allow intentional deviations.
6264
6365
- path: "**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}"
6466
instructions: >-

‎.github/workflows/code-qa.yml‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ jobs:
173173
node src/scripts/verify-lcov.mjs src/coverage/services/lcov.info
174174
node src/scripts/verify-lcov.mjs src/coverage/misc/lcov.info
175175
node src/scripts/verify-lcov.mjs src/coverage/tree-sitter/lcov.info
176+
- name: Merge extension coverage reports
177+
run: |
178+
mkdir -p src/coverage/merged
179+
pnpm --dir src run merge:coverage
180+
node src/scripts/verify-lcov.mjs src/coverage/merged/lcov.info
181+
# Validate cache boundaries before publishing any new Turbo entries.
182+
- name: Verify coverage cache inputs
183+
run: pnpm --dir src run verify:coverage-cache-inputs
176184
- name: Save Turbo cache
177185
if: steps.turbo-cache.outputs.cache-hit != 'true'
178186
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -184,21 +192,16 @@ jobs:
184192
# there mostly adds Codecov overhead without changing pass/fail
185193
# behavior.
186194
# Coverage is uploaded in separate steps so each LCOV gets the
187-
# correct flag set. Codecov double-counts overlapping lines when a
188-
# single upload carries multiple flags whose paths overlap, so the
189-
# core lanes and webview lane must be uploaded individually with
190-
# their own flag.
195+
# correct flag set. Extension lanes instrument the same sources, so
196+
# union them before upload; a line is covered when any lane executes
197+
# it. Core and webview reports retain their independent flags.
191198
# See https://docs.codecov.com/docs/flags
192199
- name: Upload non-core coverage to Codecov
193200
if: matrix.upload-coverage
194201
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
195202
with:
196203
files: >-
197-
src/coverage/api/lcov.info,
198-
src/coverage/core/lcov.info,
199-
src/coverage/services/lcov.info,
200-
src/coverage/misc/lcov.info,
201-
src/coverage/tree-sitter/lcov.info,
204+
src/coverage/merged/lcov.info,
202205
packages/cloud/coverage/lcov.info,
203206
packages/telemetry/coverage/lcov.info,
204207
apps/cli/coverage/lcov.info
@@ -240,6 +243,7 @@ jobs:
240243
src/coverage/services/lcov.info
241244
src/coverage/misc/lcov.info
242245
src/coverage/tree-sitter/lcov.info
246+
src/coverage/merged/lcov.info
243247
webview-ui/coverage/lcov.info
244248
packages/cloud/coverage/lcov.info
245249
packages/telemetry/coverage/lcov.info

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

Lines changed: 90 additions & 8 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, labeled, unlabeled]
17+
types: [opened, reopened, ready_for_review, 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
@@ -316,14 +316,24 @@ jobs:
316316
return match?.[1] ?? null;
317317
}
318318
319+
// Collaborator permissions are repository-level, so memoize them for
320+
// the whole run: a maintainer's current-head CHANGES_REQUESTED reaches
321+
// both review loops, and scheduled sweeps reconcile every open PR.
322+
const permissionCache = new Map();
319323
async function permissionFor(username) {
324+
const key = username.toLowerCase();
325+
if (permissionCache.has(key)) return permissionCache.get(key);
320326
try {
321327
const result = await github.rest.repos.getCollaboratorPermissionLevel({
322328
owner, repo, username,
323329
});
330+
permissionCache.set(key, result.data.permission);
324331
return result.data.permission;
325332
} catch (error) {
326-
if (error.status === 404) return 'none';
333+
if (error.status === 404) {
334+
permissionCache.set(key, 'none');
335+
return 'none';
336+
}
327337
throw error;
328338
}
329339
}
@@ -339,7 +349,7 @@ jobs:
339349
'coderabbit-changes': 'Address automated review findings and push fixes.',
340350
coderabbit: 'Required CI passed. Waiting for automated review of the latest commit.',
341351
'draft-approved': 'Automated review complete for the latest commit. Mark the draft ready.',
342-
'maintainer-changes': 'Address maintainer or CODEOWNER feedback, then push an update.',
352+
'maintainer-changes': 'Address maintainer or CODEOWNER feedback, push an update, then re-request review from the blocking maintainer.',
343353
maintainer: 'Awaiting fresh human maintainer or CODEOWNER approval.',
344354
approved: 'The required review sequence passed. Remaining merge requirements apply.',
345355
};
@@ -641,6 +651,81 @@ jobs:
641651
}
642652
}
643653
654+
// Durable per-maintainer change-request blockers (issue #1671).
655+
// Unlike approvals and CodeRabbit reviews, a human maintainer's
656+
// CHANGES_REQUESTED stays binding across author pushes, base-branch
657+
// merges, CI runs, and CodeRabbit reviews until that same
658+
// maintainer's blocker is cleared by one of:
659+
// 1. the PR author explicitly re-requesting review from them,
660+
// 2. a newer review from that maintainer (its state decides), or
661+
// 3. GitHub dismissing the blocking review.
662+
// Latest state per reviewer is keyed by review id (monotonically
663+
// increasing) so reordered or duplicate history cannot change the
664+
// result. COMMENTED reviews are neutral and never clear a blocker;
665+
// a DISMISSED latest review clears it.
666+
const latestHumanReview = new Map();
667+
for (const r of reviews) {
668+
const reviewer = r.user?.login?.toLowerCase();
669+
if (!reviewer ||
670+
r.user?.type === 'Bot' ||
671+
codeRabbitLogins.has(reviewer) ||
672+
reviewer === pr.user?.login?.toLowerCase() ||
673+
r.state === 'COMMENTED') {
674+
continue;
675+
}
676+
const previous = latestHumanReview.get(reviewer);
677+
if (!previous || r.id > previous.id) {
678+
latestHumanReview.set(reviewer, r);
679+
}
680+
}
681+
const maintainerBlockers = new Map();
682+
for (const [reviewer, review] of latestHumanReview) {
683+
if (review.state !== 'CHANGES_REQUESTED') continue;
684+
if (['admin', 'maintain', 'write'].includes(await permissionFor(review.user.login))) {
685+
maintainerBlockers.set(reviewer, review);
686+
}
687+
}
688+
689+
// Clear blockers the author explicitly re-requested. Only a
690+
// review_requested timeline event whose actor is the PR author and
691+
// whose requested reviewer is the blocking maintainer clears that
692+
// maintainer's blocker. Team requests carry no requested_reviewer
693+
// and never clear an individual blocker; review_request_removed
694+
// events only trigger reconciliation and are not clearing evidence.
695+
// If the timeline cannot be reconstructed, fail closed: keep every
696+
// blocker so awaiting-author is preserved.
697+
if (maintainerBlockers.size > 0) {
698+
let timelineEvents = null;
699+
try {
700+
timelineEvents = await github.paginate(github.rest.issues.listEventsForTimeline, {
701+
owner, repo, issue_number: pr.number, per_page: 100,
702+
});
703+
} catch (error) {
704+
core.warning(
705+
`PR #${pr.number}: could not reconstruct review-request history; ` +
706+
`preserving maintainer blockers: ${error.message}`
707+
);
708+
}
709+
if (timelineEvents) {
710+
const authorLogin = pr.user?.login?.toLowerCase();
711+
for (const event of timelineEvents) {
712+
if (event.event !== 'review_requested') continue;
713+
if (event.actor?.login?.toLowerCase() !== authorLogin) continue;
714+
const requested = event.requested_reviewer?.login?.toLowerCase();
715+
if (!requested) continue;
716+
const blocker = maintainerBlockers.get(requested);
717+
if (!blocker) continue;
718+
const requestedAt = Date.parse(event.created_at ?? '');
719+
const blockedAt = Date.parse(blocker.submitted_at ?? '');
720+
// A re-request only clears blockers it follows; missing or
721+
// unparsable timestamps fail closed and keep the blocker.
722+
if (!Number.isNaN(requestedAt) && !Number.isNaN(blockedAt) && requestedAt >= blockedAt) {
723+
maintainerBlockers.delete(requested);
724+
}
725+
}
726+
}
727+
}
728+
644729
const codeRabbitReview = latest.get(codeRabbitLogin);
645730
const freshCodeRabbitReview = codeRabbitReview?.commit_id === pr.head.sha
646731
? codeRabbitReview
@@ -657,9 +742,6 @@ jobs:
657742
freshMaintainerReviews.push(review);
658743
}
659744
}
660-
const maintainerChangeRequest = freshMaintainerReviews.find(
661-
review => review.state === 'CHANGES_REQUESTED'
662-
);
663745
const automatedAuthor = pr.user?.type === 'Bot';
664746
const codeRabbitEligibleAuthor = !automatedAuthor ||
665747
codeRabbitEligibleBotLogins.has(pr.user?.login.toLowerCase());
@@ -676,7 +758,7 @@ jobs:
676758
let phase;
677759
let activateCodeRabbit = false;
678760
let recycleCodeRabbitLabel = false;
679-
if (codeRabbitChangesRequested || maintainerChangeRequest) {
761+
if (codeRabbitChangesRequested || maintainerBlockers.size > 0) {
680762
desiredLabel = 'awaiting-author';
681763
phase = codeRabbitChangesRequested ? 'coderabbit-changes' : 'maintainer-changes';
682764
} else if (!codeRabbitEligibleAuthor) {
@@ -740,7 +822,7 @@ jobs:
740822
core.info(
741823
`PR #${pr.number}: CI passing, reviews=${latest.size}, ` +
742824
`coderabbit=${freshCodeRabbitReview?.state ?? (codeRabbitEligibleAuthor ? 'pending' : 'optional')}, ` +
743-
`maintainer=${maintainerApproval?.state ?? 'pending'} → ${desiredLabel ?? '(none)'}`
825+
`maintainer=${maintainerApproval?.state ?? 'pending'}, blockers=${maintainerBlockers.size} → ${desiredLabel ?? '(none)'}`
744826
);
745827
746828
const readyForMaintainer = phase === 'maintainer' || phase === 'approved';

‎.github/workflows/mutation-testing.yml‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ concurrency:
1616
jobs:
1717
mutation-diff:
1818
name: mutation-diff
19+
if: github.event_name == 'merge_group' || github.event.pull_request.draft == false
1920
runs-on: ubuntu-latest
2021
timeout-minutes: 30
2122
steps:
@@ -35,13 +36,6 @@ jobs:
3536
fetch-depth: 0
3637
persist-credentials: false
3738

38-
- name: Fetch pull request base
39-
if: github.event_name == 'pull_request'
40-
env:
41-
BASE_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}.git
42-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
43-
run: git fetch --no-tags "$BASE_REPOSITORY_URL" "$BASE_SHA"
44-
4539
- name: Setup Node.js and pnpm
4640
if: github.event_name == 'pull_request'
4741
uses: ./.github/actions/setup-node-pnpm
@@ -55,9 +49,10 @@ jobs:
5549
- name: Enforce executable-line scope and run advisory mutation testing
5650
if: github.event_name == 'pull_request'
5751
env:
58-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
5952
HEAD_SHA: ${{ github.sha }}
60-
run: node scripts/stryker-diff.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA"
53+
run: |
54+
BASE_SHA="$(git rev-parse "$HEAD_SHA^1")"
55+
node scripts/stryker-diff.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA"
6156
6257
- name: Upload mutation reports
6358
id: mutation_report

‎.github/workflows/release-reminder.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
DISCORD_RELEASE_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
2727
run: |
2828
set -euo pipefail
29-
owners=("Elliott" "Navad" "Toray")
29+
owners=("Elliott" "James" "Toray")
3030
anchor_date="2026-07-17"
3131
seconds_since_anchor=$(($(date -u +%s) - $(date -u -d "$anchor_date" +%s)))
3232
weeks_since_anchor=$((seconds_since_anchor / 604800))

‎CHANGELOG.md‎

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

3+
## [3.82.2]
4+
5+
### Patch Changes
6+
7+
- Prevent unavailable tools from appearing in system prompts (#505 by @DScoNOIZ, #1240 by @JunyongParkDev, PR #1505 by @DaubnerF)
8+
- Fix DeepSeek Flash image input by adding the new deepseek-flash model ID (PR #1618 by @app/zoomote)
9+
- Fix token usage tracking for Grok and xAI-compatible endpoints whose domains contain "x.ai" (#1483 by @BambinoSK, PR #1484 by @BambinoSK)
10+
- Apply the configured reasoning effort consistently across OpenAI-compatible requests (#993 by @Gringo675, PR #1604 by @JunyongParkDev)
11+
- Preserve the configured LiteLLM model ID in the model picker (#1367 by @easonLiangWorldedtech, PR #1368 by @easonLiangWorldedtech)
12+
- Fix delegated subtasks reading the parent mode in environment details and tool validation (#1623 by @edelauna, PR #1625 by @edelauna)
13+
- Add a file version token to the guarded-write path to prevent stale overwrites (PR #1383 by @easonLiangWorldedtech)
14+
- Extract the code-index manager registry for clearer ownership (PR #1622 by @WebMad)
15+
- Route Roomote pull requests through the CodeRabbit review path (PR #1598 by @app/zoomote)
16+
- Make mutation-testing findings advisory instead of blocking (PR #1610 by @app/zoomote)
17+
- Group mutation warnings by source location to remove duplicate warnings (PR #1619 by @app/zoomote)
18+
- Skip mutation testing while pull requests are in draft (PR #1645 by @app/zoomote)
19+
- Scope the mutation diff against the exact merge base so unrelated changes on main stop inflating the scope (PR #1655 by @app/zoomote)
20+
- Model test bundle dependencies in Turbo so caching stays correct (#114 by @edelauna, PR #1611 by @app/zoomote)
21+
- Separate extension unit tests from bundle smoke tests (PR #1614 by @app/zoomote)
22+
- Move extension source coverage to cacheable test lanes (#118 by @edelauna, PR #1620 by @app/zoomote)
23+
- Cache extension coverage by ownership lanes (#115 by @edelauna, PR #1631 by @app/zoomote)
24+
- Keep coverage caches valid when only verification scripts change (PR #1649 by @app/zoomote)
25+
- Union ownership-lane coverage reports before uploading to Codecov (#1647 by @DaubnerF, PR #1650 by @app/zoomote)
26+
- Validate coverage lanes dynamically in the merge queue (PR #1644 by @app/zoomote)
27+
- Stabilize the accessibility contrast audit during theme changes (#1612 by @edelauna, PR #1613 by @app/zoomote)
28+
- Make CodeRabbit completeness checks advisory (PR #1621 by @app/zoomote)
29+
330
## [3.82.1]
431

532
### Patch Changes

0 commit comments

Comments
 (0)