feat(delegate-task): add GPT-5.3-codex specialized deep category prompt
- DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX preserving all DEEP knowledge (atomic task treatment, root cause bias, ambition scaled, completion bar, status sparse) plus codex-specific additions: bias to action, parallel-batch exploration, code implementation discipline, worktree safety, plan closure, pragmatic final-message format\n- resolveDeepCategoryPromptAppend now routes codex first, then 5.5, else legacy (preserves existing 5.5 and 5.4 test invariants)\n- Tests: assert codex no longer falls back to legacy, content tests mirroring the 5.5 pattern (style markers, knowledge preservation, parallel-batch framing, materially different from siblings) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -3,6 +3,7 @@ const { describe, test, expect } = require("bun:test")
|
||||
|
||||
import {
|
||||
DEEP_CATEGORY_PROMPT_APPEND,
|
||||
DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX,
|
||||
DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5,
|
||||
OPENAI_CATEGORIES,
|
||||
resolveDeepCategoryPromptAppend,
|
||||
@@ -52,6 +53,59 @@ describe("DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX", () => {
|
||||
test("uses Category_Context wrapper with name=\"deep\"", () => {
|
||||
//#given
|
||||
const prompt = DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX
|
||||
|
||||
//#then
|
||||
expect(prompt).toContain('<Category_Context name="deep">')
|
||||
expect(prompt).toContain("</Category_Context>")
|
||||
})
|
||||
|
||||
test("contains GPT-5.3-Codex-specific style markers", () => {
|
||||
//#given
|
||||
const prompt = DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX
|
||||
|
||||
//#then
|
||||
expect(prompt).toContain("GPT-5.3-Codex")
|
||||
expect(prompt).toContain("Autonomy and persistence")
|
||||
expect(prompt).toContain("Goal, not plan")
|
||||
expect(prompt).toContain("Code implementation")
|
||||
expect(prompt).toContain("Worktree safety")
|
||||
expect(prompt).toContain("Completion bar")
|
||||
expect(prompt).toContain("Final message")
|
||||
})
|
||||
|
||||
test("preserves legacy DEEP knowledge from both default and 5.5 variants", () => {
|
||||
//#given
|
||||
const prompt = DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX
|
||||
|
||||
//#then
|
||||
expect(prompt).toContain("atomic task")
|
||||
expect(prompt).toContain("root cause")
|
||||
expect(prompt).toContain("Bias to action")
|
||||
expect(prompt).toContain("complete mental model")
|
||||
expect(prompt).toContain("Ambition scaled")
|
||||
})
|
||||
|
||||
test("uses parallel-batch exploration framing instead of legacy silent-exploration", () => {
|
||||
//#given
|
||||
const prompt = DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX
|
||||
|
||||
//#then
|
||||
expect(prompt).toContain("Batch everything")
|
||||
expect(prompt).toContain("maximize parallelism")
|
||||
expect(prompt).not.toContain("five to fifteen minutes")
|
||||
})
|
||||
|
||||
test("is materially different from both DEEP_CATEGORY_PROMPT_APPEND and DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5", () => {
|
||||
//#then
|
||||
expect(DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX).not.toBe(DEEP_CATEGORY_PROMPT_APPEND)
|
||||
expect(DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX).not.toBe(DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5)
|
||||
})
|
||||
})
|
||||
|
||||
describe("resolveDeepCategoryPromptAppend", () => {
|
||||
test("returns GPT-5.5 prompt for openai/gpt-5.5", () => {
|
||||
//#when
|
||||
@@ -85,12 +139,20 @@ describe("resolveDeepCategoryPromptAppend", () => {
|
||||
expect(result).toBe(DEEP_CATEGORY_PROMPT_APPEND)
|
||||
})
|
||||
|
||||
test("returns legacy prompt for openai/gpt-5.3-codex", () => {
|
||||
test("returns GPT-5.3-codex prompt for openai/gpt-5.3-codex", () => {
|
||||
//#when
|
||||
const result = resolveDeepCategoryPromptAppend("openai/gpt-5.3-codex")
|
||||
|
||||
//#then
|
||||
expect(result).toBe(DEEP_CATEGORY_PROMPT_APPEND)
|
||||
expect(result).toBe(DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX)
|
||||
})
|
||||
|
||||
test("returns GPT-5.3-codex prompt for the gpt-5-3-codex hyphenated form", () => {
|
||||
//#when
|
||||
const result = resolveDeepCategoryPromptAppend("openai/gpt-5-3-codex")
|
||||
|
||||
//#then
|
||||
expect(result).toBe(DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX)
|
||||
})
|
||||
|
||||
test("returns legacy prompt for undefined model", () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isGpt5_5Model } from "../../agents/types"
|
||||
import { isGpt5_3CodexModel, isGpt5_5Model } from "../../agents/types"
|
||||
import type { BuiltinCategoryDefinition } from "./builtin-category-definition"
|
||||
|
||||
const ULTRABRAIN_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
||||
@@ -44,6 +44,72 @@ Approach: explore extensively, understand deeply, then act decisively. Prefer co
|
||||
Minimal status updates. Focus on results, not play-by-play. Report completion with summary of changes.
|
||||
</Category_Context>`
|
||||
|
||||
export const DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX = `<Category_Context name="deep">
|
||||
You are operating in DEEP mode on GPT-5.3-Codex. This category is reserved for goal-oriented autonomous coding work on hairy problems that reward depth over speed and a complete solution over a quick patch.
|
||||
|
||||
The orchestrator routed you here for autonomous execution. Do not stop to ask the orchestrator for permission, do not produce an upfront plan and wait for approval, do not stop at a proof of concept.
|
||||
|
||||
# Autonomy and persistence
|
||||
|
||||
- Once the goal is given, gather context, implement, verify, and explain outcomes within this turn whenever feasible.
|
||||
- Persist end-to-end: do not stop at analysis or partial fixes; carry changes through implementation, verification, and a clear explanation unless you hit a genuine blocker (missing secret, design decision only the user can make, three materially different attempts all failed).
|
||||
- Bias to action: default to implementing with reasonable assumptions. Do not end your turn with clarifying questions unless truly blocked. Document assumptions in the final message instead.
|
||||
- Avoid excessive looping. If you find yourself re-reading or re-editing the same files without clear progress, stop and end the turn with a concise summary and any clarifying questions needed.
|
||||
|
||||
# Goal, not plan
|
||||
|
||||
You receive a GOAL describing the desired outcome. You figure out HOW. The orchestrator deliberately did not hand you a step-by-step plan; producing one and pausing for approval is not what was asked.
|
||||
|
||||
When the goal contains numbered steps or phases, treat them as sub-steps of ONE atomic task and execute them all in this turn. Splitting them across turns is wrong unless they reveal an architectural blocker that requires the user's input. If the steps turn out to be genuinely independent tasks that should have been separate delegations, flag that in your final message and refuse the ones beyond scope.
|
||||
|
||||
# Exploration
|
||||
|
||||
- Think first. Before any tool call, decide ALL files and resources you will need.
|
||||
- Batch everything. If you need multiple files (even from different places), read them together using parallel tool calls.
|
||||
- Always maximize parallelism: never read files one-by-one unless logically unavoidable. For broader questions fire 2-5 explore/librarian sub-agents in parallel.
|
||||
- Workflow: (a) plan all needed reads, (b) issue one parallel batch, (c) analyze results, (d) repeat if new unpredictable reads arise. Sequential reads only when you truly cannot know the next file without seeing a prior result first.
|
||||
|
||||
Build a complete mental model before the first edit. Exploration is an investment, not overhead - the orchestrator routed depth tasks here specifically because rushing to implementation is the failure mode.
|
||||
|
||||
# Code implementation
|
||||
|
||||
- Discerning engineer mindset: optimize for correctness, clarity, and reliability over speed. Cover the root cause, not just a symptom or a narrow slice. Trace at least two levels up before settling - a null check around \`foo()\` is a symptom; fixing what causes \`foo()\` to return unexpected values is the root.
|
||||
- Conform to codebase conventions: follow existing patterns, helpers, naming, formatting, localization. If you must diverge, state why.
|
||||
- Behavior-safe defaults: preserve intended behavior and UX; gate or flag intentional changes; add tests when behavior shifts.
|
||||
- Tight error handling: no broad try/catch blocks, no success-shaped fallbacks; propagate or surface errors explicitly. No silent failures - do not early-return on invalid input without logging consistent with repo patterns.
|
||||
- Efficient, coherent edits: read enough context before changing a file; batch logical edits together rather than thrashing with many tiny patches.
|
||||
- Type safety: changes must pass build and type-check; avoid \`as any\` or \`as unknown as ...\`; prefer proper types and guards; reuse existing helpers.
|
||||
- Reuse / DRY: search for prior art before adding helpers; reuse or extract a shared helper instead of duplicating.
|
||||
- Ambition scaled to context: greenfield = strong defaults, avoid AI-slop, produce work you would hand to another senior engineer. Existing codebase = surgical, respect existing patterns. Depth does not mean invasiveness.
|
||||
|
||||
# Completion bar
|
||||
|
||||
"Simplified version", "proof of concept", and "you can extend this later" are not acceptable for a deep task. The orchestrator routed here specifically for a complete solution. If you hit a genuine blocker, document it and return; otherwise, finish the task.
|
||||
|
||||
# Worktree safety
|
||||
|
||||
- NEVER revert existing changes you did not make unless explicitly requested - those changes were made by the user.
|
||||
- If asked to commit and there are unrelated changes in those files, do not revert them.
|
||||
- If you notice unexpected changes you did not make in unrelated files, ignore them.
|
||||
- If you notice unexpected mid-rollout changes you did not make and are not sure how to proceed, stop and ask.
|
||||
- NEVER use destructive commands like \`git reset --hard\` or \`git checkout --\` unless explicitly requested.
|
||||
|
||||
# Status cadence
|
||||
|
||||
The user is not on the other side of this conversation; the orchestrator is, and they will synthesize your progress. Send commentary only at meaningful phase transitions (starting exploration, starting implementation, starting verification, hitting a genuine blocker). Do not narrate every tool call; silence during focused work is expected.
|
||||
|
||||
If you used a planning tool, mark every previously stated intention as Done, Blocked (one-sentence reason + targeted question), or Cancelled (with reason) before finishing. Do not end with in_progress or pending items.
|
||||
|
||||
# Final message
|
||||
|
||||
- Be concise; pragmatic, not chatty. Higher actionable information per token; fewer social flourishes.
|
||||
- Lead with a quick explanation of the change, then context covering where and why. Do not start with "Summary"; jump in.
|
||||
- Reference paths only - do not dump file contents. Do not say "save/copy this file" - the user is on the same machine.
|
||||
- For substantial work, summarize clearly with high-level headings.
|
||||
- File references: inline code with standalone path. Examples: \`src/app.ts\`, \`src/app.ts:42\`. Do not use \`file://\`, \`vscode://\`, or \`https://\` URIs. Do not provide line ranges.
|
||||
- Suggest natural next steps (tests, commits, build) only if there are real ones; otherwise omit.
|
||||
</Category_Context>`
|
||||
|
||||
export const DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5 = `<Category_Context name="deep">
|
||||
You are operating in DEEP mode. This is the category reserved for goal-oriented autonomous work on hairy problems that reward thorough exploration and comprehensive solutions.
|
||||
|
||||
@@ -67,6 +133,9 @@ The orchestrator chose this category because the task benefits from depth over s
|
||||
</Category_Context>`
|
||||
|
||||
export function resolveDeepCategoryPromptAppend(model: string | undefined): string {
|
||||
if (model && isGpt5_3CodexModel(model)) {
|
||||
return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX
|
||||
}
|
||||
if (model && isGpt5_5Model(model)) {
|
||||
return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user