From 12c0f4c6181bc0d24479c091b7c7c4f2abaf5d3f Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:11:18 +0800 Subject: [PATCH] docs: v3 spec for startup env config + inline model selector Co-Authored-By: Claude Fable 5 --- ...26-07-23-cell-toolbar-actions-v3-design.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/superpowers/specs/2026-07-23-cell-toolbar-actions-v3-design.md diff --git a/docs/superpowers/specs/2026-07-23-cell-toolbar-actions-v3-design.md b/docs/superpowers/specs/2026-07-23-cell-toolbar-actions-v3-design.md new file mode 100644 index 0000000..b64cf0f --- /dev/null +++ b/docs/superpowers/specs/2026-07-23-cell-toolbar-actions-v3-design.md @@ -0,0 +1,67 @@ +# Cell Toolbar Actions v3 — 启动时配置 + 模型选择器 + +- 日期: 2026-07-23 +- 状态: 已批准(用户于 2026-07-23 确认) +- 取代: v2 `OpenCodeSettings` 范围(commit d03f0fa)。本轮把 4 个 server 连接字段全部移出 JupyterLab Settings(改走启动 env),并在 inline 输入框增加模型选择器。 + +## 背景 + +v2 之后用户提了 2 个调整: + +1. **`opencodeServerUrl` / `User` / `Password` / `requestTimeoutSeconds` 不再在 JupyterLab Settings Editor 里配** —— 全部在启动 jupyter server 时通过环境变量指定(`OPENCODE_BRIDGE_URL` / `_USER` / `_PASSWORD` / `_TIMEOUT`)。Settings Editor 只保留 `opencodeProvider` / `opencodeModel`(给模型选择器作默认选中)。 +2. **inline 输入框增加模型选择器** —— 用户可以在每次请求时挑 provider/model,覆盖 settings 默认值。 + +## 决策 + +| 维度 | 决策 | +|---|---| +| 启动 env(4 个) | `OPENCODE_BRIDGE_URL` / `_USER` / `_PASSWORD` / `_TIMEOUT`(秒,默认 120);在 `jupyter lab` 启动前 export;`config.py` `resolve_config` 走 `os.environ.get(ENV) or DEFAULT`,不再从 JupyterLab settings 兜底 | +| JupyterLab Settings(只剩 2 个) | `opencodeProvider` / `opencodeModel` —— 给模型选择器作默认选中 | +| `OpenCodeSettings` 前端类型 | 缩为 `{ opencodeProvider: string; opencodeModel: string }` | +| 模型选择器 UI | inline 面板顶部加一行 `模型: