Skip to content

fix(sdk): resolve 0.4.0 premortem and reconcile PRs #363 and #368 - #376

Merged
davideast merged 1 commit into
mainfrom
fix/0.4.0-premortem-tigers
Sep 25, 2026
Merged

davideast merged 1 commit into
mainfrom
fix/0.4.0-premortem-tigers

Conversation

@davideast

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to the 0.4.0 5-PR stack (#369–#373) addressing all 4 verified Tigers identified in the post-merge Pre-Mortem review and reconciling open PRs #363 and #368:

  1. Tiger 1 ([HIGH]): Restore publishConfig.tag: "latest" for 0.4.0

    • Updates packages/sdk/package.json publishConfig.tag from "next" back to "latest" so npm install @google/stitch-sdk installs 0.4.0.
    • Restores the strict assert.strictEqual(tag, "latest") check for non-prerelease versions in scripts/publish-readiness.ts and updates RELEASING.md.
  2. Tiger 2 ([HIGH]): Prevent await stitch.close() from permanently bricking the stitch singleton (CLIENT_CLOSED)

    • Adds public get closed(): boolean on StitchToolClient.
    • Updates singleton.ts so await stitch.close() clears _client, _clientCacheKey, and _stitch without eagerly constructing a client when called before first use (preventing ZodError when credentials aren't set yet), and ensures getOrCreateClient() replaces any closed client.
  3. Tiger 3 ([MEDIUM]): Preserve 0.3.5 modelId union literals (GEMINI_3_PRO, GEMINI_3_FLASH, GEMINI_3_1_PRO)

    • Preserves 0.3.5 modelId enum values alongside 0.4.0 literals (GEMINI_3_8_FLASH, GEMINI_3_5_FLASH_LITE) during load-time and runtime schema repair so TypeScript callers and @google/stitch-sdk/ai / /adk Zod tool schemas remain backward-compatible.
  4. Tiger 4 ([MEDIUM]): Prevent cyclic TypeError on JSON.stringify(screen) / JSON.stringify(generation)

    • Defines this.client as non-enumerable (enumerable: false) in generated domain class constructors (scripts/generate-sdk.ts) and EntityManager (packages/sdk/src/entity-manager.ts), breaking the client.entities.client === client enumeration cycle and keeping client out of { ...screen } spreads.
  5. Reconcile PR #368 & PR #363:

    • PR #368: Adds collectDefPool() and multi-pass transitive $ref resolution in packages/sdk/src/schema-repair.ts and exports repairToolSchemas, repairSchema, and collectDefPool from the root entry point.
    • PR #363: Normalizes transient fetch/socket errors (fetch failed, ECONNRESET, socket, other side closed) into StitchError(NETWORK_ERROR), marks isConnected = false, and reconnects inside the callTool retry loop for idempotent reads (get_* / list_*).

@davideast
davideast merged commit edc0e5a into main Sep 25, 2026
12 checks passed
@davideast
davideast deleted the fix/0.4.0-premortem-tigers branch September 25, 2026 04:56
@davideast davideast changed the title fix(sdk): resolve 0.4.0 premortem Tigers and reconcile PRs #363 and #368 fix(sdk): resolve 0.4.0 premortem and reconcile PRs #363 and #368 Sep 25, 2026
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