diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 724e1cf1a..148f96f92 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -15,6 +15,9 @@ ### Fixed - Fixed Google Vertex AI multi-region locations `eu` and `us` building invalid hosts (`eu-aiplatform.googleapis.com` / `us-aiplatform.googleapis.com`) that 404. Both Gemini GenerateContent and Claude/OpenAI-compat Vertex routes now resolve the REP endpoints (`aiplatform.eu.rep.googleapis.com` / `aiplatform.us.rep.googleapis.com`). +### Fixed + +- Fixed `SqliteAuthCredentialStore.close()` leaking eight prepared statements (`updateIfMatches`, `updateIfMatchesWithLease`, `deleteIfMatchesWithLease`, `deleteCachePrefix`, and the four credential-refresh-lease statements), which kept the SQLite connection alive after `close()`. On Windows the auth DB and its `-wal`/`-shm` files stayed locked, so temp-dir cleanup intermittently failed with `EBUSY`; on POSIX the handle leaked silently. ## [17.1.6] - 2026-07-27 diff --git a/packages/ai/src/auth-storage.ts b/packages/ai/src/auth-storage.ts index 51b9f25ac..ba7e2ffa6 100644 --- a/packages/ai/src/auth-storage.ts +++ b/packages/ai/src/auth-storage.ts @@ -7923,6 +7923,14 @@ export class SqliteAuthCredentialStore implements AuthCredentialStore { this.#updateUsageHistoryStmt.finalize(); this.#insertUsageCostStmt.finalize(); this.#listUsageCostsStmt.finalize(); + this.#updateIfMatchesStmt.finalize(); + this.#updateIfMatchesWithLeaseStmt.finalize(); + this.#deleteIfMatchesWithLeaseStmt.finalize(); + this.#deleteCachePrefixStmt.finalize(); + this.#acquireCredentialRefreshLeaseStmt.finalize(); + this.#getCredentialRefreshLeaseStmt.finalize(); + this.#renewCredentialRefreshLeaseStmt.finalize(); + this.#releaseCredentialRefreshLeaseStmt.finalize(); this.#db.close(); } }