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.
This commit is contained in:
Cursor Agent committed 2026-03-30 22:43:57 +00:00
1 parent aeaf31ff6d
commit 1b6e8ab339
1 file changed
+1 -4
+1 -4
View File
@@ -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({