GeezerVison is showing github.com — Feature: add queued and steered messages · henrik092/t3code@5447dbf
This repository was archived by the owner on Nov 2, 2026. It is now read-only.
File treeExpand file treeCollapse file tree Open diff view settings server/src/provider/Layers
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/CodexProvider.ts +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -76,10 +76,10 @@ const LOCAL_CODEX_MODELS: ReadonlyArray<ServerProviderModel> = [ | 76 | 76 | label: "Reasoning", | 77 | 77 | type: "select", | 78 | 78 | options: [ | 79 | | - { id: "low", label: REASONING_EFFORT_LABELS.low }, | 80 | | - { id: "medium", label: REASONING_EFFORT_LABELS.medium, isDefault: true }, | 81 | | - { id: "high", label: REASONING_EFFORT_LABELS.high }, | 82 | | - { id: "xhigh", label: REASONING_EFFORT_LABELS.xhigh }, | | 79 | + { id: "low", label: reasoningEffortLabel("low") }, | | 80 | + { id: "medium", label: reasoningEffortLabel("medium"), isDefault: true }, | | 81 | + { id: "high", label: reasoningEffortLabel("high") }, | | 82 | + { id: "xhigh", label: reasoningEffortLabel("xhigh") }, | 83 | 83 | ], | 84 | 84 | currentValue: "medium", | 85 | 85 | }, | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/CodexSessionRuntime.test.ts +19Lines changed: 19 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ import { | 13 | 13 | CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS, | 14 | 14 | } from "../CodexDeveloperInstructions.ts"; | 15 | 15 | import { | | 16 | + buildTurnSteerInput, | 16 | 17 | buildTurnStartParams, | 17 | 18 | hasConfiguredMcpServer, | 18 | 19 | isRecoverableThreadResumeError, | @@ -194,6 +195,24 @@ describe("buildTurnStartParams", () => { | 194 | 195 | }); | 195 | 196 | }); | 196 | 197 |
| | 198 | +describe("buildTurnSteerInput", () => { | | 199 | + it("maps text and image input without turn-start-only settings", () => { | | 200 | + NodeAssert.deepStrictEqual( | | 201 | + buildTurnSteerInput({ | | 202 | + input: "Adjust the current task", | | 203 | + attachments: [{ type: "image", url: "data:image/png;base64,abc" }], | | 204 | + model: "gpt-5.4", | | 205 | + effort: "high", | | 206 | + interactionMode: "default", | | 207 | + }), | | 208 | + [ | | 209 | + { type: "text", text: "Adjust the current task" }, | | 210 | + { type: "image", url: "data:image/png;base64,abc" }, | | 211 | + ], | | 212 | + ); | | 213 | + }); | | 214 | +}); | | 215 | + | 197 | 216 | describe("T3 browser developer instructions", () => { | 198 | 217 | it("prefers the product-native preview tools in both collaboration modes", () => { | 199 | 218 | for (const instructions of [ | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/CodexSessionRuntime.ts +35-3Lines changed: 35 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -398,6 +398,22 @@ export function buildTurnStartParams(input: { | 398 | 398 | ); | 399 | 399 | } | 400 | 400 |
| | 401 | +export function buildTurnSteerInput( | | 402 | + input: CodexSessionRuntimeSendTurnInput, | | 403 | +): ReadonlyArray<EffectCodexSchema.V2TurnSteerParams__UserInput> { | | 404 | + const turnInput: Array<EffectCodexSchema.V2TurnSteerParams__UserInput> = []; | | 405 | + if (input.input) { | | 406 | + turnInput.push({ | | 407 | + type: "text", | | 408 | + text: input.input, | | 409 | + }); | | 410 | + } | | 411 | + for (const attachment of input.attachments ?? []) { | | 412 | + turnInput.push(attachment); | | 413 | + } | | 414 | + return turnInput; | | 415 | +} | | 416 | + | 401 | 417 | function classifyCodexStderrLine(rawLine: string): { readonly message: string } | null { | 402 | 418 | const line = rawLine.replaceAll(ANSI_ESCAPE_REGEX, "").trim(); | 403 | 419 | if (!line) { | @@ -1265,6 +1281,7 @@ export const makeCodexSessionRuntime = ( | 1265 | 1281 | sendTurn: (input) => | 1266 | 1282 | Effect.gen(function* () { | 1267 | 1283 | const providerThreadId = yield* readProviderThreadId; | | 1284 | + const currentSession = yield* Ref.get(sessionRef); | 1268 | 1285 | if (hasConfiguredMcpServer(options.appServerArgs)) { | 1269 | 1286 | yield* client.request("config/mcpServer/reload", undefined).pipe( | 1270 | 1287 | Effect.catch((cause) => | @@ -1274,9 +1291,24 @@ export const makeCodexSessionRuntime = ( | 1274 | 1291 | ), | 1275 | 1292 | ); | 1276 | 1293 | } | 1277 | | - const normalizedModel = normalizeCodexModelSlug( | 1278 | | - input.model ?? (yield* Ref.get(sessionRef)).model, | 1279 | | - ); | | 1294 | + if (currentSession.status === "running" && currentSession.activeTurnId) { | | 1295 | + const response = yield* client.request("turn/steer", { | | 1296 | + threadId: providerThreadId, | | 1297 | + expectedTurnId: currentSession.activeTurnId, | | 1298 | + input: buildTurnSteerInput(input), | | 1299 | + }); | | 1300 | + const turnId = TurnId.make(response.turnId); | | 1301 | + yield* updateSession(sessionRef, { | | 1302 | + status: "running", | | 1303 | + activeTurnId: turnId, | | 1304 | + }); | | 1305 | + return { | | 1306 | + threadId: options.threadId, | | 1307 | + turnId, | | 1308 | + resumeCursor: { threadId: providerThreadId }, | | 1309 | + } satisfies ProviderTurnStartResult; | | 1310 | + } | | 1311 | + const normalizedModel = normalizeCodexModelSlug(input.model ?? currentSession.model); | 1280 | 1312 | const params = yield* buildTurnStartParams({ | 1281 | 1313 | threadId: providerThreadId, | 1282 | 1314 | runtimeMode: options.runtimeMode, | |
|