From 5ca9b54d6627e23ab9d3d4d14888770e9264a933 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 1 Mar 2026 23:11:44 -0800 Subject: [PATCH] Preserve $defs in Codex output schema and refine sidebar header - include JSON Schema `$defs` when writing Codex output schema files - tighten sidebar wordmark sizing and spacing in Electron/web layouts --- .../src/git/Layers/CodexTextGeneration.ts | 13 +++++++++++- apps/web/src/components/Sidebar.tsx | 20 +++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/apps/server/src/git/Layers/CodexTextGeneration.ts b/apps/server/src/git/Layers/CodexTextGeneration.ts index 064d4da9c8d81c6429046af36447788f0e87c60c..d2450e7a880e3450f38c39a88decc484e0300a37 100644 --- a/apps/server/src/git/Layers/CodexTextGeneration.ts +++ b/apps/server/src/git/Layers/CodexTextGeneration.ts @@ -19,6 +19,17 @@ const CODEX_MODEL = "gpt-5.3-codex"; const CODEX_REASONING_EFFORT = "low"; const CODEX_TIMEOUT_MS = 180_000; +function toCodexOutputJsonSchema(schema: Schema.Top): unknown { + const document = Schema.toJsonSchemaDocument(schema); + if (document.definitions && Object.keys(document.definitions).length > 0) { + return { + ...document.schema, + $defs: document.definitions, + }; + } + return document.schema; +} + function normalizeCodexError( operation: string, error: unknown, @@ -204,7 +215,7 @@ const makeCodexTextGeneration = Effect.gen(function* () { const schemaPath = yield* writeTempFile( operation, "codex-schema", - JSON.stringify(Schema.toJsonSchemaDocument(outputSchemaJson).schema), + JSON.stringify(toCodexOutputJsonSchema(outputSchemaJson)), ); const outputPath = yield* writeTempFile(operation, "codex-output", ""); diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index f6e477417a408991bce4098b8a6d7539dde90d11..b19dff76b512c4b23969b04d4923849b1c1a0f21 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -171,7 +171,7 @@ function T3Wordmark() { return ( @@ -312,7 +312,7 @@ export default function Sidebar() { const status = target.cwd ? statusByCwd.get(target.cwd) : undefined; const branchMatches = target.branch !== null && status?.branch !== null && status?.branch === target.branch; - map.set(target.threadId, branchMatches ? status?.pr ?? null : null); + map.set(target.threadId, branchMatches ? (status?.pr ?? null) : null); } return map; }, [threadGitStatusCwds, threadGitStatusQueries, threadGitTargets]); @@ -689,9 +689,7 @@ export default function Sidebar() { void handleNewThread(projectId, { branch: activeThread?.branch ?? activeDraftThread?.branch ?? null, worktreePath: activeThread?.worktreePath ?? activeDraftThread?.worktreePath ?? null, - envMode: - activeDraftThread?.envMode ?? - (activeThread?.worktreePath ? "worktree" : "local"), + envMode: activeDraftThread?.envMode ?? (activeThread?.worktreePath ? "worktree" : "local"), }); }; @@ -711,14 +709,14 @@ export default function Sidebar() { }; const wordmark = ( -
+
-
+
- + Code - + {APP_STAGE_LABEL}
@@ -740,10 +738,10 @@ export default function Sidebar() { <> {isElectron ? ( <> - + {wordmark} -
{newThreadButton}
+
{newThreadButton}
) : ( -- 2.54.0