diff --git a/README.md b/README.md index a095bf5..98e5c6b 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ The native Luna choice is scoped to the requested work. `ds_model_defaults` stor You can also set one model for a group of delegates in ordinary language: “Use GPT-5.6 Luna for all workers in this task” makes every subsequently created delegate in that task a native Luna subagent; “Use Go GLM 5.3 Flash for all workers in this task” applies that external selection to each new OpenCode worker without changing the machine default. Existing workers keep their original model and must be replaced when the selection changes. “All workers” is task/thread scoped unless you explicitly say “future/global/all new workers”; native Luna still cannot be persisted through `ds_model_defaults`. +Luna does not need OpenCode to support ordinary correction loops or isolated coding. Codex can retain a native subagent within the current task, queue or send follow-ups through the host's native coordination controls, wait or interrupt it, and assign it a host-managed or controller-prepared Git worktree. These are Codex orchestration capabilities, not Luna model features. Cross-task/restart discovery of controller state, OpenCode context forks, external-provider accounting and persisted `task_spec` verification remain reasons to choose the plugin's OpenCode worker. + [OpenAI documents GPT-5.6 Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna) as a cost-sensitive, high-volume model. Published API prices do not establish how a Codex plan meters native subagent usage, so this project does not claim a fixed Luna saving without a matched Codex measurement. For the OpenCode worker lane, without saved machine preferences, the built-in default remains `opencode-go/deepseek-v4.1-flash` with `max` reasoning. `ds_check` and `ds_spawn_agent` accept: @@ -160,7 +162,7 @@ For native Luna, Codex sends a bounded task and the necessary repository context ### Route by task complexity -Choose the route from reasoning, risk, and exploration/verification burden, not line or file counts. **Small** known edits that take a few minutes stay with Codex. **Medium** mechanical work with clear acceptance criteria prefers delegation: use Codex-native `gpt-5.6-luna` for bounded, low-risk native subtasks when available. Prefer the DeepSeek/GLM OpenCode worker when persistent sessions, isolated worktrees, queued corrections/follow-ups, forks, or persisted verification materially matter, because Luna does not provide that plugin-managed lifecycle. **Large or high-risk** work — state machines, concurrency, permissions, transactions, migrations — may delegate only bounded labor to either lane; Codex must first fix the design, interfaces, invariants, failure semantics and acceptance cases, then review the actual diff and run independent verification. A worker's self-report or passing self-tests are never acceptance. An explicit per-task or fleet-wide model/lane choice overrides these defaults; capability conflicts must be reported, and failures never authorize a silent cross-lane fallback. +Choose the route from reasoning, risk, and exploration/verification burden, not line or file counts. **Small** known edits that take a few minutes stay with Codex. **Medium** mechanical work with clear acceptance criteria prefers delegation: use Codex-native `gpt-5.6-luna` for bounded, low-risk native subtasks when available, including task-scoped correction loops and isolated worktree execution managed by Codex. Prefer the DeepSeek/GLM OpenCode worker when the user selects it or the task materially needs cross-task/restart discovery, controller-persisted state, OpenCode context forks, external-provider usage accounting, or persisted `task_spec` verification. **Large or high-risk** work — state machines, concurrency, permissions, transactions, migrations — may delegate only bounded labor to either lane; Codex must first fix the design, interfaces, invariants, failure semantics and acceptance cases, then review the actual diff and run independent verification. A worker's self-report or passing self-tests are never acceptance. An explicit per-task or fleet-wide model/lane choice overrides these defaults, and failures never authorize a silent cross-lane fallback. A 2026-09-15 pilot paired one direct and one delegated DeepSeek execution per size from the same commit: [task routing pilot](./docs/task-routing-pilot-2026-09-15.md). It did not test Luna. It ran one execution per cell in parallel without alternating order, so it is not the repeated benchmark the queen protocol asks for, and its numbers neither generalize nor promise a fixed saving. In that pilot, delegated worker non-cached input plus output was 13.78% below the three direct runs, while the controller's own interval was 55.41% below the direct proxy total; the controller interval also covers managing the direct Codex control arm and reviewing both runs, so it is not a pure delegation bill. Worker totals including cached reads were higher than direct totals, so combined tokens and latency can still increase; medium and large worker usage is marked incomplete. diff --git a/README.zh-CN.md b/README.zh-CN.md index 7847249..dbeb4d0 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -58,6 +58,8 @@ Luna 选择只作用于本次要求的工作。`ds_model_defaults` 只保存 Ope 也可以直接给一组工蜂统一指定模型。例如“当前任务所有工蜂都用 5.6 Luna”,表示从这条指令之后,本任务新建的每个工蜂都走 Codex 原生 Luna;“本次全部工蜂使用 Go GLM 5.3 Flash”则让本任务新建的 OpenCode Worker 统一使用该模型,但不改本机默认值。已经创建的工蜂保持原模型,需要换模型时应新建替代工蜂。“所有工蜂”默认只作用于当前任务或当前 Codex 会话;只有明确说“以后 / 全局 / 所有新执行者”才表示持久偏好,而且 Luna 仍不能通过 `ds_model_defaults` 持久化。 +普通纠错循环和隔离编码不需要为了 Luna 再经过 OpenCode。Codex 可以在当前任务内保留原生子 Agent,使用宿主原生协调能力排队或发送追加消息、等待或中断,并把 Luna 分配到宿主管理或 Codex 预先创建的 Git worktree。这些属于 Codex 编排能力,不是 Luna 模型能力。只有需要跨任务/重启发现控制器状态、OpenCode 上下文 fork、外部 Provider 用量记录或持久化 `task_spec` 验收时,才应因为生命周期能力优先 OpenCode Worker。 + [OpenAI 官方将 GPT-5.6 Luna 定位为面向成本敏感、高吞吐工作负载的模型](https://developers.openai.com/api/docs/models/gpt-5.6-luna)。公开 API 价格不能直接证明 Codex 套餐如何计算原生子 Agent 用量,因此本项目不会在缺少同条件 Codex 实测时承诺固定节省比例。 对于 OpenCode Worker 通道,未保存本机偏好时,内置默认是 `opencode-go/deepseek-v4.1-flash`,推理档位 `max`。`ds_check` 和 `ds_spawn_agent` 可以传入: @@ -167,7 +169,7 @@ npm --prefix plugins/deepseek-code-agent run test:live ### 按任务复杂度路由 -路由依据判断量、风险以及探索与验证负担,而不是行数或文件数。**小型**已知改动几分钟可完成,由 Codex 直接处理;**中型**机械实现且验收标准清晰时优先委派:范围明确、风险较低的原生子任务可优先使用 `gpt-5.6-luna`。任务确实需要持久会话、独立 worktree、纠错/追加消息队列、fork 或持久化验收时,优先使用 DeepSeek/GLM OpenCode Worker,因为 Luna 不提供这套插件生命周期。**大型或高风险**任务(状态机、并发、权限、事务、迁移等)只能把边界明确的劳动交给任一通道,Codex 必须先确定设计、接口、不变量、失败语义和验收案例,再审查实际 diff 并独立验证。绝不按 Worker 自报或自测通过来接受;用户对本次或全部工蜂的明确模型选择优先于自动路由,能力冲突必须如实说明,任何失败都不能触发静默跨通道降级。 +路由依据判断量、风险以及探索与验证负担,而不是行数或文件数。**小型**已知改动几分钟可完成,由 Codex 直接处理;**中型**机械实现且验收标准清晰时优先委派:范围明确、风险较低的原生子任务优先使用 `gpt-5.6-luna`,当前任务内的连续纠错、消息队列和由 Codex 管理的独立 worktree 也可以继续走 Luna。用户明确选择 DeepSeek/GLM,或任务确实需要跨任务/重启发现、控制器状态落盘、OpenCode 上下文 fork、外部 Provider 用量记录或持久化 `task_spec` 验收时,再优先 OpenCode Worker。**大型或高风险**任务(状态机、并发、权限、事务、迁移等)只能把边界明确的劳动交给任一通道,Codex 必须先确定设计、接口、不变量、失败语义和验收案例,再审查实际 diff 并独立验证。绝不按 Worker 自报或自测通过来接受;用户对本次或全部工蜂的明确模型选择优先于自动路由,任何失败都不能触发静默跨通道降级。 2026-09-15 的 pilot 在同一基线 commit 上为每个规模各做了一次 Codex 直接执行与委派 DeepSeek 执行:[任务分级 pilot](./docs/task-routing-pilot-2026-09-15.md)。它没有测试 Luna。每格仅一次、双臂并行、顺序未交替,因此它不是 queen 协议要求的三次重复正式基准,结果不能推广,也不承诺固定节省。该 pilot 中,worker 非缓存输入加输出合计比三次 direct 低 13.78%,controller 自身区间的 proxy 比 direct proxy 合计低 55.41%;controller 区间也包含管理 Codex 直接执行对照组和审查两组结果,不能当作纯委派账单。计入缓存后 worker total 高于 direct total,总 Token 和耗时仍可能增加;medium 和 large 的 worker 用量标记为不完整。 diff --git a/plugins/deepseek-code-agent/.codex-plugin/plugin.json b/plugins/deepseek-code-agent/.codex-plugin/plugin.json index e840981..d109ff6 100644 --- a/plugins/deepseek-code-agent/.codex-plugin/plugin.json +++ b/plugins/deepseek-code-agent/.codex-plugin/plugin.json @@ -33,7 +33,7 @@ ], "defaultPrompt": [ "Use Codex-native GPT-5.6 Luna with maximum reasoning for this bounded implementation; do not use OpenCode or external credentials.", - "Use GPT-5.6 Luna with maximum reasoning for all new workers in this task.", + "Use GPT-5.6 Luna with maximum reasoning for all new workers in this task, reusing native follow-ups and isolated worktrees where useful.", "Use DeepSeek or GLM to implement this coding goal, then review and verify its patch.", "Set OpenCode Go GLM 5.3 Flash with maximum reasoning as my machine default for new coding workers.", "Show the current OpenCode worker default and inspect the active coding agent." diff --git a/plugins/deepseek-code-agent/README.md b/plugins/deepseek-code-agent/README.md index 4212c0b..fabce94 100644 --- a/plugins/deepseek-code-agent/README.md +++ b/plugins/deepseek-code-agent/README.md @@ -29,6 +29,8 @@ For a bounded, low-risk native task, ask Codex to “use the native GPT-5.6 Luna A fleet-scoped request can select one model for every new delegate in the current task or Codex thread. For example, “use GPT-5.6 Luna for all workers in this task” routes every subsequently created delegate to native Luna/max, while “use Go GLM 5.3 Flash for all workers in this task” applies that OpenCode selection without changing the machine default. Existing workers retain their original model and must be replaced to change it. “All workers” is not machine-global unless the user explicitly says “future/global/all new workers”; Luna cannot be persisted through `ds_model_defaults`. +Luna does not need OpenCode for an ordinary correction loop or isolated coding. Codex can retain a native subagent for the current task, queue or send follow-ups through native coordination controls, wait or interrupt it, and assign it a host-managed or controller-prepared Git worktree. Those are Codex orchestration capabilities, not Luna model features. Cross-task/restart discovery, persisted controller state, OpenCode context forks, external-provider accounting and persisted `task_spec` verification remain reasons to choose the OpenCode worker. + [OpenAI describes Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna) as cost-sensitive and high-volume. API list prices are not a promise about native Codex plan metering, and this project has not benchmarked the Luna lane. For the persistent OpenCode worker lane, the built-in default is `opencode-go/deepseek-v4.1-flash` with variant `max`; a saved machine preference takes precedence. Pass `model="glm-5.3-flash"` for Go GLM, or `provider="deepseek"` for official `deepseek-flash`. `deepseek-v4-pro` and other models in the selected provider's OpenCode catalog are also supported. The saved model pair inherits its saved variant; a different selected provider/model pair defaults to `max` when no variant is supplied; an explicit `variant=null` removes the override for that request. @@ -52,7 +54,7 @@ The live test makes a small request to the selected model in a temporary Git rep ## Routing expectation -Route by judgment, risk, and exploration/verification burden, not line counts. Small known edits that take a few minutes stay with Codex. Medium mechanical work with clear acceptance criteria prefers delegation: use native `gpt-5.6-luna` for bounded low-risk subtasks when available. Prefer the DeepSeek/GLM OpenCode lane when persistent sessions, isolated worktrees, queued corrections/follow-ups, forks, or persisted verification materially matter, because native Luna does not provide that plugin-managed lifecycle. Large or high-risk work (state machines, concurrency, permissions, transactions, migrations) may delegate only bounded labor to either lane; Codex first decides the design, interfaces, data flows, invariants, failure semantics and acceptance examples, then reviews the actual diff and runs independent verification. Worker self-reports and passing self-tests are never acceptance. An explicit per-task or fleet-wide model choice overrides these defaults; capability conflicts must be reported, and lane failures never cause silent fallback. +Route by judgment, risk, and exploration/verification burden, not line counts. Small known edits that take a few minutes stay with Codex. Medium mechanical work with clear acceptance criteria prefers delegation: use native `gpt-5.6-luna` for bounded low-risk subtasks when available, including task-scoped correction loops and isolated worktree execution managed by Codex. Prefer the DeepSeek/GLM OpenCode lane when the user selects it or the task materially needs cross-task/restart discovery, controller-persisted state, OpenCode context forks, external-provider accounting, or persisted `task_spec` verification. Large or high-risk work (state machines, concurrency, permissions, transactions, migrations) may delegate only bounded labor to either lane; Codex first decides the design, interfaces, data flows, invariants, failure semantics and acceptance examples, then reviews the actual diff and runs independent verification. Worker self-reports and passing self-tests are never acceptance. An explicit per-task or fleet-wide model choice overrides these defaults, and lane failures never cause silent fallback. Codex decides the design, interfaces, invariants and acceptance cases. A native Luna subagent receives one bounded task; a persistent OpenCode worker can additionally use the plugin's worktree, correction and verification lifecycle. Codex reviews the actual patch from either lane. After two unsuccessful OpenCode review correction rounds it may take over, after confirming the worker and verification have stopped. diff --git a/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/SKILL.md b/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/SKILL.md index f857d6a..5b67603 100644 --- a/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/SKILL.md +++ b/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/SKILL.md @@ -17,7 +17,7 @@ Use the queen where its judgment most affects quality: intent, acceptance criter - Honor an explicit lane or model choice. “Codex 内置 Luna / 原生 Luna / GPT-5.6 Luna” selects the native `gpt-5.6-luna` subagent lane. “OpenCode Go / Go 套餐”, “官方 DeepSeek / DeepSeek API”, DeepSeek, or GLM selects the external OpenCode worker lane. Never silently switch lanes after unavailability, authentication, quota, or model errors. - Treat a fleet-scoped instruction such as “所有工蜂都用 5.6 Luna” or “本次全部 worker 使用 GLM 5.3 Flash” as the model/lane choice for every new delegate in the stated scope. It overrides automatic lane preferences but not safety, review or capability boundaries. Existing workers keep the model they were created with; create replacement workers when the fleet instruction requires another model. Unless the user says “以后 / 全局 / 所有新执行者”, “所有工蜂” means the current coding task or current Codex thread, not a machine-wide preference. -- For native Luna, use Codex's native subagent capability with `model="gpt-5.6-luna"`. When the user does not explicitly specify an effort, pass `reasoning_effort="max"` in the spawn call; do not rely on the host default. Do not call any `ds_*` tool, start OpenCode, pass plugin `provider` fields, or read/forward external provider credentials. Native availability comes from the current Codex host; report an unsupported model/effort combination rather than substituting another model. This plugin cannot persist a native Luna default through `ds_model_defaults`; a Luna choice is scoped to the requested work or current thread preference, and changing its model requires a new subagent. +- For native Luna, use Codex's native subagent capability with `model="gpt-5.6-luna"`. When the user does not explicitly specify an effort, pass `reasoning_effort="max"` in the spawn call; do not rely on the host default. Do not call any `ds_*` tool, start OpenCode, pass plugin `provider` fields, or read/forward external provider credentials. Native availability comes from the current Codex host; report an unsupported model/effort combination rather than substituting another model. Retain the native agent identity and use the host's native message/follow-up, wait and interrupt controls for task-scoped multi-turn corrections. This plugin cannot persist a native Luna default through `ds_model_defaults`; a Luna choice is scoped to the requested work or current thread preference, and changing its model requires a new subagent. - Map native “推理最大 / 最高 / 拉满 / max” to `reasoning_effort="max"`, “高 / high” to `high`, “中 / medium” to `medium`, and “低 / low” to `low`. If the user explicitly asks for “默认档位 / 自动”, omit `reasoning_effort` for that request; this is an intentional override and is distinct from leaving the effort unspecified. Never silently lower an unsupported effort. - The remaining model-selection rules in this section apply only to the external OpenCode worker lane. @@ -34,21 +34,24 @@ Use the queen where its judgment most affects quality: intent, acceptance criter Choose the route from how much judgment, risk, and exploration/verification burden the task carries — not from line counts or file counts. This is a decision guide for Codex’s situational judgment, not an automatic classifier, and an explicit user request to delegate or to stay direct overrides it. - **Small (direct):** a known, clearly understood change that takes a few minutes and needs neither broad discovery nor risky design. Handle it in Codex directly; briefing and reviewing a worker would cost more than the edit. Report the route as direct. -- **Medium (prefer delegation):** mechanical implementation, or a larger amount of testing, with clear and objective acceptance criteria. Prefer native `gpt-5.6-luna` for one bounded, low-risk subtask when the host supports it. When persistent sessions, isolated worktrees, queued corrections/follow-ups, forks, usage reporting, or persisted `task_spec` verification materially matter, prefer the DeepSeek/GLM OpenCode lane because those are OpenCode-worker capabilities. An explicit user fleet/model choice still wins: if it selects Luna, use native Luna for all new delegates in scope and state that the OpenCode lifecycle features are unavailable instead of pretending to provide them or silently changing models. +- **Medium (prefer delegation):** mechanical implementation, or a larger amount of testing, with clear and objective acceptance criteria. Prefer native `gpt-5.6-luna` for bounded, low-risk subtasks when the host supports it. Task-scoped multi-turn corrections, queued input and worktree isolation do not by themselves require OpenCode: use the host's native follow-up/queue controls and managed worktree support when available, or let Codex prepare a dedicated Git worktree and give Luna that exact working directory. Prefer the DeepSeek/GLM OpenCode lane when the user selects it or the task materially needs cross-Codex-task/restart discovery, controller-persisted agent state, OpenCode context forks, external-provider usage accounting, or persisted `task_spec` verification. - **Large or high-risk (delegated labor, queen-owned design):** state machines, concurrency, permissions, transactions, migrations, or changes where a wrong invariant, interface or failure semantic is expensive. Bounded labor may go to either lane, but Codex must first decide the design, interface, data flow, invariants, failure semantics and acceptance examples; then Codex reviews the actual diff and runs independent verification. Never accept any delegate’s self-report or passing self-tests as acceptance. - Hand off a coherent behavior or investigation with acceptance criteria, rather than one function or tool command per turn. - Prefer one lane and one delegate for a coherent task. Keep Luna prompts bounded and reuse an applicable native subagent only while its task and selected model remain coherent. Reuse a persistent OpenCode worker for related corrections; use a fresh worker for unrelated tasks. - Before spawning, read applicable repository instructions and the critical call chain. Codex must decide the interface, data flow, invariants, failure behavior and acceptance examples that determine correctness. Leave routine implementation and broader discovery to the worker. Do not substitute a vague task restatement for a design, or prewrite every implementation detail. - For the OpenCode lane, send a `task_spec` with the design decisions, observable acceptance criteria and exact checks selected by Codex. Keep it grounded in existing contracts; do not add speculative constraints. For an unfamiliar subsystem, first request a bounded discovery report from the same worker, then resolve the consequential decisions before implementation. - For the OpenCode lane, use concrete `scope_paths`, task-relevant `required_reads` (named sections for large files), and a few non-secret `critical_constraints`. Send paths and observable requirements, not full source files or conversation history. Prefer `workspace_mode="worktree"` for work starting from HEAD; use `current` when uncommitted changes are required, after checking status and protecting unrelated edits. +- For native Luna isolation, prefer a host-native worktree/environment option when the active subagent interface exposes one. Otherwise Codex may prepare a dedicated Git worktree before spawning and explicitly constrain the Luna worker to that absolute working directory. Follow repository Git/worktree rules, start from the intended committed state, avoid assigning overlapping files to parallel workers, preserve reviewed changes before cleanup, and never imply that a worktree contains uncommitted source changes. When the task depends on current uncommitted edits, use the current workspace with non-overlapping writes or keep the work serial rather than silently using a stale worktree. Do not create a separate user-visible Codex task merely to emulate a hidden worker unless the user explicitly asks for a new task. ## Keep the queen loop small ### Native Luna lane -1. Use the host-native subagent tool (`spawn_agent` when available) with `model="gpt-5.6-luna"`, `reasoning_effort="max"` unless the user explicitly selected another effort or explicitly requested the host default, and a bounded objective, scope, design decisions and observable acceptance criteria. This is Skill-level orchestration, not an MCP plugin call. Do not send it provider credentials or use any `ds_*` tool. -2. Wait for that native subagent through the host's native coordination mechanism. Review its actual filesystem changes and relevant surrounding code; its final report is not acceptance. -3. Run independent checks selected by Codex. Send a focused follow-up to the same subagent for a coherent correction when appropriate, or take over after stopping it. Model changes require a new subagent. +1. Select the workspace first. Use the current workspace for serial work that needs uncommitted changes. For independent work from committed state, use a host-managed worktree when exposed or create a dedicated Git worktree and include its exact path and write boundary in the task. +2. Use the host-native subagent tool (`spawn_agent` when available) with `model="gpt-5.6-luna"`, `reasoning_effort="max"` unless the user explicitly selected another effort or explicitly requested the host default, and a bounded objective, scope, design decisions and observable acceptance criteria. This is Skill-level orchestration, not an MCP plugin call. Do not send it provider credentials or use any `ds_*` tool. +3. Retain the agent identity. Use the native message or follow-up mechanism to queue a correction while it is running or resume the same idle agent for a coherent next turn; use native wait and interrupt controls instead of spawning a replacement merely because another turn is needed. These guarantees are scoped to the current Codex task unless the active host explicitly documents recovery beyond it. +4. Review its actual filesystem changes and relevant surrounding code; its final report is not acceptance. Run independent checks selected by Codex. After two unsuccessful review correction rounds, stop the worker and take over. Model changes still require a new subagent. +5. When Codex created a dedicated worktree, preserve or apply the reviewed patch before removing it. Remove only the exact task worktree after confirming no useful change remains solely there. ### OpenCode worker lane diff --git a/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/references/model-selection.md b/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/references/model-selection.md index c465c46..1e1cdab 100644 --- a/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/references/model-selection.md +++ b/plugins/deepseek-code-agent/skills/deepseek-coding-delegation/references/model-selection.md @@ -23,7 +23,7 @@ For the OpenCode lane, “以后 / 全局 / 设为默认 / 所有新执行者” The plugin cannot persist a Codex-native model default. A Luna request applies to the requested task or an explicitly established preference within the current Codex thread. Do not store Luna through `ds_model_defaults` or claim it will carry into future Codex tasks. -“所有工蜂 / 全部 worker” is a fleet-scoped model instruction, not a new provider type. Apply it to every delegate created after the instruction within the stated task/thread scope. Existing native subagents and OpenCode workers retain their saved models, so replace rather than mutate them when necessary. A fleet-scoped model instruction overrides the automatic lane recommendation. It does not manufacture cross-lane capabilities: native Luna has no plugin-managed persistent session, isolated worktree, queued correction mailbox, fork, or persisted `task_spec`. If a request requires those capabilities and also mandates Luna for all workers, surface the incompatibility and preserve the explicit Luna choice instead of silently substituting DeepSeek/GLM. +“所有工蜂 / 全部 worker” is a fleet-scoped model instruction, not a new provider type. Apply it to every delegate created after the instruction within the stated task/thread scope. Existing native subagents and OpenCode workers retain their saved models, so replace rather than mutate them when necessary. A fleet-scoped model instruction overrides the automatic lane recommendation. Native Luna can still use Codex's task-scoped message/follow-up queue, wait and interrupt controls, and it can work in an isolated Git worktree selected or prepared by Codex. Do not claim those orchestration capabilities belong to the model itself. OpenCode remains distinct when the task needs controller-persisted state discoverable across Codex tasks/restarts, OpenCode context forks, external-provider accounting, or persisted `task_spec` verification. ## Codex-native Luna lane @@ -31,6 +31,10 @@ The plugin cannot persist a Codex-native model default. A Luna request applies t The current host determines whether Luna and the requested effort are available. When unavailable, explain the limitation and keep the user's lane choice intact instead of falling back silently. A native subagent retains the model chosen when it was created; create a new subagent to change models. Codex still owns task design, authorization, diff review, independent verification and acceptance. +Keep the native agent ID for the current Codex task. When the host exposes native message/follow-up, wait and interrupt operations, reuse that agent for coherent correction turns, including queuing input while it is busy. Do not describe this task-scoped lifecycle as guaranteed recovery after an app restart unless the active Codex host explicitly provides that guarantee. + +For isolation, use a host-native worktree/environment option when the native subagent interface exposes one. Otherwise Codex may create a dedicated Git worktree from the intended committed state before spawning and tell Luna to work only in that exact directory. A worktree does not include uncommitted changes; tasks that depend on them should remain in the current workspace with non-overlapping writes or run serially. Preserve reviewed changes before cleaning up a controller-created worktree. A user-visible Codex task/worktree is a separate workflow and may be created only when the user explicitly asks for a new task; do not use it as an implicit substitute for a hidden native worker. + ## OpenCode worker persistent defaults Use `ds_model_defaults` with `action="get"`, `"set"` or `"reset"`. On `set`, pass the intended provider/model/variant and optional workspace for catalog validation. Report the resolved selection and scope after saving. `get` reports the effective selection, whether it is saved, and the local settings path. `reset` restores the built-in selection even if the saved file is invalid. @@ -101,6 +105,7 @@ If the provider is disconnected, connect the chosen account. If a model is missi ## Sources - [OpenAI GPT-5.6 Luna model](https://developers.openai.com/api/docs/models/gpt-5.6-luna) +- [OpenAI Agents subagent messages and lifecycle items](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/subresources/items/methods/list) - [OpenCode Go models and IDs](https://opencode.ai/docs/go/) - [OpenCode provider authentication](https://opencode.ai/docs/providers/#deepseek) - [OpenCode model configuration and variants](https://opencode.ai/docs/models/)