From 1b6e8ab339e83e52af1e8a8a1cc5823fc6a365a4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 30 Mar 2026 22:43:57 +0000 Subject: [PATCH] Fix makeTrimmedStringSetting to actually trim whitespace The passthrough() transformation was an identity function that bypassed TrimmedString's whitespace-trimming decode logic. This meant whitespace-only inputs like " " would not be trimmed to empty and would not trigger the fallback in makeBinaryPathSetting. Fix by using TrimmedString directly (which is Schema.Trim and actively trims on decode) instead of piping Schema.String through a passthrough to TrimmedString. --- packages/contracts/src/settings.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 0b87b7d447..f616f9c935 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -23,10 +23,7 @@ export const SidebarThreadSortOrder = Schema.Literals(["updated_at", "created_at export type SidebarThreadSortOrder = typeof SidebarThreadSortOrder.Type; export const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at"; -const makeTrimmedStringSetting = (description: string) => - Schema.String.annotate({ description }).pipe( - Schema.decodeTo(TrimmedString, SchemaTransformation.passthrough()), - ); +const makeTrimmedStringSetting = (description: string) => TrimmedString.annotate({ description }); export const ClientSettingsSchema = Schema.Struct({ confirmThreadArchive: Schema.Boolean.annotate({