@devries-cameron20 / t3code Mirror · read-only / commits / 1327e7bdfb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 23:15 UTC

fix(server): preserve Claude question option previews (#21932)

Julius Marminge committed Oct 19, 2026 at 21:06 UTC 1327e7bdfb454594eb8308961691d1b7419156f3
3 files changed +19 -3
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+9 -2
@@ -302,13 +302,17 @@ describe("ClaudeAdapterV2 runtime query policy", () => {
302 });
303
304 it("projects AskUserQuestion input with question text as the answer key", () => {
305 + const preview = "\n **Proposed change**\n\n```ts\n\tconst enabled = true;\n```\n ";
306 assert.deepEqual(
307 ClaudeAdapterV2.claudeUserInputQuestions({
308 questions: [
309 {
310 header: "Approach",
311 question: "Which approach?",
311 - options: [{ label: "Simple", description: "Use fewer moving parts" }],
312 + options: [
313 + { label: "Simple", description: "Use fewer moving parts", preview },
314 + { label: "Safe", description: "Keep the current setup" },
315 + ],
316 multiSelect: true,
317 },
318 ],
@@ -318,7 +322,10 @@ describe("ClaudeAdapterV2 runtime query policy", () => {
322 id: "Which approach?",
323 header: "Approach",
324 question: "Which approach?",
321 - options: [{ label: "Simple", description: "Use fewer moving parts" }],
325 + options: [
326 + { label: "Simple", description: "Use fewer moving parts", preview },
327 + { label: "Safe", description: "Keep the current setup" },
328 + ],
329 multiSelect: true,
330 },
331 ],
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+9 -1
@@ -3404,7 +3404,15 @@ export function claudeUserInputQuestions(
3404 if (label.length === 0) return [];
3405 const description =
3406 typeof optionRecord.description === "string" ? optionRecord.description.trim() : "";
3407 - return [{ label, description: description || label }];
3407 + return [
3408 + {
3409 + label,
3410 + description: description || label,
3411 + ...(typeof optionRecord.preview === "string"
3412 + ? { preview: optionRecord.preview }
3413 + : {}),
3414 + },
3415 + ];
3416 })
3417 : [];
3418 return [
packages/contracts/src/orchestrationV2.ts
+1
@@ -1132,6 +1132,7 @@ export const OrchestrationV2UserInputQuestion = Schema.Struct({
1132 label: TrimmedNonEmptyString,
1133 description: TrimmedNonEmptyString,
1134 value: Schema.optional(Schema.String),
1135 + preview: Schema.optional(Schema.String),
1136 }),
1137 ),
1138 multiSelect: Schema.optional(Schema.Boolean),