fix(sdk): resolve 0.4.0 premortem and reconcile PRs #363 and #368 - #376
Merged
Merged
Conversation
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the
0.4.05-PR stack (#369–#373) addressing all 4 verified Tigers identified in the post-merge Pre-Mortem review and reconciling open PRs#363and#368:Tiger 1 (
[HIGH]): RestorepublishConfig.tag: "latest"for0.4.0packages/sdk/package.jsonpublishConfig.tagfrom"next"back to"latest"sonpm install @google/stitch-sdkinstalls0.4.0.assert.strictEqual(tag, "latest")check for non-prerelease versions inscripts/publish-readiness.tsand updatesRELEASING.md.Tiger 2 (
[HIGH]): Preventawait stitch.close()from permanently bricking thestitchsingleton (CLIENT_CLOSED)public get closed(): booleanonStitchToolClient.singleton.tssoawait stitch.close()clears_client,_clientCacheKey, and_stitchwithout eagerly constructing a client when called before first use (preventingZodErrorwhen credentials aren't set yet), and ensuresgetOrCreateClient()replaces any closed client.Tiger 3 (
[MEDIUM]): Preserve0.3.5modelIdunion literals (GEMINI_3_PRO,GEMINI_3_FLASH,GEMINI_3_1_PRO)0.3.5modelIdenum values alongside0.4.0literals (GEMINI_3_8_FLASH,GEMINI_3_5_FLASH_LITE) during load-time and runtime schema repair so TypeScript callers and@google/stitch-sdk/ai//adkZod tool schemas remain backward-compatible.Tiger 4 (
[MEDIUM]): Prevent cyclicTypeErroronJSON.stringify(screen)/JSON.stringify(generation)this.clientas non-enumerable (enumerable: false) in generated domain class constructors (scripts/generate-sdk.ts) andEntityManager(packages/sdk/src/entity-manager.ts), breaking theclient.entities.client === clientenumeration cycle and keepingclientout of{ ...screen }spreads.Reconcile PR
#368& PR#363:#368: AddscollectDefPool()and multi-pass transitive$refresolution inpackages/sdk/src/schema-repair.tsand exportsrepairToolSchemas,repairSchema, andcollectDefPoolfrom the root entry point.#363: Normalizes transient fetch/socket errors (fetch failed,ECONNRESET,socket,other side closed) intoStitchError(NETWORK_ERROR), marksisConnected = false, and reconnects inside thecallToolretry loop for idempotent reads (get_*/list_*).