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";
1919const CODEX_REASONING_EFFORT = "low";
2020const 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
2233function normalizeCodexError(
2334 operation: string,
2435 error: unknown,
......@@ -204,7 +215,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
204215 const schemaPath = yield* writeTempFile(
205216 operation,
206217 "codex-schema",
207 JSON.stringify(Schema.toJsonSchemaDocument(outputSchemaJson).schema),
218 JSON.stringify(toCodexOutputJsonSchema(outputSchemaJson)),
208219 );
209220 const outputPath = yield* writeTempFile(operation, "codex-output", "");
210221
apps/web/src/components/Sidebar.tsx+9-11
......@@ -171,7 +171,7 @@ function T3Wordmark() {
171171 return (
172172 <svg
173173 aria-label="T3"
174 className="h-3 w-auto shrink-0 text-foreground"
174 className="h-2.5 w-auto shrink-0 text-foreground"
175175 viewBox="15.5309 37 94.3941 56.96"
176176 xmlns="http://www.w3.org/2000/svg"
177177 >
......@@ -312,7 +312,7 @@ export default function Sidebar() {
312312 const status = target.cwd ? statusByCwd.get(target.cwd) : undefined;
313313 const branchMatches =
314314 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);
316316 }
317317 return map;
318318 }, [threadGitStatusCwds, threadGitStatusQueries, threadGitTargets]);
......@@ -689,9 +689,7 @@ export default function Sidebar() {
689689 void handleNewThread(projectId, {
690690 branch: activeThread?.branch ?? activeDraftThread?.branch ?? null,
691691 worktreePath: activeThread?.worktreePath ?? activeDraftThread?.worktreePath ?? null,
692 envMode:
693 activeDraftThread?.envMode ??
694 (activeThread?.worktreePath ? "worktree" : "local"),
692 envMode: activeDraftThread?.envMode ?? (activeThread?.worktreePath ? "worktree" : "local"),
695693 });
696694 };
697695
......@@ -711,14 +709,14 @@ export default function Sidebar() {
711709 };
712710
713711 const wordmark = (
714 <div className={`flex items-center gap-2 ${isElectron ? "-translate-y-px" : ""}`}>
712 <div className="flex items-center gap-2">
715713 <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">
717715 <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">
719717 Code
720718 </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">
722720 {APP_STAGE_LABEL}
723721 </span>
724722 </div>
......@@ -740,10 +738,10 @@ export default function Sidebar() {
740738 <>
741739 {isElectron ? (
742740 <>
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]">
744742 {wordmark}
745743 </SidebarHeader>
746 <div className="px-4 pb-2">{newThreadButton}</div>
744 <div className="px-4 py-2">{newThreadButton}</div>
747745 </>
748746 ) : (
749747 <SidebarHeader className="gap-3 px-3 py-2 sm:gap-2.5 sm:px-4 sm:py-3">