SIGN IN SIGN UP

fix: stop CLI free-trial polling for non-free-trial models (#11215)

* fix(cli): gate free-trial status polling by model

* style(cli): format free-trial status changes

* fix(vscode): skip remote marketplace installs when ssh tests are disabled

* fix: remove unrelated e2e extension install changes

Address review feedback by reverting the unrelated changes to
extensions/vscode/package.json and removing the new
install-marketplace-extensions.mjs script.

* fix: clean up isModelUsingFreeTrial and remove NODE_ENV test workaround

- Add optional chaining on apiKeyLocation to prevent crash when undefined
- Remove unnecessary `as any` cast (union narrows via provider check)
- Remove process.env.NODE_ENV === "test" branch from production code;
  fake timers in tests handle polling without it

* fix: remove FreeTrialStatus test file

* fix: narrow ModelConfig union before accessing apiKeyLocation

Use an if-statement so TypeScript narrows the discriminated union
to the continue-proxy variant before accessing apiKeyLocation.

* fix: use 'in' operator to narrow ModelConfig union for apiKeyLocation

The Zod schema uses z.string().refine() for the non-continue-proxy
variant, which infers as plain 'string' at the type level, preventing
TypeScript from narrowing via the provider discriminant. Use an 'in'
check to narrow instead.

---------

Co-authored-by: Dallin Romney <dallinromney@gmail.com>
Y
Yishan committed
b09c4ba1f3438bd29b5556a52d81fa5463134fd3
Parent: 1afd799
Committed by GitHub <noreply@github.com> on 3/26/2026, 1:51:39 AM