From e6a2855f2de5deb647d371d8cb03f4e285d1ad66 Mon Sep 17 00:00:00 2001 From: Sanjith Sambath Date: Sat, 30 May 2026 14:19:03 -0700 Subject: [PATCH 1/2] Fix UpdateMetadata serializer to allow null values (per-key removal) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The UpdateMetadata type is `Record` (null on a key removes it), but the serializer wrapped the value in a non-nullable `MetadataValue` schema. At runtime `jsonOrThrow({ key: null })` therefore threw — null could never be sent, so per-key metadata removal via `inboxes.update` was impossible despite compiling. Wrap the record value in `.nullable()` so null short-circuits through serialization. This also aligns the runtime schema with the declared `Schema` type (Raw already includes `| null`). Root cause is upstream: fern-typescript-node-sdk@3.60.0 honors `nullable` in the type layer but drops `.nullable()` in the serialization layer for record/map values. This is a manual edit to the generated file pending a generator fix; it will need re-applying after the next `fern generate` unless the generator is upgraded. Co-Authored-By: Claude Opus 4.8 --- src/serialization/resources/inboxes/types/UpdateMetadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialization/resources/inboxes/types/UpdateMetadata.ts b/src/serialization/resources/inboxes/types/UpdateMetadata.ts index 5a5dad6..afe5527 100644 --- a/src/serialization/resources/inboxes/types/UpdateMetadata.ts +++ b/src/serialization/resources/inboxes/types/UpdateMetadata.ts @@ -8,7 +8,7 @@ import { MetadataValue } from "./MetadataValue.js"; export const UpdateMetadata: core.serialization.Schema< serializers.inboxes.UpdateMetadata.Raw, AgentMail.inboxes.UpdateMetadata -> = core.serialization.record(core.serialization.string(), MetadataValue); +> = core.serialization.record(core.serialization.string(), MetadataValue.nullable()); export declare namespace UpdateMetadata { export type Raw = Record; From 33df629dd6298b3dc286b86140a765fd14e7be59 Mon Sep 17 00:00:00 2001 From: Sanjith Sambath Date: Sat, 30 May 2026 15:41:28 -0700 Subject: [PATCH 2/2] Protect UpdateMetadata serializer from regeneration Add the hand-patched serializer to .fernignore so Fern regeneration does not overwrite the null-value fix (per-key removal). Co-Authored-By: Claude Opus 4.8 --- .fernignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.fernignore b/.fernignore index f184277..53c8943 100644 --- a/.fernignore +++ b/.fernignore @@ -1,4 +1,5 @@ # Specify files that shouldn't be modified by Fern src/wrapper src/index.ts -tests/unit/wrapper \ No newline at end of file +tests/unit/wrapper +src/serialization/resources/inboxes/types/UpdateMetadata.ts \ No newline at end of file