authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:29:40-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:29:40-07:00
logdf370c31d26afc72ace55263e746ba4386dada25
tree319c3a3e1b4cd0af1cb6365249468b3311070db0
parent6615d3d70ba399c4b274d17f19487d94afac17ed
signature Signed by PGP key B5690EEEBB952194

test(server): exercise Codex prompts through public assembly (#10045)


2 files changed, 11 insertions(+), 18 deletions(-)

apps/server/src/provider/CodexDeveloperInstructions.ts+2-2
......@@ -22,7 +22,7 @@ Do not switch to global browser skills, Chrome, Node REPL browser automation, st
2222const browserToolInstructions = (browserToolsAvailable: boolean): string =>
2323 browserToolsAvailable ? T3_CODE_BROWSER_TOOL_INSTRUCTIONS : "";
2424
25export const codexPlanModeDeveloperInstructions = (
25const codexPlanModeDeveloperInstructions = (
2626 browserToolsAvailable: boolean,
2727): string => `<collaboration_mode># Plan Mode (Conversational)
2828
......@@ -155,7 +155,7 @@ If the user stays in Plan mode and asks for revisions after a prior \`<proposed_
155155${browserToolInstructions(browserToolsAvailable)}
156156</collaboration_mode>`;
157157
158export const codexDefaultModeDeveloperInstructions = (
158const codexDefaultModeDeveloperInstructions = (
159159 browserToolsAvailable: boolean,
160160): string => `<collaboration_mode># Collaboration Mode: Default
161161
apps/server/src/provider/Layers/CodexSessionRuntime.test.ts+9-16
......@@ -9,11 +9,7 @@ import * as CodexErrors from "effect-codex-app-server/errors";
99import * as CodexRpc from "effect-codex-app-server/rpc";
1010import * as EffectCodexSchema from "effect-codex-app-server/schema";
1111
12import {
13 buildCodexDeveloperInstructions,
14 codexDefaultModeDeveloperInstructions,
15 codexPlanModeDeveloperInstructions,
16} from "../CodexDeveloperInstructions.ts";
12import { buildCodexDeveloperInstructions } from "../CodexDeveloperInstructions.ts";
1713import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts";
1814import {
1915 buildTurnStartParams,
......@@ -459,7 +455,7 @@ describe("buildCodexDeveloperInstructions", () => {
459455 reasoningEffort: "high",
460456 });
461457
462 NodeAssert.ok(instructions.startsWith(codexDefaultModeDeveloperInstructions(true)));
458 NodeAssert.match(instructions, /^<collaboration_mode># Collaboration Mode: Default/);
463459 NodeAssert.match(instructions, /T3 Code/);
464460 NodeAssert.match(instructions, /Codex harness/);
465461 NodeAssert.match(instructions, /as gpt-5\.3-codex with high reasoning effort/);
......@@ -484,7 +480,7 @@ describe("buildCodexDeveloperInstructions", () => {
484480 reasoningEffort: "medium",
485481 });
486482
487 NodeAssert.ok(instructions.startsWith(codexPlanModeDeveloperInstructions(true)));
483 NodeAssert.match(instructions, /^<collaboration_mode># Plan Mode/);
488484 NodeAssert.match(instructions, /as gpt-5\.3-codex with medium reasoning effort/);
489485 });
490486
......@@ -513,11 +509,11 @@ describe("buildCodexDeveloperInstructions", () => {
513509});
514510
515511describe("T3 browser developer instructions", () => {
512 const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" };
513
516514 it("prefers the product-native preview tools in both collaboration modes", () => {
517 for (const instructions of [
518 codexDefaultModeDeveloperInstructions(true),
519 codexPlanModeDeveloperInstructions(true),
520 ]) {
515 for (const mode of ["default", "plan"] as const) {
516 const instructions = buildCodexDeveloperInstructions(mode, runtime, true);
521517 NodeAssert.match(instructions, /t3-code/);
522518 NodeAssert.match(instructions, /preview_status/);
523519 NodeAssert.match(instructions, /preview_open/);
......@@ -526,10 +522,8 @@ describe("T3 browser developer instructions", () => {
526522 });
527523
528524 it("omits the browser block entirely when the preview tools are not attached", () => {
529 for (const instructions of [
530 codexDefaultModeDeveloperInstructions(false),
531 codexPlanModeDeveloperInstructions(false),
532 ]) {
525 for (const mode of ["default", "plan"] as const) {
526 const instructions = buildCodexDeveloperInstructions(mode, runtime, false);
533527 NodeAssert.doesNotMatch(instructions, /preview_status/);
534528 NodeAssert.doesNotMatch(instructions, /preview_open/);
535529 NodeAssert.doesNotMatch(instructions, /T3 Code collaborative browser/);
......@@ -543,7 +537,6 @@ describe("T3 browser developer instructions", () => {
543537 });
544538
545539 it("tracks the turn's MCP configuration rather than defaulting to on", () => {
546 const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" };
547540 NodeAssert.match(buildCodexDeveloperInstructions("default", runtime, true), /preview_open/);
548541 NodeAssert.doesNotMatch(
549542 buildCodexDeveloperInstructions("default", runtime, false),