From a8123ab5580fbc8045aca0096c5f22e620f56275 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 13 Apr 2026 06:30:21 -0500 Subject: [PATCH 1/2] fix(cli): resolve duplicate validateConfiguredModel and missing getPiDefaultModelAndProvider import Commit 110c01b8c added an inline `validateConfiguredModel` function in `src/cli.ts` while leaving the prior import from `./startup-model-validation.js` in place, producing TS2440 (import declaration conflicts with local declaration). The same commit added a call to `getPiDefaultModelAndProvider()` without importing it, producing TS2304 (cannot find name). Both errors block `npm run build` and every CI job on main. Drop the stale import and add `getPiDefaultModelAndProvider` to the existing `./pi-migration.js` import where the symbol is actually exported. The local `validateConfiguredModel` function (lines 139-174) becomes the sole definition in scope. `./startup-model-validation.js` is still consumed by its dedicated test files so the module stays. --- src/cli.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 29b7c804b..ba0f204ef 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -16,8 +16,7 @@ import { agentDir, sessionsDir, authFilePath } from './app-paths.js' import { initResources, buildResourceLoader, getNewerManagedResourceVersion } from './resource-loader.js' import { ensureManagedTools } from './tool-bootstrap.js' import { loadStoredEnvKeys } from './wizard.js' -import { migratePiCredentials } from './pi-migration.js' -import { validateConfiguredModel } from './startup-model-validation.js' +import { migratePiCredentials, getPiDefaultModelAndProvider } from './pi-migration.js' import { shouldMigrateAnthropicToClaudeCode } from './provider-migrations.js' import { shouldRunOnboarding, runOnboarding } from './onboarding.js' import chalk from 'chalk' From d4bddfadf5a23f0b694dcfac668b7e91a940030d Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 13 Apr 2026 06:32:47 -0500 Subject: [PATCH 2/2] test(cli): regression test for pi-migration.getPiDefaultModelAndProvider export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asserts that getPiDefaultModelAndProvider and migratePiCredentials remain callable top-level exports from src/pi-migration.ts. If either is ever renamed or unexported, this test fails before the root `tsc` build breaks every CI job on main — the same class of regression introduced by 110c01b8c. --- src/tests/pi-migration-exports.test.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tests/pi-migration-exports.test.ts diff --git a/src/tests/pi-migration-exports.test.ts b/src/tests/pi-migration-exports.test.ts new file mode 100644 index 000000000..e54a8a8c7 --- /dev/null +++ b/src/tests/pi-migration-exports.test.ts @@ -0,0 +1,23 @@ +// GSD-2 — Regression test for pi-migration.ts public exports consumed by cli.ts +// +// Guards against the TS2304 regression introduced by 080c6ac1e where +// src/cli.ts called `getPiDefaultModelAndProvider()` without importing it. +// If the symbol is ever renamed or unexported, this test fails before the +// root `tsc` build breaks every CI job on main. + +import { test } from "node:test"; +import assert from "node:assert/strict"; + +import * as piMigration from "../pi-migration.js"; + +test("pi-migration exports getPiDefaultModelAndProvider for cli.ts fallback-model resolution", () => { + assert.equal( + typeof piMigration.getPiDefaultModelAndProvider, + "function", + "cli.ts validateConfiguredModel relies on this export to pick a fallback model", + ); +}); + +test("pi-migration exports migratePiCredentials for cli.ts startup migration", () => { + assert.equal(typeof piMigration.migratePiCredentials, "function"); +});