Skip to content

ci: cross-platform matrix + paths-ignore + concurrency#556

Merged
rohitg00 merged 5 commits into
mainfrom
ci/lift-iii-patterns
May 20, 2026
Merged

ci: cross-platform matrix + paths-ignore + concurrency#556
rohitg00 merged 5 commits into
mainfrom
ci/lift-iii-patterns

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 20, 2026

Summary

Three CI patterns added to make ci.yml carry more weight. All pay rent on every run.

What changed

1. Cross-platform OS matrix (ubuntu + macos)

os: [ubuntu-latest, macos-latest]
node-version: [20, 22]
fail-fast: false

4 cells, ~3min each. Catches darwin/linux divergence that Linux-only CI misses.

Windows held back — test/obsidian-export.test.ts hardcodes POSIX /tmp/... paths that fail on Windows runners (D:\tmp\...). src/functions/obsidian-export.ts needs os.tmpdir() + path.join rework before Windows can be added back. Will file as follow-up.

fail-fast: false so a flake on one cell doesn't mask whether the same failure reproduces elsewhere.

2. paths-ignore for doc-only churn

Skip CI runs on README / CHANGELOG / docs / website / assets / .md / .mdx pushes. ~half the runner minutes back on doc-only churn. Source / config / workflow changes always run.

3. concurrency with PR-only cancel

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

PR force-pushes cancel in-flight runs. Push to main keeps protection (concurrency group scoped to ref, no cancel for main pushes).

4. Minor hardening

persist-credentials: false on actions/checkout@v6 — GITHUB_TOKEN doesn't land in .git/config.

Verification

Branch CI itself proves it:

  • 4 matrix cells pass on the PR (ubuntu/macos × Node 20/22)
  • Cancel-in-progress fires on force-push
  • Doc-only follow-up commit on this branch skips CI

Follow-up (separate PR)

Rework src/functions/obsidian-export.ts to use os.tmpdir() + path.join so Windows can be added to the matrix.

Summary by CodeRabbit

  • Chores

    • Expanded CI testing to run on macOS and Linux with Node.js 20 and 22
    • Optimized workflow to skip runs for documentation-only changes
    • Added manual workflow trigger and refined concurrency to cancel in-flight pull request runs while preserving push runs
    • Disabled credential persistence during checkout
  • Tests

    • Increased filesystem watcher test robustness with retries and longer observation waits

Review Change Stack

Three patterns lifted from iii-hq/iii/.github:

1. **OS matrix** — Linux + Windows + macOS, both Node 20 + 22. 6 cells,
   ~3min each, ~18min wall time. Direct test against the class of
   bug #487 caught: hooks crashing on Windows usernames with spaces.
   Pre-merge Linux-only CI meant that bug landed in main + a release.
   fail-fast: false so a flake on one cell doesn't mask whether the
   same failure reproduces elsewhere.

2. **paths-ignore** — skip CI runs on README / CHANGELOG / docs /
   website / assets / .md / .mdx pushes. ~half the runner minutes
   back on doc-only churn. Source / config / workflow changes
   always run.

3. **concurrency + cancel-in-progress** — PR force-pushes cancel
   in-flight runs instead of piling them up. Push to main protected
   (concurrency group still scoped to ref, no cancel for main pushes).

Plus minor hardening: persist-credentials: false on the checkout
step so the GITHUB_TOKEN doesn't land in .git/config.

What was NOT lifted (rationale per plan):
- Per-package reusable workflows (Rust/Python/Homebrew — non-TS).
- License-header check (no per-file Apache banners in agentmemory).
- CLA bot (defer until external PR volume justifies friction).
- tsc --noEmit lint job (codebase has ~10 pre-existing type errors
  tsdown skips; gating CI on those would block every PR until
  fixed; tracked as separate cleanup).
- Smoke test (`agentmemory demo + livez`) — defer to its own PR
  with its own validation cycle.
- Codecov badge — defer until baseline is set.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 20, 2026 9:50am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CI now ignores doc/markdown-only pushes/PRs to main, adds manual dispatch and PR concurrency cancellation, expands the test job to an ubuntu/macOS × Node (20,22) matrix and disables checkout credential persistence. Tests: FilesystemWatcher adds Vitest { retry: 2 } and lengthens watcher wait times from 800ms to 1500ms.

Changes

CI Workflow Enhancement

Layer / File(s) Summary
Push and PR path filters
.github/workflows/ci.yml
Adds paths-ignore for push and pull_request to skip CI for README, CHANGELOG, plan files, docs/website/assets, and **/*.md/**/*.mdx changes.
Manual dispatch and concurrency
.github/workflows/ci.yml
Adds workflow_dispatch and a concurrency group keyed by ${{ github.workflow }}-${{ github.ref }} that cancels in-flight PR runs for the same ref.
Test matrix and checkout changes
.github/workflows/ci.yml
Expands test job to a matrix across ubuntu-latest and macos-latest with Node versions 20 and 22, sets fail-fast: false, and sets actions/checkout persist-credentials: false.

FilesystemWatcher tests

Layer / File(s) Summary
Vitest retry and extended waits
test/fs-watcher.test.ts
Adds { retry: 2 } to the FilesystemWatcher suite and changes multiple wait(800) calls to wait(1500) before asserting captured watcher observations.

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant GitHub
  participant Workflow
  participant MatrixRunner
  participant Checkout
  participant TestSteps
  Developer->>GitHub: push / pull_request / workflow_dispatch
  GitHub->>Workflow: start workflow
  Workflow->>Workflow: evaluate `paths-ignore` filters
  Workflow->>Workflow: evaluate `concurrency` for PRs
  Workflow->>MatrixRunner: spawn matrix jobs (ubuntu/macos × Node20/22)
  MatrixRunner->>Checkout: actions/checkout (persist-credentials: false)
  MatrixRunner->>TestSteps: run tests (fail-fast: false)
  TestSteps-->>MatrixRunner: results
  MatrixRunner-->>Workflow: job complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I'm a rabbit by the CI gate, nibbling docs with glee,
I spare the runners, quiet the noise, let real tests roam free,
Ubuntu and macOS dance with Node twenty and twenty-two,
I hop and lengthen watcher waits — so flaky signals are few,
Pipelines hum, the green checks bloom, and I munch peacefully. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: CI workflow enhancements including cross-platform matrix testing, paths-ignore configuration, and concurrency management.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/lift-iii-patterns

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

56-58: ⚡ Quick win

Consider pinning GitHub Actions to commit SHA for stronger supply-chain integrity.

Lines 56 and 59 use mutable tags (actions/checkout@v6 and actions/setup-node@v6). While Dependabot manages updates, committing to full commit SHAs provides stronger protection against tag mutation attacks. This would require manually resolving the action SHAs (e.g., actions/checkout@abc1234567...) and periodic updates via Dependabot PRs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 56 - 58, Replace the mutable action
tags used in the workflow (specifically the uses entries "actions/checkout@v6"
and "actions/setup-node@v6") with their corresponding full commit SHAs (e.g.,
"actions/checkout@<full-sha>" and "actions/setup-node@<full-sha>"), updating the
YAML to reference those SHAs and periodically bump them via Dependabot or manual
review to keep them current.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 56-58: Replace the mutable action tags used in the workflow
(specifically the uses entries "actions/checkout@v6" and
"actions/setup-node@v6") with their corresponding full commit SHAs (e.g.,
"actions/checkout@<full-sha>" and "actions/setup-node@<full-sha>"), updating the
YAML to reference those SHAs and periodically bump them via Dependabot or manual
review to keep them current.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51fc1900-ff6e-477c-8dc9-ce3523cecb2d

📥 Commits

Reviewing files that changed from the base of the PR and between 1838f4d and eabcaf9.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@rohitg00 rohitg00 changed the title ci: cross-platform matrix + paths-ignore + concurrency (lift from iii) ci: cross-platform matrix + paths-ignore + concurrency May 20, 2026
Windows runners default to cmd.exe for npm run scripts; the build
script uses POSIX patterns the build script's exit codes
(`cp ... 2>/dev/null || true`, `mkdir -p`) that cmd doesn't
parse. ubuntu + macos already use bash by default so this is
Windows-only behaviour change.

Alternative: rewrite the build script in Node. Bigger lift, not
minimal.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 56-59: Replace mutable tag references actions/checkout@v6 and
actions/setup-node@v6 with their corresponding full immutable commit SHAs;
locate the workflow steps that use "uses: actions/checkout@v6" and "uses:
actions/setup-node@v6" and update each to the full-length commit SHA for the
specific release you want to pin, then verify the SHAs match the upstream
repository commits and run the workflow to confirm no breakage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b6badf94-9087-4851-9c12-fd12b01238b8

📥 Commits

Reviewing files that changed from the base of the PR and between eabcaf9 and 21d710b.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment on lines 56 to 59
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# First, read the CI workflow file to verify lines 56-59
cat -n .github/workflows/ci.yml | sed -n '50,65p'

Repository: rohitg00/agentmemory

Length of output: 913


🏁 Script executed:

# Search for any documented policies or security guidelines
fd -e md -e txt | xargs grep -l "pin\|action\|commit.*sha" 2>/dev/null | head -20

Repository: rohitg00/agentmemory

Length of output: 398


🏁 Script executed:

# Look for CONTRIBUTING, security, or policy files
fd -i "contributing\|security\|policy" -e md -e txt

Repository: rohitg00/agentmemory

Length of output: 46


🏁 Script executed:

# Check CONTRIBUTING.md for any policy about GitHub Actions pinning
cat CONTRIBUTING.md | grep -i -A5 -B5 "action\|pin\|commit"

Repository: rohitg00/agentmemory

Length of output: 2527


🏁 Script executed:

# Also check README.md and other key docs
grep -r "action.*pin\|pin.*action\|commit.*sha" . --include="*.md" 2>/dev/null | head -20

Repository: rohitg00/agentmemory

Length of output: 4506


🌐 Web query:

GitHub Actions version pinning best practices security supply chain

💡 Result:

To secure your supply chain against malicious updates or compromised maintainer accounts, the industry-standard best practice for GitHub Actions is to pin all actions to their full-length commit SHA [1][2][3]. Why Pinning to SHA is Critical GitHub Actions referenced by tags (e.g., @v4) or branches are mutable, meaning they can be updated or moved by the repository owner at any time [4][5]. If an action's repository is compromised, an attacker can force-push new code to an existing tag, causing all workflows using that tag to automatically execute the malicious code [6][7][5]. Pinning to a full-length commit SHA ensures that your workflow always executes the exact, immutable code you have audited and trusted [4][3]. Best Practices for Implementation 1. Use Full-Length Commit SHAs: Always use the full 40-character commit SHA rather than a short hash [3]. 2. Include Version Comments: To maintain readability and track which version the SHA corresponds to, append the version tag as a comment in your workflow file [1][2]: uses: actions/checkout@b4ffde6 # v4.1.1 3. Enforce via Policy: Organizations can enforce this practice at the enterprise or organization level by configuring GitHub Actions policies to require full-length commit SHAs for all actions [6][3]. 4. Automate Updates: Use Dependabot to manage your pinned actions [8]. When configured for GitHub Actions, Dependabot will monitor for updates and open pull requests to bump your pinned SHAs to newer, secure versions [8][9]. 5. Be Aware of Transitive Dependencies: Pinning your direct action dependencies does not automatically pin the actions they call internally [10]. Be cautious when using complex actions that pull in many transitive dependencies, as these can also be targets for supply chain attacks [10]. Additional Security Considerations - Trust and Verification: If you must use tags for convenience, only do so for actions from highly trusted, verified creators [3]. - Monitor for Compromise: Even with pinning, stay informed about security advisories for the actions you use [4][11]. - Platform Controls: Leverage GitHub's evolving security features, such as immutable releases (which prevent tags from being moved) and organization-level execution policies, to further harden your CI/CD environment [6][12][5].

Citations:


Pin GitHub Actions to immutable commit SHAs.

Line 56 and Line 59 use mutable major tags (@v6). These should be pinned to full-length commit SHAs to prevent supply-chain attacks; if the upstream repository is compromised, tag-based references will execute malicious code pushed to that tag.

Suggested change
-      - uses: actions/checkout@v6
+      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
         with:
           persist-credentials: false
-      - uses: actions/setup-node@v6
+      - uses: actions/setup-node@1a4442caab129478d0a1be582e52490f7e012c96 # v4.0.1
         with:
           node-version: ${{ matrix.node-version }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- uses: actions/setup-node@1a4442caab129478d0a1be582e52490f7e012c96 # v4.0.1
🧰 Tools
🪛 zizmor (1.25.2)

[error] 56-56: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 59-59: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 56 - 59, Replace mutable tag
references actions/checkout@v6 and actions/setup-node@v6 with their
corresponding full immutable commit SHAs; locate the workflow steps that use
"uses: actions/checkout@v6" and "uses: actions/setup-node@v6" and update each to
the full-length commit SHA for the specific release you want to pin, then verify
the SHAs match the upstream repository commits and run the workflow to confirm
no breakage.

`shell: bash` on the step only sets the shell for the step's own
runner; `npm run` still spawns its inner script via npm's
`script-shell` config, which defaults to cmd.exe on Windows.

Configure npm to use Git-Bash (preinstalled on GitHub-hosted
Windows runners) so `npm run build` and `npm run test` execute
the build script the same way ubuntu + macos do.

Step is gated on `runner.os == 'Windows'` so it's a no-op on the
other matrix cells.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

56-56: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Duplicate: Pin actions to commit SHAs for supply-chain security.

This issue was flagged in a previous review and remains unaddressed. The mutable @v6 tags should be replaced with immutable commit SHAs to prevent supply-chain attacks if upstream repositories are compromised.

Run this script to find the correct commit SHAs for the v6 releases:

#!/bin/bash
# Find the latest commit SHA for actions/checkout@v6 and actions/setup-node@v6

echo "=== actions/checkout v6 ==="
gh api repos/actions/checkout/git/ref/tags/v6 --jq '.object.sha' 2>/dev/null || echo "Tag lookup failed; trying releases..."
gh api repos/actions/checkout/releases/latest --jq '"\(.tag_name): \(.target_commitish)"'

echo -e "\n=== actions/setup-node v6 ==="
gh api repos/actions/setup-node/git/ref/tags/v6 --jq '.object.sha' 2>/dev/null || echo "Tag lookup failed; trying releases..."
gh api repos/actions/setup-node/releases/latest --jq '"\(.tag_name): \(.target_commitish)"'

Also applies to: 59-59

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 56, Replace the mutable action tags with
immutable commit SHAs: change the uses entries that reference
actions/checkout@v6 and actions/setup-node@v6 to the corresponding commit SHA
for the v6 tag (pin to the full 40-char commit) so the workflow uses a specific
commit instead of the mutable `@v6` tag; locate the uses lines for
"actions/checkout@v6" and "actions/setup-node@v6" in the CI YAML and replace the
tag with the exact commit SHA returned by the GitHub API or release metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.github/workflows/ci.yml:
- Line 56: Replace the mutable action tags with immutable commit SHAs: change
the uses entries that reference actions/checkout@v6 and actions/setup-node@v6 to
the corresponding commit SHA for the v6 tag (pin to the full 40-char commit) so
the workflow uses a specific commit instead of the mutable `@v6` tag; locate the
uses lines for "actions/checkout@v6" and "actions/setup-node@v6" in the CI YAML
and replace the tag with the exact commit SHA returned by the GitHub API or
release metadata.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b0baa798-49d4-4422-a2fa-f027e8db3da3

📥 Commits

Reviewing files that changed from the base of the PR and between 21d710b and 776831f.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

…paths)

Windows runners fail on test/obsidian-export.test.ts because the
test + src hardcode `/tmp/...` POSIX paths that don't resolve on
the D:\ drive Windows uses. Fixing it cleanly requires reworking
src/functions/obsidian-export.ts to use os.tmpdir() + path.join,
which is a separate scope.

Drop windows from the matrix for now. Ship ubuntu + macos coverage
(real darwin/linux divergence catch) and file a follow-up to make
obsidian-export cross-platform so Windows can be added back.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/fs-watcher.test.ts`:
- Line 15: Remove the invalid options object passed to describe — change the
line using describe("FilesystemWatcher", { retry: 2 }, ...) to a normal
describe("FilesystemWatcher", ...) call, and configure retries in your Vitest
config instead (add/adjust test.retry or test.retry.count in vitest.config.ts to
2, or use the detailed test.retry object if needed); this keeps the test suite
signature clean and ensures retries are applied via Vitest configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b0a9c460-5a10-4aec-9512-60314e4ebc4c

📥 Commits

Reviewing files that changed from the base of the PR and between cfabff7 and 4e47b84.

📒 Files selected for processing (1)
  • test/fs-watcher.test.ts

Comment thread test/fs-watcher.test.ts
}

describe("FilesystemWatcher", () => {
describe("FilesystemWatcher", { retry: 2 }, () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Vitest 4.1.6 describe retry configuration syntax

💡 Result:

Vitest 4.1.6 “retry” configuration syntax (for test retries) is: 1) As a number (retries all failures) - In vitest config, set test.retry to a number meaning “how many times to retry the test if it fails”. Default is 0. [1] Example: export default defineConfig({ test: { retry: 3, }, }) [2][1] 2) As an object (fine-grained control; available since Vitest 4.1) The object supports these fields: [2][1] - count?: number The number of times to retry the test if it fails. Default is 0. [2][1] - delay?: number Delay in milliseconds between retry attempts. Default is 0. [2][1] - condition?: RegExp | ((error: TestError) => boolean) Controls which failures should trigger a retry: [2][1] - If RegExp, it is tested against the error message. [1] - If function, it’s called with the TestError; return true to retry. [1] Example (RegExp condition): export default defineConfig({ test: { retry: { count: 2, condition: /ECONNREFUSED|ETIMEDOUT/i, }, }, }) [3] Example (CLI flags mentioned in the retry feature commit; same options map to config fields): - --retry= - --retry - --retry.count - --retry.delay - --retry.condition [3] Notes on the function condition: - Vitest docs note that functions can only be used in test files, not in vitest.config.ts, because configuration is serialized when passed to worker threads. [2][1] So, in Vitest 4.1.6, the retry configuration is either: - test: { retry: } or - test: { retry: { count?: , delay?: , condition?: <RegExp|function> } } [1]

Citations:


Remove invalid retry syntax and configure retries in vitest.config.ts instead.

The { retry: 2 } options object as a parameter to describe() is not valid Vitest 4.1.6 syntax. Vitest 4.1.6 only supports retry configuration through the config file, either globally (test: { retry: 2 }) or with fine-grained control (test: { retry: { count: 2, delay: 0, condition: <RegExp|function> } }). The current syntax has no effect and will not add retry behavior to the test suite. Move the retry configuration to vitest.config.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/fs-watcher.test.ts` at line 15, Remove the invalid options object passed
to describe — change the line using describe("FilesystemWatcher", { retry: 2 },
...) to a normal describe("FilesystemWatcher", ...) call, and configure retries
in your Vitest config instead (add/adjust test.retry or test.retry.count in
vitest.config.ts to 2, or use the detailed test.retry object if needed); this
keeps the test suite signature clean and ensures retries are applied via Vitest
configuration.

@rohitg00 rohitg00 merged commit e9dc710 into main May 20, 2026
7 checks passed
@rohitg00 rohitg00 deleted the ci/lift-iii-patterns branch May 20, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant