Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Do not paste provider keys into Codex prompts, GitHub issues, logs, or repositor

## Select the worker lane and model

Use ordinary language in Codex. For example, “Use the Codex-native GPT-5.6 Luna subagent with medium reasoning for this bounded implementation” selects the native lane. It does not call `ds_check`, `ds_spawn_agent`, or OpenCode, and it is not a value accepted by the plugin's `provider` field. Luna reasoning can be requested as `none`, `low`, `medium`, `high`, `xhigh`, or `max`; if the host does not offer the requested combination, Codex reports that instead of silently switching lanes.
Use ordinary language in Codex. For example, “Use the Codex-native GPT-5.6 Luna subagent for this bounded implementation” selects the native lane and, when no effort is stated, Codex must spawn it with `model="gpt-5.6-luna"` and `reasoning_effort="max"`. It does not call `ds_check`, `ds_spawn_agent`, or OpenCode, and it is not a value accepted by the plugin's `provider` field. Luna reasoning can be explicitly requested as `none`, `low`, `medium`, `high`, `xhigh`, or `max`; an explicit “default/automatic” request intentionally omits the effort field. If the host does not offer the requested combination, Codex reports that instead of silently switching lanes.

The native Luna choice is scoped to the requested work. `ds_model_defaults` stores only OpenCode worker defaults and cannot persist a native Codex model preference. A native subagent uses the model selected when it is created; changing it means creating a new subagent.

Expand All @@ -71,7 +71,7 @@ A standalone OpenCode model/effort-setting request saves that lane's machine def

Persistent defaults are saved through `ds_model_defaults`, apply to future workers across Codex tasks on this machine, and survive plugin reinstall. Task-specific choices override them without changing the saved preference. This setting controls plugin workers; the Codex controller model remains an app setting. The selected model persists across follow-ups, queues, restarts and forks. Changing model starts a new worker; errors never silently change providers.

`variant` is optional. The saved model pair inherits its saved variant. When explicitly switching to another pair, only the original Go DeepSeek model defaults to `max`; other models use their runtime default. Explicit `null` uses the runtime default for any model. A string must be supported by that model's local catalog. Other model IDs configured in either provider's OpenCode catalog are also supported.
`variant` is optional. The saved model pair inherits its saved variant. When explicitly switching to another provider/model pair without a variant, every external model defaults to `max`, including Go GLM and official Flash/Pro. An explicitly saved variant for the same pair still wins, including saved `null`; an explicit `variant=null` always uses the runtime default for that request. A string must be supported by that model's local catalog. Other model IDs configured in either provider's OpenCode catalog are also supported.

For official API access, use OpenCode `/connect → DeepSeek` (or `opencode auth login`). Alternatively pass `DEEPSEEK_API_KEY` to the Codex host before launch; the plugin forwards it to OpenCode. The built-in official provider normally requests `https://api.deepseek.com` using your separate DeepSeek account. OpenCode still runs the coding tools and manages conversation history. The plugin does not rewrite provider endpoints or store keys.

Expand Down Expand Up @@ -149,7 +149,7 @@ Use $deepseek-coding-delegation to delegate this implementation and review the r
To use the native low-cost lane without external credentials:

```text
Use Codex-native GPT-5.6 Luna with medium reasoning for the bounded implementation. Do not use OpenCode or external provider credentials; Codex must review and verify the result.
Use Codex-native GPT-5.6 Luna with maximum reasoning for the bounded implementation. Do not use OpenCode or external provider credentials; Codex must review and verify the result.
```

For native Luna, Codex sends a bounded task and the necessary repository context through native delegation. For the OpenCode lane, Codex passes explicit `scope_paths`, task-specific `required_reads`, and compact `critical_constraints`. In both cases Codex independently reviews the resulting diff and tests.
Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ opencode-go/deepseek-v4.1-flash

## 选择执行通道和模型

日常可以直接在 Codex 里口述。例如:“这段范围明确的实现使用 Codex 原生 GPT-5.6 Luna 子 Agent,推理开到 medium。”这会选择原生通道,不调用 `ds_check`、`ds_spawn_agent` 或 OpenCode,也不能把 Luna 填进插件的 `provider` 字段。Luna 可请求 `none`、`low`、`medium`、`high`、`xhigh` 或 `max`;如果当前宿主不支持所选组合,Codex 应明确报告,不能静默换通道。
日常可以直接在 Codex 里口述。例如:“这段范围明确的实现使用 Codex 原生 GPT-5.6 Luna 子 Agent。”这会选择原生通道;没有明确说推理档位时,Codex 应在 spawn 中传 `model="gpt-5.6-luna"` 和 `reasoning_effort="max"`。它不调用 `ds_check`、`ds_spawn_agent` 或 OpenCode,也不能把 Luna 填进插件的 `provider` 字段。Luna 可显式请求 `none`、`low`、`medium`、`high`、`xhigh` 或 `max`;如果明确要求“默认档位/自动”,才省略该字段。如果当前宿主不支持所选组合,Codex 应明确报告,不能静默换通道。

Luna 选择只作用于本次要求的工作。`ds_model_defaults` 只保存 OpenCode Worker 默认值,不能持久化 Codex 原生模型偏好。原生子 Agent 创建后固定使用当时选择的模型;换模型要新建子 Agent。

Expand All @@ -78,7 +78,7 @@ OpenCode 模型同样可以直接口述。单独提出该通道的模型和推

选定的模型会随会话保存,追加消息、队列、重启和 fork 都保持该选择。更换模型需要新建执行者;出错时不会自动换通道。

`variant` 可以省略:沿用本机默认模型时继承保存的档位;显式切换到不同模型时,原有 Go DeepSeek 模型默认 `max`,其他模型使用运行时默认档位。显式传 `null` 可让任意模型使用运行时默认值;传字符串时必须是本机模型目录支持的档位。这两个 provider 中已配置到 OpenCode 目录的其他模型 ID 也可使用。
`variant` 可以省略:沿用本机默认模型时继承保存的档位;显式切换到不同 provider/model 且未指定档位时,所有外部模型都默认 `max`,包括 Go GLM、官方 Flash 和 Pro。同一模型的已保存档位优先,已保存的 `null` 也要保留;显式传 `null` 可让本次请求使用运行时默认值。传字符串时必须是本机模型目录支持的档位。这两个 provider 中已配置到 OpenCode 目录的其他模型 ID 也可使用。

走官方 API 时,在 OpenCode 中使用 `/connect → DeepSeek`,也可以运行 `opencode auth login`。另一种方式是在启动 Codex 前给宿主进程设置 `DEEPSEEK_API_KEY`,插件会传给 OpenCode。官方内置 provider 通常请求 `https://api.deepseek.com`,使用独立的 DeepSeek API 账号;工具执行和多轮上下文仍由 OpenCode 管理。插件不会改写 endpoint 或保存密钥。

Expand Down Expand Up @@ -156,7 +156,7 @@ npm --prefix plugins/deepseek-code-agent run test:live
如需完全使用 Codex 原生低成本通道,可以直接说:

```text
这段范围明确的实现用 Codex 原生 GPT-5.6 Luna,推理开到 medium。不要使用 OpenCode 或外部 Provider 凭据,结果由 Codex 审核并独立验证。
这段范围明确的实现用 Codex 原生 GPT-5.6 Luna,推理开到最大。不要使用 OpenCode 或外部 Provider 凭据,结果由 Codex 审核并独立验证。
```

使用原生 Luna 时,Codex 通过内置委派传入边界明确的任务和必要仓库上下文;使用 OpenCode 通道时,Codex 传入明确的 `scope_paths`、任务相关 `required_reads` 和精简的 `critical_constraints`。两种通道都由 Codex 独立审核 diff 与测试。
Expand Down
2 changes: 1 addition & 1 deletion plugins/deepseek-code-agent/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"Interactive"
],
"defaultPrompt": [
"Use Codex-native GPT-5.6 Luna with medium reasoning for this bounded implementation; do not use OpenCode or external credentials.",
"Use Codex-native GPT-5.6 Luna with maximum reasoning for this bounded implementation; do not use OpenCode or external credentials.",
"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."
Expand Down
4 changes: 2 additions & 2 deletions plugins/deepseek-code-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Before using an external worker on the other computer, run the plugin's `ds_chec

## Worker lane and model selection

For a bounded, low-risk native task, ask Codex to “use the native GPT-5.6 Luna subagent with medium reasoning.” That route uses the host's `gpt-5.6-luna` directly and does not call `ds_check`, `ds_spawn_agent`, OpenCode, or an external credential. It is task-scoped, is not accepted as a plugin `provider`, and is not persisted by `ds_model_defaults`. Host availability is checked when Codex creates the native subagent; failure never silently switches lanes.
For a bounded, low-risk native task, ask Codex to “use the native GPT-5.6 Luna subagent.” If no effort is stated, Codex must create it with `model="gpt-5.6-luna"` and `reasoning_effort="max"`; an explicit effort such as `medium` is passed unchanged. That route uses the host's model directly and does not call `ds_check`, `ds_spawn_agent`, OpenCode, or an external credential. It is task-scoped, is not accepted as a plugin `provider`, and is not persisted by `ds_model_defaults`. Host availability is checked when Codex creates the native subagent; failure never silently switches lanes.

[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 model uses its runtime default unless explicitly set; `variant=null` removes the override for any model.
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.

`ds_model_defaults` gets, sets or resets the persistent machine default for future OpenCode workers across Codex tasks. Natural language such as “make Go GLM 5.3 Flash with maximum reasoning my default” maps to a validated saved selection. `ds_check` and `ds_spawn_agent` inherit it when selection is omitted; explicit selections override it. The selected OpenCode model persists across queued follow-ups, restarts and forks. Checks report catalog/provider configuration without verifying a key or calling inference. Official API requests use separate DeepSeek credentials; connect through OpenCode `/connect`, or supply `DEEPSEEK_API_KEY` to the host before launch. There is no automatic provider fallback.

Expand Down
2 changes: 1 addition & 1 deletion plugins/deepseek-code-agent/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const modelOptions = {
},
variant: {
type: ["string", "null"], pattern: "^[A-Za-z0-9_-]+$",
description: "Reasoning variant supported by the selected model. Omitted resolves from the saved machine default when the provider/model pair matches it, else the runtime default (max only for Go deepseek-v4.1-flash). Explicit null uses the runtime default for any model.",
description: "Reasoning variant supported by the selected model. Omitted resolves from the saved machine default when the provider/model pair matches it, else max. Explicit null uses the runtime default for any model.",
},
};
const modelDefaultsSchema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Use the queen where its judgment most affects quality: intent, acceptance criter
## Select the worker lane and model

- 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.
- For native Luna, use Codex's native subagent capability with `model="gpt-5.6-luna"` and the requested supported reasoning effort. 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.
- Map native “推理最大 / 最高 / 拉满 / max” to `reasoning_effort="max"`, “高 / high” to `high`, “中 / medium” to `medium`, “低 / low” to `low`, and “默认档位 / 自动” to omission. Never silently lower an unsupported effort.
- 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.
- 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.

- Accept ordinary language. “OpenCode Go / Go 套餐” selects `opencode-go`; “GLM 5.3 Flash” selects `glm-5.3-flash`; “官方 DeepSeek / DeepSeek API” selects `deepseek`, with Flash model `deepseek-flash`. Preserve other explicitly named model IDs and validate the catalog.
- Map “推理最大 / 最高 / 拉满 / max” to `variant="max"`, “高 / high” to `high`, “低 / low” to `low`, and “默认档位 / 自动” to `null`. `high` does not satisfy a request for maximum reasoning. Never silently lower an unsupported variant.
- Map “推理最大 / 最高 / 拉满 / max” to `variant="max"`, “高 / high” to `high`, “低 / low” to `low`, and “默认档位 / 自动” to `null`. When an external provider or model is explicitly selected without a variant, resolve the omitted variant to `max`; only an explicitly supplied `variant=null` asks the runtime to choose. `high` does not satisfy a request for maximum reasoning. Never silently lower an unsupported variant.
- The chosen interaction convention is that a standalone model/effort-setting request, such as “使用 OpenCode Go 里面的 GLM 5.3 Flash,推理开到最大”, saves the machine default through `ds_model_defaults(action="set", ...)`. “以后 / 全局 / 所有新执行者” also means persistent. Preserve scope the user already established. “这次 / 当前任务” or a model choice attached to a specific coding task overrides that task's new workers only: pass the full selection on their spawns without saving global defaults.
- After setting an external default, report the resolved provider, model, variant and scope briefly. It covers this plugin's subsequently created OpenCode workers on this machine, including future Codex tasks; existing workers keep their selection. It does not change the Codex controller model or native Luna. Use `action="get"` for “查看当前 OpenCode Worker 默认模型” and `action="reset"` for “恢复插件原来的默认模型”.
- With no explicit task selection, let check/spawn inherit the saved machine default rather than passing hardcoded model arguments. With no saved preference, the built-in default remains `opencode-go/deepseek-v4.1-flash` with `max`. Call `ds_check` with the same overrides and workspace before first use of that configuration; its `ok` means configured and listed, not verified credentials or inference.
- With no explicit task selection, let check/spawn inherit the saved machine default rather than passing hardcoded model arguments. With no saved preference, the built-in default remains `opencode-go/deepseek-v4.1-flash` with `max`; an explicit provider/model switch that omits `variant` also resolves to `max`. A saved default for the same provider/model pair still wins, including a saved `null`; an explicit `variant` or `variant=null` always wins over saved settings. Call `ds_check` with the same overrides and workspace before first use of that configuration; its `ok` means configured and listed, not verified credentials or inference.
- Follow-ups, queued messages and forks preserve their own stored selection, including after a global-default change. Start a new worker when the task explicitly changes model. Never silently switch provider or model after a failure or quota limit.
- Both external providers use OpenCode as the agent runtime; the official provider uses separate DeepSeek API credentials. Read [worker lane, model selection and setup](references/model-selection.md) for native/external boundaries, precedence, authentication, CLI examples or missing models. Keep keys out of prompts and manifests.

Expand All @@ -45,7 +45,7 @@ Choose the route from how much judgment, risk, and exploration/verification burd

### Native Luna lane

1. Use the host-native subagent tool (`spawn_agent` when available) with `model="gpt-5.6-luna"`, the requested reasoning effort, 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.
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.

Expand Down
Loading
Loading