Skip to content

[BUG] Six config import/export unit tests fail on Windows (green on ubuntu CI) #2059

Open

Description

@easonLiangWorldedtech

Testbench Type

VS Code extension (Zoo Code)

What happened?

Six unit tests in the profile import/export area fail deterministically on Windows while the same commit is green on the ubuntu CI runners:

src/core/config/__tests__/importExport.spec.ts (3 failed / 53)

  • importExport > importSettings > should not clobber existing api configs — expect(result.success).toBe(true) gets false (the import error is swallowed into { success: false })
  • importExport > exportSettings > should exclude modelMaxTokens and modelMaxThinkingTokens when 'supportsReasoningBudget is false' — Cannot read properties of undefined (reading '1')
  • importExport > exportSettings > should exclude modelMaxTokens and modelMaxThinkingTokens when 'requiredReasoningBudget is false' — same error

src/core/config/__tests__/ProviderSettingsManager.spec.ts (3 failed / 58, all in Export)

  • should preserve retired provider profiles with full fields
  • should preserve modelMaxTokens for models that support a configurable max output (e.g. GLM)
  • should strip both token fields for models that support neither reasoning budgets nor a configurable max

All three throw Failed to export provider profiles: [...] from a zod validation error, e.g.

Failed to export provider profiles: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "object",
    "path": ["apiConfigs", "retired"],
    "message": "Expected string, received object"
  }
]

Steps to reproduce

  1. On Windows, check out main (58341d882) — verified git diff upstream/main -- src/ is empty.
  2. pnpm install
  3. pnpm --dir src exec vitest run --config vitest.unit.config.ts core/config/__tests__/importExport.spec.ts
  4. pnpm --dir src exec vitest run --config vitest.unit.config.ts core/config/__tests__/ProviderSettingsManager.spec.ts

Environment

  • OS: Windows 11 (build 26100)
  • Node: v25.9.0
  • Zoo Code Version: main @ 58341d882

Sub-Discussion

Not dependency drift: the local workspace pins match main's lockfile for every test-relevant package (vitest 4.1.11, @vitest/coverage-v8 4.1.9, zod 3.25.76); the only lockfile deltas in my local workspace are @ai-sdk/* packages, which these specs do not import.

The failures cluster in the profile export/import validation path (zod schema validation of apiConfigs and the importSettings/exportSettings result handling), which suggests a platform-dependent difference — e.g. POSIX-style mock paths like /mock/path/settings.json interacting with win32 path semantics (path.isAbsolute, path.resolve) in the mocked-fs layer, so the export schema receives a partially-resolved structure.

Impact

This blocks the local changed-code mutation workflow on Windows: scripts/stryker-diff.mjs runs Stryker with vitest "related" test selection, and any PR touching src/utils/pathUtils.ts (imported transitively by these specs) fails the Stryker initial test run with "There were failed tests in the initial test run", so the mutation gate cannot be preflighted locally on Windows.

Additional Context

Discovered while running the mutation repro for #2054; the specs had to be temporarily skipped locally to complete the dry-runs. ubuntu CI is unaffected, so this only impacts Windows contributors running unit tests or the mutation gate locally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions