正在打开每日关注
正在打开每日关注
通过 AGENTS.md 约定 Luna 子代理的适用时机、隔离边界与结果验收。
one more thing: luna-worker.toml defines how the worker behaves. if you want luna_worker to become a natural part of your model's day-to-day workflow, update your AGENTS.md so the model knows when to use it. add this to your AGENTS.md ↓ When a task can be split into several independent and substantial subtasks, spawn one luna_worker per subtask and run them in parallel. Keep anything that takes only a few minutes in the main thread. Each worker runs in its own thread. Do not assume it can see the main thread conversation. Make every task description self-contained: files in scope, boundaries, and expected output. Independent read-only tasks can run in parallel. Any worker that writes files needs its own isolated worktree. Otherwise, run those workers sequentially. After all workers finish, the main thread checks each result against the acceptance criteria in the dispatch prompt before combining them. Re-dispatch anything that fails. If you dispatched multiple workers but only one ever runs, first check whether agents.max_concurrent_threads_per_session is set to 1 in config.toml. the same approach works for any other custom subagents you've configured.
Codex tip: tell Sol to configure 𝗟𝘂𝗻𝗮 𝗠𝗮𝘅 𝗮𝘀 𝗮 𝘀𝘂𝗯𝗮𝗴𝗲𝗻𝘁. 𝗽𝗿𝗼𝗺𝗽𝘁: create a custom agent named luna_worker at ~/.codex/agents/luna-worker.toml. use these settings: model = "gpt-5.6-luna" model_reasoning_effort = "max" give it a description and instructions for bounded delegated work. preserve the rest of my config. validate it against my installed Codex version, show me the diff, then use luna_worker for subagent tasks.
是什么
这组推文提出一种面向 Codex 的子代理编排方式:用 luna-worker.toml 固化代理模型、推理强度与职责,再通过 AGENTS.md 规定何时委派、如何并行以及如何回收结果。重点不是单次调用,而是把委派规则嵌入日常研发流程。
核心设计 任务只有在能够拆成多个独立且有一定规模的子任务时才适合并行;几分钟即可完成的小事继续由主线程处理。每个 worker 都处于独立线程,提示词必须自包含,明确文件范围、边界和预期输出。只读工作可以并行,涉及写文件则需要独立 worktree,避免互相覆盖。
关键洞察
主线程仍是协调者和质量闸门:所有 worker 完成后,要按派发时的验收标准逐项复核,失败结果重新派发,而不是盲目合并。并发度异常时,还应检查 agents.max_concurrent_threads_per_session 是否被设为 1。这套方法将 Agent 从临时助手提升为可治理的研发执行单元。
边界与风险 并行不等于更快;任务依赖、共享状态、冲突修改和上下文传递都会抵消收益。高推理模型也可能增加成本与等待时间,配置前应验证本机 Codex 版本、权限和并发能力,并限制代理的文件与操作范围。