From 731f7dfd0f9f7e4e9e29b5d8540c54f93800a505 Mon Sep 17 00:00:00 2001 From: Tim Wong <280945586+TimWongUp@users.noreply.github.com> Date: Fri, 25 Sep 2026 12:19:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(orchestration):=20=E4=B8=BB=E5=8A=A8?= =?UTF-8?q?=E5=A7=94=E6=B4=BE=E8=BE=B9=E7=95=8C=E6=B8=85=E6=99=B0=E7=9A=84?= =?UTF-8?q?=E5=8F=AA=E8=AF=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex 宿主会注入"除非用户或 AGENTS.md/Skill 明确要求,否则不派子代理"的指令, 原有全局块只规定派发前加载 Skill,Skill 措辞也偏限制,导致普通模式几乎不主动委派。 - 全局块在边界清晰的只读问题(大范围代码搜索与调用链、版本相关外部事实、公开实践证据)时加载 Skill - SKILL.md 明确要求对上述问题委派只读子代理,独立问题并行派发,并列出留给主代理的情形 - 在 configuration 文档记录措辞原因,validate.py 保护该明确要求短语 - 同步 hooks-and-prompts 文档与中英文 README Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- README.zh-CN.md | 2 +- SKILL.md | 16 ++++++++++++++-- docs/configuration.md | 5 +++++ docs/hooks-and-prompts.md | 2 +- examples/global-agents-block.md | 2 +- scripts/validate.py | 1 + 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d06d189..c8f8ac1 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ The repository is the only source of truth for its portable Skills, Agents, inst ## What makes it different -- **Delegation has a threshold.** Subagents are used only when parallel evidence, specialization, or a bounded worker can materially improve the result; the separate PR Review policy authorizes only its selected read-only Reviewers. +- **Delegation has a threshold.** Subagents are used when parallel evidence, specialization, or a bounded worker can materially improve the result, and bounded read-only search, authority, or public-practice questions are delegated proactively; the separate PR Review policy authorizes only its selected read-only Reviewers. - **Manager-only is explicit and ephemeral.** A clear user request can make the current root task a strong-delegation manager: code investigation goes to `explorer`, implementation/tests/validation go to a leased Worker, and the root cannot silently take over after failure. After three unsuccessful rounds, only read-only re-decomposition or a blocker report remains; the user must give a new direction or explicitly consent before new code work. - **Handoffs preserve useful compression.** Delegation uses compact natural-language briefs with optional task, context, handoff, and reference sections instead of inventing mandatory fields or temporary documents. When a calling Skill or Agent role supplies a machine-validated return schema, that specialized contract still applies. Agents recover ordinary repository context and return traceable evidence. - **Task language is local.** Setup can persist English or Simplified Chinese delegation prose while role names, paths, and external protocol literals stay stable. diff --git a/README.zh-CN.md b/README.zh-CN.md index b0d044d..e26aafc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,7 +65,7 @@ python3 scripts/install.py --uninstall --apply ## 鲜明特点 -- **委派有门槛。** 只有并行证据、专业分工或边界清晰的 Worker 能实质改善结果时,才启动子代理;独立的 PR Review 策略只授权它选中的只读 Reviewer。 +- **委派有门槛。** 并行证据、专业分工或边界清晰的 Worker 能实质改善结果时启动子代理,边界清晰的只读搜索、权威事实或公开实践问题会主动委派;独立的 PR Review 策略只授权它选中的只读 Reviewer。 - **manager-only 必须显式且临时。** 用户明确请求后,当前根任务才进入强委派管理模式:代码调查交给 `explorer`,实现、测试和验证交给带租约的 Worker;子代理失败时主代理不得静默接管,必须重拆、替换或报告阻塞。三轮不通过后只能只读重拆或报告阻塞,不得启动第四轮代码写入;新的代码写入要等用户新方向或明确退出模式。 - **交接保留有效压缩。** 委派使用自然语言简报,任务、必要上下文、交接重点和参考资料都只是可选结构,不自行发明固定字段或临时文档;调用方 Skill 或 Agent 角色提供机器可校验的回传 schema 时,仍遵循该专用合同。Agent 自行恢复普通仓库上下文并返回可追溯证据。 - **任务语言保留在本机。** 初始化可持久化选择英文或简体中文的委派措辞;角色名、路径和外部协议字面量保持稳定。 diff --git a/SKILL.md b/SKILL.md index 97f0526..bac9c76 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,6 +1,6 @@ --- name: codex-orchestration -description: Root-task orchestration for explicit subagent or parallel work, official Codex Worktree Roots, R1-R3 Reviewers selected by codex-review-gate, and coding tasks with a clear delegation payoff. An explicit user request for manager-only or pure-orchestration mode enables strong delegation for the current root task; in ordinary mode keep simple tasks and ordinary documentation with the main agent; derived agents must not invoke it. +description: Root-task orchestration for explicit subagent or parallel work, bounded read-only questions such as broad code search, call-path tracing, version-specific external facts, or public practice evidence, official Codex Worktree Roots, R1-R3 Reviewers selected by codex-review-gate, and coding tasks with a clear delegation payoff. An explicit user request for manager-only or pure-orchestration mode enables strong delegation for the current root task; in ordinary mode keep simple tasks and ordinary documentation with the main agent; derived agents must not invoke it. metadata: version: 0.10.7 --- @@ -16,7 +16,7 @@ change that boundary. The root main agent owns the goal, decomposition, model selection, local write lease, Git, acceptance, and delivery. An Integration Root additionally owns peer-lane coordination and -integrated acceptance. Delegate only when the result can change a decision or materially improve +integrated acceptance. Delegate when the result can change a decision or materially improve execution. `codex-review-gate` separately authorizes only its selected R1-R3 read-only Reviewers; run them with this Skill's routing, brief, lifecycle, and waiting rules without reapplying the ordinary delegation threshold. That permission admits no unrelated delegation. @@ -36,6 +36,18 @@ research only when it can change the decision and local or official sources do n it. In manager-only mode, substantive code investigation follows [references/manager-only.md](references/manager-only.md). +In ordinary mode, this Skill explicitly requests read-only delegation when the question can be +stated up front with a completion condition and the main agent needs only the conclusion and +evidence locations rather than the raw material: broad searches or call-path tracing across modules +or directories, or searches unlikely to hit in the first few tries, go to `explorer`; conclusions +that depend on version-specific behavior of an external library, API, protocol, or platform without +an authoritative in-repository source go to `reference-researcher`; decision-relevant public +practice, product comparison, or case evidence goes to `web-researcher`. When two or more such +questions are independent, delegate each to its own read-only agent in parallel and continue main +work that does not depend on their results. Keep with the main agent code it will edit next, +step-by-step investigation whose next step depends on the previous finding, single-file or +known-location work, and questions answerable in one or two searches. + In ordinary mode, the main agent directly reads project-owned architecture, ADR, and handoff documents that define the decision frame, and the active writer reads the exact code it changes. For delegated reading, verify decision-critical or suspicious claims from returned paths, symbols, diff --git a/docs/configuration.md b/docs/configuration.md index 029778b..b93a3c3 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -81,6 +81,11 @@ only orchestration policy: ordinary delegation uses `fork_turns="none"`, pending dependency barrier, a follow-up invalidates earlier completion evidence, an explicit stop converges the active tree, and a third worker round starts with a fresh package and lease. +Codex hosts may instruct the model not to spawn subagents unless the user or applicable +`AGENTS.md`/Skill instructions explicitly ask for delegation. The global block therefore routes +bounded read-only questions to `codex-orchestration`, and the Skill explicitly requests read-only +delegation for them; without that wording, ordinary delegation rarely starts unless the user asks. + ### Explicit manager-only mode Manager-only mode is enabled only by a clear user request such as “enable orchestration mode”, “main diff --git a/docs/hooks-and-prompts.md b/docs/hooks-and-prompts.md index 905adfd..942d91f 100644 --- a/docs/hooks-and-prompts.md +++ b/docs/hooks-and-prompts.md @@ -30,7 +30,7 @@ into the active global `AGENTS.override.md` or `AGENTS.md` by default and owns o ## Agent orchestration -- Root tasks load `codex-orchestration` before creating, coordinating, or waiting for subagents or independent Worktree Roots; simple tasks and ordinary documentation stay with the main agent. +- Root tasks load `codex-orchestration` before creating, coordinating, or waiting for subagents or independent Worktree Roots, and when a bounded read-only question needs only a conclusion with evidence: broad code search or call-path tracing, version-specific external facts, or public practice evidence; simple tasks and ordinary documentation stay with the main agent. ## Code review diff --git a/examples/global-agents-block.md b/examples/global-agents-block.md index 2f3a6a3..7a530bd 100644 --- a/examples/global-agents-block.md +++ b/examples/global-agents-block.md @@ -1,7 +1,7 @@ ## Agent orchestration -- Root tasks load `codex-orchestration` before creating, coordinating, or waiting for subagents or independent Worktree Roots; simple tasks and ordinary documentation stay with the main agent. +- Root tasks load `codex-orchestration` before creating, coordinating, or waiting for subagents or independent Worktree Roots, and when a bounded read-only question needs only a conclusion with evidence: broad code search or call-path tracing, version-specific external facts, or public practice evidence; simple tasks and ordinary documentation stay with the main agent. ## Code review diff --git a/scripts/validate.py b/scripts/validate.py index 6e5a83e..96f791c 100644 --- a/scripts/validate.py +++ b/scripts/validate.py @@ -803,6 +803,7 @@ def validate_source() -> list[str]: "same local orchestration authority as any other", "separately authorizes only its selected R1-R3 read-only Reviewers", "without reapplying the ordinary delegation threshold", + "this Skill explicitly requests read-only delegation", "when the calling Skill or Agent role supplies a machine-validated return schema", "follow that specialized schema", ):