From 5456ba2fb81272f48b8820cebc54c9cb74403a94 Mon Sep 17 00:00:00 2001 From: Tommaso Casaburi Date: Fri, 10 Jul 2026 14:45:05 +0700 Subject: [PATCH] chore(codex agents): inherit parent model settings --- .codex/agents/browser-check.toml | 2 -- .codex/agents/code-quality.toml | 2 -- .codex/agents/plan-implementer.toml | 2 -- .codex/agents/profiler.toml | 2 -- .codex/agents/react-doctor-fixer.toml | 2 -- .codex/agents/react-patterns-enforcer.toml | 2 -- .codex/agents/test-apk.toml | 2 -- .codex/agents/translator.toml | 2 -- AGENTS.md | 2 +- docs/agent-playbooks/known-surprises.md | 9 +++++---- public/llms-full.txt | 11 ++++++----- scripts/validate-ai-workflow.mjs | 20 +++++++++++++------- 12 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.codex/agents/browser-check.toml b/.codex/agents/browser-check.toml index fdaf02db..d9989b7a 100644 --- a/.codex/agents/browser-check.toml +++ b/.codex/agents/browser-check.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" sandbox_mode = "read-only" developer_instructions = """ Verify only the route, user flow, and acceptance criteria the parent agent gives you. diff --git a/.codex/agents/code-quality.toml b/.codex/agents/code-quality.toml index f64e7d42..1ab044d6 100644 --- a/.codex/agents/code-quality.toml +++ b/.codex/agents/code-quality.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Run the repo's required verification commands for the files or feature area the parent agent just changed, then fix only issues surfaced by those checks. Use this order: yarn build, yarn lint, yarn type-check. Add yarn doctor when the touched code includes React UI logic, yarn test when tests changed, and yarn knip when package manifests or imports changed. diff --git a/.codex/agents/plan-implementer.toml b/.codex/agents/plan-implementer.toml index 6dd5c216..2896eec9 100644 --- a/.codex/agents/plan-implementer.toml +++ b/.codex/agents/plan-implementer.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Implement only the concrete task or task slice assigned by the parent agent. Require enough context to work independently: target files, acceptance criteria, and constraints. Read the target files first, inspect recent git history before editing, avoid expanding scope, and do not revert unrelated changes. diff --git a/.codex/agents/profiler.toml b/.codex/agents/profiler.toml index d2ad05a7..76502940 100644 --- a/.codex/agents/profiler.toml +++ b/.codex/agents/profiler.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" sandbox_mode = "read-only" developer_instructions = """ Profile only the routes or flows the parent agent assigns. diff --git a/.codex/agents/react-doctor-fixer.toml b/.codex/agents/react-doctor-fixer.toml index 36e640ef..03af0337 100644 --- a/.codex/agents/react-doctor-fixer.toml +++ b/.codex/agents/react-doctor-fixer.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Only act when the parent agent provides both the exact React Doctor diagnostic and a concrete fix plan. Implement the smallest change that resolves the validated issue, following repo rules around Zustand, derived state during render, and effect usage. Do not widen the fix beyond the validated diagnostic. diff --git a/.codex/agents/react-patterns-enforcer.toml b/.codex/agents/react-patterns-enforcer.toml index 095f5025..58a46878 100644 --- a/.codex/agents/react-patterns-enforcer.toml +++ b/.codex/agents/react-patterns-enforcer.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Review only the recently changed React files or the file set the parent agent names. Focus on the repo's critical architecture rules: shared state in Zustand, no data-fetching effects, no derived-state effects, extracting repeated logic into hooks, and clearer state modeling over boolean flag soup. diff --git a/.codex/agents/test-apk.toml b/.codex/agents/test-apk.toml index a873395d..c097b6a7 100644 --- a/.codex/agents/test-apk.toml +++ b/.codex/agents/test-apk.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Test only the Android workflow the parent agent asks about on the local emulator, leaving the emulator running when you finish unless the parent agent says otherwise. Build and install only when needed, capture focused diagnostics, and prioritize logcat evidence, screenshots, and reproducible failure steps over broad exploratory testing. diff --git a/.codex/agents/translator.toml b/.codex/agents/translator.toml index 7758b243..1e4d5495 100644 --- a/.codex/agents/translator.toml +++ b/.codex/agents/translator.toml @@ -1,5 +1,3 @@ -model = "gpt-5.4" -model_reasoning_effort = "medium" developer_instructions = """ Translate exactly one i18next key at a time into every supported language. Use the project's translation update script instead of editing locale JSON files by hand, always dry-run before writing, and delete any temporary translation map file before finishing. diff --git a/AGENTS.md b/AGENTS.md index a50c5935..20376e99 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -181,7 +181,7 @@ src/ - Keep equivalent workflow files aligned across all toolchains when their directories contain the same skill, hook, or agent. - Keep shared behavior equivalent while preserving harness-specific models, config formats, hook entry points, and tool invocation syntax. - Do not configure `.claude` agents to use `composer-2`; that model is Cursor-only in this repo. Keep `.claude` agent models on Claude-supported options. -- Do not configure `.codex/agents/*.toml` with `gpt-5.3-codex` or `gpt-5.3-codex-spark`; standardize Codex agents on `gpt-5.4` unless the user explicitly requests a different model. +- Do not pin `model` or `model_reasoning_effort` in committed Codex custom-agent TOMLs under `.codex/**/agents/*.toml`; omit both so subagents inherit the current parent settings. Do not use undocumented aliases such as `latest`. - When changing shared agent behavior, update the relevant files in `.codex/skills/`, `.cursor/skills/`, `.claude/skills/`, `.codex/agents/`, `.cursor/agents/`, `.claude/agents/`, `.codex/hooks/`, `.cursor/hooks/`, `.claude/hooks/`, and the hook entry points as needed. Hook entry points are harness-specific: the `hooks` key in `.claude/settings.json` (Claude Code does not read a standalone hooks.json), `.cursor/hooks.json` (Cursor schema), and `.codex/hooks.json` (Codex schema, intentionally Claude-compatible). - If `AGENTS.md` references a skill, agent, or hook, prefer a tracked file under `.codex/`, `.cursor/`, or `.claude/` rather than an untracked local-only instruction. - Review `.codex/config.toml`, `.codex/hooks.json`, `.cursor/hooks.json`, and `.claude/settings.json` before changing agent orchestration or hook behavior, because they are the entry points contributors will actually load. diff --git a/docs/agent-playbooks/known-surprises.md b/docs/agent-playbooks/known-surprises.md index 35b3fcdf..08d799e8 100644 --- a/docs/agent-playbooks/known-surprises.md +++ b/docs/agent-playbooks/known-surprises.md @@ -128,14 +128,15 @@ If uncertain, ask the developer before adding an entry. - **Mitigation:** Keep Portless startup behind `scripts/start-dev.js`, which now uses a branch-scoped `*.5chan.localhost` route outside the canonical case and automatically increments a `-2`, `-3`, ... suffix when that branch-scoped route is already occupied. - **Status:** confirmed -### Toolchain model names are not interchangeable +### Toolchain model names and inheritance are not interchangeable - **Date:** 2026-04-08 +- **Updated:** 2026-07-10 - **Observed by:** contributor + Codex - **Context:** Reviewing repo-managed agent configs under `.codex/agents`, `.cursor/agents`, and `.claude/agents` -- **What was surprising:** `composer-2` is only available for Cursor in this repo, while Codex agents using `gpt-5.3-codex` or `gpt-5.3-codex-spark` perform poorly enough that they should not be configured by default. -- **Impact:** Agents can silently inherit invalid or weak model settings, leading to broken subagent runs or degraded implementation quality. -- **Mitigation:** Keep `.cursor` agent configs on Cursor-supported models only, never use `composer-2` in `.claude`, and standardize `.codex/agents/*.toml` on `gpt-5.4` unless a contributor explicitly requests an override. +- **What was surprising:** Model names remain harness-specific, while Codex custom-agent `model` and `model_reasoning_effort` settings are optional and inherit from the parent when omitted; Codex does not document a `latest` alias for these files. +- **Impact:** Hard-coded Codex model or reasoning-effort settings can become stale or unsupported and prevent subagents from following the contributor's current parent configuration. +- **Mitigation:** Keep `.cursor` agents on Cursor-supported models, never use `composer-2` in `.claude`, and omit `model` and `model_reasoning_effort` from committed custom-agent TOMLs under `.codex/**/agents/*.toml`; `yarn ai-workflow:check` rejects pins so Codex agents keep inheriting parent settings. - **Status:** confirmed ### codesign parses "5chan.app" as process ID 5 diff --git a/public/llms-full.txt b/public/llms-full.txt index 522da9e5..5ead52bd 100644 --- a/public/llms-full.txt +++ b/public/llms-full.txt @@ -361,7 +361,7 @@ src/ - Keep equivalent workflow files aligned across all toolchains when their directories contain the same skill, hook, or agent. - Keep shared behavior equivalent while preserving harness-specific models, config formats, hook entry points, and tool invocation syntax. - Do not configure `.claude` agents to use `composer-2`; that model is Cursor-only in this repo. Keep `.claude` agent models on Claude-supported options. -- Do not configure `.codex/agents/*.toml` with `gpt-5.3-codex` or `gpt-5.3-codex-spark`; standardize Codex agents on `gpt-5.4` unless the user explicitly requests a different model. +- Do not pin `model` or `model_reasoning_effort` in committed Codex custom-agent TOMLs under `.codex/**/agents/*.toml`; omit both so subagents inherit the current parent settings. Do not use undocumented aliases such as `latest`. - When changing shared agent behavior, update the relevant files in `.codex/skills/`, `.cursor/skills/`, `.claude/skills/`, `.codex/agents/`, `.cursor/agents/`, `.claude/agents/`, `.codex/hooks/`, `.cursor/hooks/`, `.claude/hooks/`, and the hook entry points as needed. Hook entry points are harness-specific: the `hooks` key in `.claude/settings.json` (Claude Code does not read a standalone hooks.json), `.cursor/hooks.json` (Cursor schema), and `.codex/hooks.json` (Codex schema, intentionally Claude-compatible). - If `AGENTS.md` references a skill, agent, or hook, prefer a tracked file under `.codex/`, `.cursor/`, or `.claude/` rather than an untracked local-only instruction. - Review `.codex/config.toml`, `.codex/hooks.json`, `.cursor/hooks.json`, and `.claude/settings.json` before changing agent orchestration or hook behavior, because they are the entry points contributors will actually load. @@ -944,14 +944,15 @@ If uncertain, ask the developer before adding an entry. - **Mitigation:** Keep Portless startup behind `scripts/start-dev.js`, which now uses a branch-scoped `*.5chan.localhost` route outside the canonical case and automatically increments a `-2`, `-3`, ... suffix when that branch-scoped route is already occupied. - **Status:** confirmed -### Toolchain model names are not interchangeable +### Toolchain model names and inheritance are not interchangeable - **Date:** 2026-04-08 +- **Updated:** 2026-07-10 - **Observed by:** contributor + Codex - **Context:** Reviewing repo-managed agent configs under `.codex/agents`, `.cursor/agents`, and `.claude/agents` -- **What was surprising:** `composer-2` is only available for Cursor in this repo, while Codex agents using `gpt-5.3-codex` or `gpt-5.3-codex-spark` perform poorly enough that they should not be configured by default. -- **Impact:** Agents can silently inherit invalid or weak model settings, leading to broken subagent runs or degraded implementation quality. -- **Mitigation:** Keep `.cursor` agent configs on Cursor-supported models only, never use `composer-2` in `.claude`, and standardize `.codex/agents/*.toml` on `gpt-5.4` unless a contributor explicitly requests an override. +- **What was surprising:** Model names remain harness-specific, while Codex custom-agent `model` and `model_reasoning_effort` settings are optional and inherit from the parent when omitted; Codex does not document a `latest` alias for these files. +- **Impact:** Hard-coded Codex model or reasoning-effort settings can become stale or unsupported and prevent subagents from following the contributor's current parent configuration. +- **Mitigation:** Keep `.cursor` agents on Cursor-supported models, never use `composer-2` in `.claude`, and omit `model` and `model_reasoning_effort` from committed custom-agent TOMLs under `.codex/**/agents/*.toml`; `yarn ai-workflow:check` rejects pins so Codex agents keep inheriting parent settings. - **Status:** confirmed ### codesign parses "5chan.app" as process ID 5 diff --git a/scripts/validate-ai-workflow.mjs b/scripts/validate-ai-workflow.mjs index 3ab55ecd..30cf8ab0 100644 --- a/scripts/validate-ai-workflow.mjs +++ b/scripts/validate-ai-workflow.mjs @@ -13,8 +13,8 @@ * .cursor/hooks.json, .codex/hooks.json) wire the same hook scripts * - SKILL.md frontmatter has a name matching its directory and a * non-empty description - * - agent model rules: no composer-* models in .claude agents, no - * gpt-5.3-codex* models in .codex agents + * - agent model rules: no composer-* models in .claude agents, no pinned + * model or reasoning-effort settings in Codex custom-agent TOMLs * * Exemptions live HERE in validator-owned allowlists, not in the exempted * files, so a drifted copy cannot silently exempt itself. Every entry needs @@ -204,11 +204,17 @@ for (const agent of agentSets.get('.claude')) { errors.push(`banned model "${fm.model}" (Cursor-only) in .claude/agents/${agent}.md`); } } -for (const agent of agentSets.get('.codex')) { - const toml = read(path.join(repoRoot, '.codex', 'agents', `${agent}.toml`)); - const model = toml.match(/^model\s*=\s*"([^"]*)"/m)?.[1]; - if (model === 'gpt-5.3-codex' || model === 'gpt-5.3-codex-spark') { - errors.push(`banned model "${model}" in .codex/agents/${agent}.toml (standardize on gpt-5.4)`); +const codexAgentTomls = listFilesRecursive(path.join(repoRoot, '.codex')).filter((file) => + /(^|\/)agents\/[^/]+\.toml$/.test(file), +); +for (const file of codexAgentTomls) { + const toml = read(path.join(repoRoot, '.codex', file)); + for (const field of ['model', 'model_reasoning_effort']) { + if (new RegExp(`^${field}\\s*=`, 'm').test(toml)) { + errors.push( + `pinned Codex setting "${field}" in .codex/${file} (omit it so the agent inherits from its parent)`, + ); + } } }