| ... | @@ -257,6 +257,19 @@ Do not ask "should I proceed?" in the final output. The user can easily switch o | ... | @@ -257,6 +257,19 @@ Do not ask "should I proceed?" in the final output. The user can easily switch o |
| 257 | Only produce at most one \`<proposed_plan>\` block per turn, and only when you are presenting a complete spec. | 257 | Only produce at most one \`<proposed_plan>\` block per turn, and only when you are presenting a complete spec. |
| 258 | </collaboration_mode>`; | 258 | </collaboration_mode>`; |
| 259 | | 259 | |
| | 260 | export const CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Collaboration Mode: Default |
| | 261 | |
| | 262 | You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. |
| | 263 | |
| | 264 | Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and Plan. |
| | 265 | |
| | 266 | ## request_user_input availability |
| | 267 | |
| | 268 | The \`request_user_input\` tool is unavailable in Default mode. If you call it while in Default mode, it will return an error. |
| | 269 | |
| | 270 | In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, ask the user directly with a concise plain-text question. Never write a multiple choice question as a textual assistant message. |
| | 271 | </collaboration_mode>`; |
| | 272 | |
| 260 | function mapCodexRuntimeMode(runtimeMode: RuntimeMode): { | 273 | function mapCodexRuntimeMode(runtimeMode: RuntimeMode): { |
| 261 | readonly approvalPolicy: "on-request" | "never"; | 274 | readonly approvalPolicy: "on-request" | "never"; |
| 262 | readonly sandbox: "workspace-write" | "danger-full-access"; | 275 | readonly sandbox: "workspace-write" | "danger-full-access"; |
| ... | @@ -326,7 +339,7 @@ function buildCodexCollaborationMode(input: { | ... | @@ -326,7 +339,7 @@ function buildCodexCollaborationMode(input: { |
| 326 | readonly effort?: string; | 339 | readonly effort?: string; |
| 327 | }): | 340 | }): |
| 328 | | { | 341 | | { |
| 329 | mode: "plan"; | 342 | mode: "default" | "plan"; |
| 330 | settings: { | 343 | settings: { |
| 331 | model: string; | 344 | model: string; |
| 332 | reasoning_effort: string; | 345 | reasoning_effort: string; |
| ... | @@ -334,16 +347,19 @@ function buildCodexCollaborationMode(input: { | ... | @@ -334,16 +347,19 @@ function buildCodexCollaborationMode(input: { |
| 334 | }; | 347 | }; |
| 335 | } | 348 | } |
| 336 | | undefined { | 349 | | undefined { |
| 337 | if (input.interactionMode !== "plan") { | 350 | if (input.interactionMode === undefined) { |
| 338 | return undefined; | 351 | return undefined; |
| 339 | } | 352 | } |
| 340 | const model = normalizeCodexModelSlug(input.model) ?? "gpt-5.3-codex"; | 353 | const model = normalizeCodexModelSlug(input.model) ?? "gpt-5.3-codex"; |
| 341 | return { | 354 | return { |
| 342 | mode: "plan", | 355 | mode: input.interactionMode, |
| 343 | settings: { | 356 | settings: { |
| 344 | model, | 357 | model, |
| 345 | reasoning_effort: input.effort ?? "medium", | 358 | reasoning_effort: input.effort ?? "medium", |
| 346 | developer_instructions: CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS, | 359 | developer_instructions: |
| | 360 | input.interactionMode === "plan" |
| | 361 | ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS |
| | 362 | : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, |
| 347 | }, | 363 | }, |
| 348 | }; | 364 | }; |
| 349 | } | 365 | } |
| ... | @@ -644,7 +660,7 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve | ... | @@ -644,7 +660,7 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve |
| 644 | effort?: string; | 660 | effort?: string; |
| 645 | serviceTier?: string; | 661 | serviceTier?: string; |
| 646 | collaborationMode?: { | 662 | collaborationMode?: { |
| 647 | mode: "plan"; | 663 | mode: "default" | "plan"; |
| 648 | settings: { | 664 | settings: { |
| 649 | model: string; | 665 | model: string; |
| 650 | reasoning_effort: string; | 666 | reasoning_effort: string; |