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...@@ -22,7 +22,7 @@ Do not switch to global browser skills, Chrome, Node REPL browser automation, st
22const browserToolInstructions = (browserToolsAvailable: boolean): string =>22const browserToolInstructions = (browserToolsAvailable: boolean): string =>
23 browserToolsAvailable ? T3_CODE_BROWSER_TOOL_INSTRUCTIONS : "";23 browserToolsAvailable ? T3_CODE_BROWSER_TOOL_INSTRUCTIONS : "";
2424
25export const codexPlanModeDeveloperInstructions = (25const codexPlanModeDeveloperInstructions = (
26 browserToolsAvailable: boolean,26 browserToolsAvailable: boolean,
27): string => `<collaboration_mode># Plan Mode (Conversational)27): 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_...@@ -155,7 +155,7 @@ If the user stays in Plan mode and asks for revisions after a prior \`<proposed_
155${browserToolInstructions(browserToolsAvailable)}155${browserToolInstructions(browserToolsAvailable)}
156</collaboration_mode>`;156</collaboration_mode>`;
157157
158export const codexDefaultModeDeveloperInstructions = (158const codexDefaultModeDeveloperInstructions = (
159 browserToolsAvailable: boolean,159 browserToolsAvailable: boolean,
160): string => `<collaboration_mode># Collaboration Mode: Default160): 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";...@@ -9,11 +9,7 @@ import * as CodexErrors from "effect-codex-app-server/errors";
9import * as CodexRpc from "effect-codex-app-server/rpc";9import * as CodexRpc from "effect-codex-app-server/rpc";
10import * as EffectCodexSchema from "effect-codex-app-server/schema";10import * as EffectCodexSchema from "effect-codex-app-server/schema";
1111
12import {12import { buildCodexDeveloperInstructions } from "../CodexDeveloperInstructions.ts";
13 buildCodexDeveloperInstructions,
14 codexDefaultModeDeveloperInstructions,
15 codexPlanModeDeveloperInstructions,
16} from "../CodexDeveloperInstructions.ts";
17import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts";13import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts";
18import {14import {
19 buildTurnStartParams,15 buildTurnStartParams,
...@@ -459,7 +455,7 @@ describe("buildCodexDeveloperInstructions", () => {...@@ -459,7 +455,7 @@ describe("buildCodexDeveloperInstructions", () => {
459 reasoningEffort: "high",455 reasoningEffort: "high",
460 });456 });
461457
462 NodeAssert.ok(instructions.startsWith(codexDefaultModeDeveloperInstructions(true)));458 NodeAssert.match(instructions, /^<collaboration_mode># Collaboration Mode: Default/);
463 NodeAssert.match(instructions, /T3 Code/);459 NodeAssert.match(instructions, /T3 Code/);
464 NodeAssert.match(instructions, /Codex harness/);460 NodeAssert.match(instructions, /Codex harness/);
465 NodeAssert.match(instructions, /as gpt-5\.3-codex with high reasoning effort/);461 NodeAssert.match(instructions, /as gpt-5\.3-codex with high reasoning effort/);
...@@ -484,7 +480,7 @@ describe("buildCodexDeveloperInstructions", () => {...@@ -484,7 +480,7 @@ describe("buildCodexDeveloperInstructions", () => {
484 reasoningEffort: "medium",480 reasoningEffort: "medium",
485 });481 });
486482
487 NodeAssert.ok(instructions.startsWith(codexPlanModeDeveloperInstructions(true)));483 NodeAssert.match(instructions, /^<collaboration_mode># Plan Mode/);
488 NodeAssert.match(instructions, /as gpt-5\.3-codex with medium reasoning effort/);484 NodeAssert.match(instructions, /as gpt-5\.3-codex with medium reasoning effort/);
489 });485 });
490486
...@@ -513,11 +509,11 @@ describe("buildCodexDeveloperInstructions", () => {...@@ -513,11 +509,11 @@ describe("buildCodexDeveloperInstructions", () => {
513});509});
514510
515describe("T3 browser developer instructions", () => {511describe("T3 browser developer instructions", () => {
512 const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" };
513
516 it("prefers the product-native preview tools in both collaboration modes", () => {514 it("prefers the product-native preview tools in both collaboration modes", () => {
517 for (const instructions of [515 for (const mode of ["default", "plan"] as const) {
518 codexDefaultModeDeveloperInstructions(true),516 const instructions = buildCodexDeveloperInstructions(mode, runtime, true);
519 codexPlanModeDeveloperInstructions(true),
520 ]) {
521 NodeAssert.match(instructions, /t3-code/);517 NodeAssert.match(instructions, /t3-code/);
522 NodeAssert.match(instructions, /preview_status/);518 NodeAssert.match(instructions, /preview_status/);
523 NodeAssert.match(instructions, /preview_open/);519 NodeAssert.match(instructions, /preview_open/);
...@@ -526,10 +522,8 @@ describe("T3 browser developer instructions", () => {...@@ -526,10 +522,8 @@ describe("T3 browser developer instructions", () => {
526 });522 });
527523
528 it("omits the browser block entirely when the preview tools are not attached", () => {524 it("omits the browser block entirely when the preview tools are not attached", () => {
529 for (const instructions of [525 for (const mode of ["default", "plan"] as const) {
530 codexDefaultModeDeveloperInstructions(false),526 const instructions = buildCodexDeveloperInstructions(mode, runtime, false);
531 codexPlanModeDeveloperInstructions(false),
532 ]) {
533 NodeAssert.doesNotMatch(instructions, /preview_status/);527 NodeAssert.doesNotMatch(instructions, /preview_status/);
534 NodeAssert.doesNotMatch(instructions, /preview_open/);528 NodeAssert.doesNotMatch(instructions, /preview_open/);
535 NodeAssert.doesNotMatch(instructions, /T3 Code collaborative browser/);529 NodeAssert.doesNotMatch(instructions, /T3 Code collaborative browser/);
...@@ -543,7 +537,6 @@ describe("T3 browser developer instructions", () => {...@@ -543,7 +537,6 @@ describe("T3 browser developer instructions", () => {
543 });537 });
544538
545 it("tracks the turn's MCP configuration rather than defaulting to on", () => {539 it("tracks the turn's MCP configuration rather than defaulting to on", () => {
546 const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" };
547 NodeAssert.match(buildCodexDeveloperInstructions("default", runtime, true), /preview_open/);540 NodeAssert.match(buildCodexDeveloperInstructions("default", runtime, true), /preview_open/);
548 NodeAssert.doesNotMatch(541 NodeAssert.doesNotMatch(
549 buildCodexDeveloperInstructions("default", runtime, false),542 buildCodexDeveloperInstructions("default", runtime, false),