| ... | @@ -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"; |
| 9 | import * as CodexRpc from "effect-codex-app-server/rpc"; | 9 | import * as CodexRpc from "effect-codex-app-server/rpc"; |
| 10 | import * as EffectCodexSchema from "effect-codex-app-server/schema"; | 10 | import * as EffectCodexSchema from "effect-codex-app-server/schema"; |
| 11 | | 11 | |
| 12 | import { | 12 | import { buildCodexDeveloperInstructions } from "../CodexDeveloperInstructions.ts"; |
| 13 | buildCodexDeveloperInstructions, | | |
| 14 | codexDefaultModeDeveloperInstructions, | | |
| 15 | codexPlanModeDeveloperInstructions, | | |
| 16 | } from "../CodexDeveloperInstructions.ts"; | | |
| 17 | import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts"; | 13 | import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts"; |
| 18 | import { | 14 | import { |
| 19 | buildTurnStartParams, | 15 | buildTurnStartParams, |
| ... | @@ -459,7 +455,7 @@ describe("buildCodexDeveloperInstructions", () => { | ... | @@ -459,7 +455,7 @@ describe("buildCodexDeveloperInstructions", () => { |
| 459 | reasoningEffort: "high", | 455 | reasoningEffort: "high", |
| 460 | }); | 456 | }); |
| 461 | | 457 | |
| 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 | }); |
| 486 | | 482 | |
| 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 | }); |
| 490 | | 486 | |
| ... | @@ -513,11 +509,11 @@ describe("buildCodexDeveloperInstructions", () => { | ... | @@ -513,11 +509,11 @@ describe("buildCodexDeveloperInstructions", () => { |
| 513 | }); | 509 | }); |
| 514 | | 510 | |
| 515 | describe("T3 browser developer instructions", () => { | 511 | describe("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 | }); |
| 527 | | 523 | |
| 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 | }); |
| 544 | | 538 | |
| 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), |