Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ it.effect.each(["opt-in desktop restart", "marked remote update"] as const)(
const activeTurnId = TurnId.make("turn-started-after-original-send");
const originalTurnId = TurnId.make("turn-from-original-send");
const sent = yield* Deferred.make<ProviderSendTurnInput>();
const modelSelection = {
instanceId: providerInstanceId,
model: "gpt-5",
options: [{ id: "reasoningEffort", value: "high" }],
};

yield* Effect.gen(function* () {
const engine = yield* OrchestrationEngine.OrchestrationEngineService;
Expand All @@ -384,7 +389,7 @@ it.effect.each(["opt-in desktop restart", "marked remote update"] as const)(
projectId,
title: "Restart continuation",
workspaceRoot: "/tmp/startup-orphan-project",
defaultModelSelection: { instanceId: providerInstanceId, model: "gpt-5" },
defaultModelSelection: modelSelection,
createdAt,
});
yield* engine.dispatch({
Expand All @@ -393,7 +398,7 @@ it.effect.each(["opt-in desktop restart", "marked remote update"] as const)(
threadId,
projectId,
title: "Newer running turn",
modelSelection: { instanceId: providerInstanceId, model: "gpt-5" },
modelSelection,
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
runtimeMode: "full-access",
branch: null,
Expand Down Expand Up @@ -469,6 +474,7 @@ it.effect.each(["opt-in desktop restart", "marked remote update"] as const)(
assert.deepStrictEqual(yield* Deferred.await(sent), {
threadId,
continuation: true,
modelSelection,
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
});
}).pipe(
Expand Down
20 changes: 20 additions & 0 deletions apps/server/src/provider/Layers/CodexSessionRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ describe("buildTurnStartParams", () => {
});
});

it.effect("preserves a non-default reasoning effort in collaboration mode", () =>
Effect.gen(function* () {
const params = yield* buildTurnStartParams({
threadId: "provider-thread-1",
runtimeMode: "full-access",
prompt: "Continue the task",
model: "gpt-5.3-codex",
effort: "high",
interactionMode: "default",
});

NodeAssert.equal(params.effort, "high");
NodeAssert.equal(params.collaborationMode?.settings.reasoning_effort, "high");
NodeAssert.match(
params.collaborationMode?.settings.developer_instructions ?? "",
/with high reasoning effort/,
);
}),
);

it("reports the same fallback model and effort in settings and instructions", () => {
const params = Effect.runSync(
buildTurnStartParams({
Expand Down
20 changes: 18 additions & 2 deletions apps/server/src/serverRuntimeStartup.reconcile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const makeThread = (
id: ThreadId.make(id),
archivedAt,
deletedAt,
modelSelection: {
instanceId: providerInstanceId,
model: "gpt-5.3-codex",
options: [{ id: "reasoningEffort", value: "high" }],
},
interactionMode: "default" as const,
session: {
threadId: ThreadId.make(id),
Expand Down Expand Up @@ -304,10 +309,16 @@ it.effect.each(
String(left.threadId).localeCompare(String(right.threadId)),
),
[
{ threadId: codex.id, continuation: true, interactionMode: "default" },
{
threadId: codex.id,
continuation: true,
modelSelection: codex.modelSelection,
interactionMode: "default",
},
{
threadId: fallback.id,
input: "Continue where you left off.",
modelSelection: fallback.modelSelection,
interactionMode: "default",
},
],
Expand Down Expand Up @@ -906,7 +917,12 @@ for (const preparedStatus of [
yield* runReconciliation(input);
yield* Deferred.await(cleared);
assert.deepStrictEqual(sends, [
{ threadId: thread.id, continuation: true, interactionMode: "default" },
{
threadId: thread.id,
continuation: true,
modelSelection: thread.modelSelection,
interactionMode: "default",
},
]);
assert.deepStrictEqual(binding.runtimePayload, {
activeTurnId: null,
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/serverRuntimeStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ export const reconcileProviderSessions = Effect.gen(function* () {
...(capabilities.promptlessTurnContinuation === true
? { continuation: true }
: { input: SERVER_UPDATE_CONTINUATION_PROMPT }),
modelSelection: thread.modelSelection,
interactionMode: thread.interactionMode,
});
});
Expand Down
Loading