Skip to content

Commit 50c2797

Browse files
committed
Fix Codex subagent TOML naming and drop model field
1 parent 3f22c3e commit 50c2797

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

cli/src/plugins/CodexCLIOutputPlugin.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ describe('codexCLIOutputPlugin command output', () => {
226226
const declarations = await plugin.declareOutputFiles(writeCtx)
227227
const paths = declarations.map(declaration => declaration.path)
228228

229-
expect(paths).toContain(path.join(workspace, 'project-a', '.codex', 'agents', 'review-helper.toml'))
230-
expect(paths).toContain(path.join(workspace, 'project-b', '.codex', 'agents', 'review-helper.toml'))
231-
expect(paths).not.toContain(path.join(homeDir, '.codex', 'agents', 'review-helper.toml'))
229+
expect(paths).toContain(path.join(workspace, 'project-a', '.codex', 'agents', 'qa-reviewer.toml'))
230+
expect(paths).toContain(path.join(workspace, 'project-b', '.codex', 'agents', 'qa-reviewer.toml'))
231+
expect(paths).not.toContain(path.join(homeDir, '.codex', 'agents', 'qa-reviewer.toml'))
232232

233-
const declaration = declarations.find(item => item.path === path.join(workspace, 'project-a', '.codex', 'agents', 'review-helper.toml'))
233+
const declaration = declarations.find(item => item.path === path.join(workspace, 'project-a', '.codex', 'agents', 'qa-reviewer.toml'))
234234
expect(declaration).toBeDefined()
235235
if (declaration == null) throw new Error('Expected codex subagent declaration')
236236

@@ -242,12 +242,12 @@ describe('codexCLIOutputPlugin command output', () => {
242242
'Review changes carefully.',
243243
'Focus on concrete regressions."""'
244244
].join('\n'))
245-
expect(String(rendered)).toContain('model = "gpt-5.2"')
246245
expect(String(rendered)).toContain('nickname_candidates = ["guard"]')
247246
expect(String(rendered)).toContain('sandbox_mode = "workspace-write"')
248247
expect(String(rendered)).toContain('allowedTools = "shell"')
249248
expect(String(rendered)).toContain('[mcp_servers]')
250249
expect(String(rendered)).toContain('[mcp_servers.docs]')
250+
expect(String(rendered)).not.toContain('model = ')
251251
expect(String(rendered)).not.toContain('scope = ')
252252
expect(String(rendered)).not.toContain('allowTools')
253253
expect(String(rendered)).not.toContain('color = ')
@@ -262,10 +262,10 @@ describe('codexCLIOutputPlugin command output', () => {
262262
const declarations = await plugin.declareOutputFiles(writeCtx)
263263

264264
expect(declarations.map(declaration => declaration.path)).toContain(
265-
path.join(workspace, 'project-a', '.codex', 'agents', 'review-helper.toml')
265+
path.join(workspace, 'project-a', '.codex', 'agents', 'qa-reviewer.toml')
266266
)
267267
expect(declarations.map(declaration => declaration.path)).not.toContain(
268-
path.join(homeDir, '.codex', 'agents', 'review-helper.toml')
268+
path.join(homeDir, '.codex', 'agents', 'qa-reviewer.toml')
269269
)
270270
expect(declarations.every(declaration => declaration.scope === 'project')).toBe(true)
271271
})

cli/src/plugins/CodexCLIOutputPlugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const GLOBAL_CONFIG_DIR = '.codex'
66
const PROMPTS_SUBDIR = 'prompts'
77
const AGENTS_SUBDIR = 'agents'
88
const CODEX_SUBAGENT_FIELD_ORDER = ['name', 'description', 'developer_instructions'] as const
9-
const CODEX_EXCLUDED_SUBAGENT_FIELDS = ['scope', 'seriName', 'argumentHint', 'color', 'namingCase'] as const
9+
const CODEX_EXCLUDED_SUBAGENT_FIELDS = ['scope', 'seriName', 'argumentHint', 'color', 'namingCase', 'model'] as const
1010

1111
function transformCodexSubAgentFrontMatter(
1212
sourceFrontMatter?: Record<string, unknown>
@@ -38,7 +38,6 @@ const CODEX_OUTPUT_OPTIONS = {
3838
ext: '.toml',
3939
artifactFormat: 'toml',
4040
bodyFieldName: 'developer_instructions',
41-
fileNameSource: 'frontMatterName',
4241
excludedFrontMatterFields: CODEX_EXCLUDED_SUBAGENT_FIELDS,
4342
transformFrontMatter: (_subAgent, context) => transformCodexSubAgentFrontMatter(context.sourceFrontMatter),
4443
fieldOrder: CODEX_SUBAGENT_FIELD_ORDER

0 commit comments

Comments
 (0)