authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-01 23:11:44-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-01 23:11:44-08:00
log5ca9b54d6627e23ab9d3d4d14888770e9264a933
treef74b0ce866685cb6e9e7efa2d484248eb774cf3e
parent4ab5fca4ca9d8fb12b1442ed46107e15c4275bf2

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

2 files changed, 21 insertions(+), 12 deletions(-)

apps/server/src/git/Layers/CodexTextGeneration.ts+12-1
...@@ -19,6 +19,17 @@ const CODEX_MODEL = "gpt-5.3-codex";...@@ -19,6 +19,17 @@ const CODEX_MODEL = "gpt-5.3-codex";
19const CODEX_REASONING_EFFORT = "low";19const CODEX_REASONING_EFFORT = "low";
20const CODEX_TIMEOUT_MS = 180_000;20const CODEX_TIMEOUT_MS = 180_000;
2121
22function toCodexOutputJsonSchema(schema: Schema.Top): unknown {
23 const document = Schema.toJsonSchemaDocument(schema);
24 if (document.definitions && Object.keys(document.definitions).length > 0) {
25 return {
26 ...document.schema,
27 $defs: document.definitions,
28 };
29 }
30 return document.schema;
31}
32
22function normalizeCodexError(33function normalizeCodexError(
23 operation: string,34 operation: string,
24 error: unknown,35 error: unknown,
...@@ -204,7 +215,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {...@@ -204,7 +215,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
204 const schemaPath = yield* writeTempFile(215 const schemaPath = yield* writeTempFile(
205 operation,216 operation,
206 "codex-schema",217 "codex-schema",
207 JSON.stringify(Schema.toJsonSchemaDocument(outputSchemaJson).schema),218 JSON.stringify(toCodexOutputJsonSchema(outputSchemaJson)),
208 );219 );
209 const outputPath = yield* writeTempFile(operation, "codex-output", "");220 const outputPath = yield* writeTempFile(operation, "codex-output", "");
210221
apps/web/src/components/Sidebar.tsx+9-11
...@@ -171,7 +171,7 @@ function T3Wordmark() {...@@ -171,7 +171,7 @@ function T3Wordmark() {
171 return (171 return (
172 <svg172 <svg
173 aria-label="T3"173 aria-label="T3"
174 className="h-3 w-auto shrink-0 text-foreground"174 className="h-2.5 w-auto shrink-0 text-foreground"
175 viewBox="15.5309 37 94.3941 56.96"175 viewBox="15.5309 37 94.3941 56.96"
176 xmlns="http://www.w3.org/2000/svg"176 xmlns="http://www.w3.org/2000/svg"
177 >177 >
...@@ -312,7 +312,7 @@ export default function Sidebar() {...@@ -312,7 +312,7 @@ export default function Sidebar() {
312 const status = target.cwd ? statusByCwd.get(target.cwd) : undefined;312 const status = target.cwd ? statusByCwd.get(target.cwd) : undefined;
313 const branchMatches =313 const branchMatches =
314 target.branch !== null && status?.branch !== null && status?.branch === target.branch;314 target.branch !== null && status?.branch !== null && status?.branch === target.branch;
315 map.set(target.threadId, branchMatches ? status?.pr ?? null : null);315 map.set(target.threadId, branchMatches ? (status?.pr ?? null) : null);
316 }316 }
317 return map;317 return map;
318 }, [threadGitStatusCwds, threadGitStatusQueries, threadGitTargets]);318 }, [threadGitStatusCwds, threadGitStatusQueries, threadGitTargets]);
...@@ -689,9 +689,7 @@ export default function Sidebar() {...@@ -689,9 +689,7 @@ export default function Sidebar() {
689 void handleNewThread(projectId, {689 void handleNewThread(projectId, {
690 branch: activeThread?.branch ?? activeDraftThread?.branch ?? null,690 branch: activeThread?.branch ?? activeDraftThread?.branch ?? null,
691 worktreePath: activeThread?.worktreePath ?? activeDraftThread?.worktreePath ?? null,691 worktreePath: activeThread?.worktreePath ?? activeDraftThread?.worktreePath ?? null,
692 envMode:692 envMode: activeDraftThread?.envMode ?? (activeThread?.worktreePath ? "worktree" : "local"),
693 activeDraftThread?.envMode ??
694 (activeThread?.worktreePath ? "worktree" : "local"),
695 });693 });
696 };694 };
697695
...@@ -711,14 +709,14 @@ export default function Sidebar() {...@@ -711,14 +709,14 @@ export default function Sidebar() {
711 };709 };
712710
713 const wordmark = (711 const wordmark = (
714 <div className={`flex items-center gap-2 ${isElectron ? "-translate-y-px" : ""}`}>712 <div className="flex items-center gap-2">
715 <SidebarTrigger className="shrink-0 md:hidden" />713 <SidebarTrigger className="shrink-0 md:hidden" />
716 <div className="flex min-w-0 flex-1 items-center gap-1">714 <div className="flex min-w-0 flex-1 items-center gap-1 mt-2 ml-1">
717 <T3Wordmark />715 <T3Wordmark />
718 <span className="truncate text-base font-medium tracking-tight text-muted-foreground">716 <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">
719 Code717 Code
720 </span>718 </span>
721 <span className="rounded-full bg-muted/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-widest text-muted-foreground/60">719 <span className="rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground/60">
722 {APP_STAGE_LABEL}720 {APP_STAGE_LABEL}
723 </span>721 </span>
724 </div>722 </div>
...@@ -740,10 +738,10 @@ export default function Sidebar() {...@@ -740,10 +738,10 @@ export default function Sidebar() {
740 <>738 <>
741 {isElectron ? (739 {isElectron ? (
742 <>740 <>
743 <SidebarHeader className="drag-region h-[52px] flex-row items-center gap-2 px-4 py-0 pl-[88px]">741 <SidebarHeader className="drag-region h-[52px] flex-row items-center gap-2 px-4 py-0 pl-[82px]">
744 {wordmark}742 {wordmark}
745 </SidebarHeader>743 </SidebarHeader>
746 <div className="px-4 pb-2">{newThreadButton}</div>744 <div className="px-4 py-2">{newThreadButton}</div>
747 </>745 </>
748 ) : (746 ) : (
749 <SidebarHeader className="gap-3 px-3 py-2 sm:gap-2.5 sm:px-4 sm:py-3">747 <SidebarHeader className="gap-3 px-3 py-2 sm:gap-2.5 sm:px-4 sm:py-3">