From 0c869d8b4783f3fe5649920a5f3611f919eb74a7 Mon Sep 17 00:00:00 2001 From: wishforge Date: Mon, 9 Nov 2026 01:15:28 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Default=20Copilot=20and=20Refine?= =?UTF-8?q?r=20to=20gateway=20model=20names=20without=20the=20[1m]=20suffi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/domain/copilot-model.ts | 2 +- apps/api/src/domain/wish-refiner.ts | 2 +- docs/copilot.md | 4 ++-- docs/development.md | 2 +- tests/wish-refiner.test.ts | 12 ++++++------ wiki/features/wish-submission-and-refinement.md | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/api/src/domain/copilot-model.ts b/apps/api/src/domain/copilot-model.ts index 616b2a2..66cbde6 100644 --- a/apps/api/src/domain/copilot-model.ts +++ b/apps/api/src/domain/copilot-model.ts @@ -4,7 +4,7 @@ * and a deployment that holds the tenant's credential and gateway can switch models without a code * change. */ -export const DEFAULT_COPILOT_MODEL = 'deepseek-flash@latest[1m]'; +export const DEFAULT_COPILOT_MODEL = 'deepseek-flash@latest'; /** * `WF_COPILOT_MODEL` names it for both; `WF_CLAUDE_ASK_MODEL` predates Copilot and stays the diff --git a/apps/api/src/domain/wish-refiner.ts b/apps/api/src/domain/wish-refiner.ts index 740f546..0661ed1 100644 --- a/apps/api/src/domain/wish-refiner.ts +++ b/apps/api/src/domain/wish-refiner.ts @@ -103,7 +103,7 @@ const FOCUS = { const CONCURRENCY = 2; /** Long enough for a model to finish the structured JSON; the console proxy waits for both attempts. */ const ASK_TIMEOUT_MS = 180_000; -const PRO = 'deepseek-pro@latest[1m]'; +const PRO = 'deepseek-pro@latest'; /** The small model first; the coding model if that one times out or returns JSON that does not parse. */ function askModels(env: NodeJS.ProcessEnv): string[] { const primary = copilotModel(env); diff --git a/docs/copilot.md b/docs/copilot.md index 2841a31..e4aa4d7 100644 --- a/docs/copilot.md +++ b/docs/copilot.md @@ -32,9 +32,9 @@ Copilot 和愿望优化走同一个模型通道:每次调用都显式带 `--mo | 设置 | 作用 | 默认 | | --- | --- | --- | -| `WF_COPILOT_MODEL` | Copilot 回答与愿望优化使用的模型 | `deepseek-flash@latest[1m]` | +| `WF_COPILOT_MODEL` | Copilot 回答与愿望优化使用的模型 | `deepseek-flash@latest` | | `WF_CLAUDE_ASK_MODEL` | 同一设置的旧名,仍可用;`WF_COPILOT_MODEL` 优先 | — | -| `WF_CLAUDE_ASK_FALLBACK_MODEL` | 愿望优化首次超时或返回的 JSON 不可用时的兜底模型 | `deepseek-pro@latest[1m]` | +| `WF_CLAUDE_ASK_FALLBACK_MODEL` | 愿望优化首次超时或返回的 JSON 不可用时的兜底模型 | `deepseek-pro@latest` | | `WF_ANTHROPIC_BASE_URL` | Claude Code 使用的 Anthropic 兼容网关 | 官方地址 | | `WF_CLAUDE_BIN` | `claude` 可执行文件;没有它 Copilot 和优化都不可用 | — | diff --git a/docs/development.md b/docs/development.md index 861900a..510794b 100644 --- a/docs/development.md +++ b/docs/development.md @@ -69,7 +69,7 @@ Temporal 控制台在 http://127.0.0.1:8233,可以看到每个运行的工作 - **使用公司的模型网关**:在 `.env.local` 中设置下面三个变量,再在「执行器」页保存网关的 Key。 - `WF_OPENAI_BASE_URL`:Codex 使用的 OpenAI 兼容网关,需支持 `/responses`,例如 `https://<网关>/v1`; - `WF_ANTHROPIC_BASE_URL`:Claude Code 使用的 Anthropic 兼容网关,例如 `https://<网关>`; - - `WF_COPILOT_MODEL`:项目 Copilot 与愿望优化使用的模型,默认 `deepseek-flash@latest[1m]`(旧名 `WF_CLAUDE_ASK_MODEL`,见 `docs/copilot.md`); + - `WF_COPILOT_MODEL`:项目 Copilot 与愿望优化使用的模型,默认 `deepseek-flash@latest`(旧名 `WF_CLAUDE_ASK_MODEL`,见 `docs/copilot.md`); - `WF_CODEX_DEFAULT_MODEL`:网关提供的模型,可用 `GET <网关>/v1/models` 查看。 4. 进入「运行记录」,提交愿望:写清目标和至少一条验收标准。 5. 在运行详情页观察: diff --git a/tests/wish-refiner.test.ts b/tests/wish-refiner.test.ts index 0e9f314..17e3ae5 100644 --- a/tests/wish-refiner.test.ts +++ b/tests/wish-refiner.test.ts @@ -88,7 +88,7 @@ describe('wish optimization', () => { expect(asked[0]).toMatchObject({ binary: '/usr/local/bin/claude', home: '/Users/operator', - model: 'deepseek-flash@latest[1m]', + model: 'deepseek-flash@latest', timeoutMs: 180_000, }); }); @@ -121,13 +121,13 @@ describe('wish optimization', () => { expect(await refiner.refine(owner, projectId, { goal: '下载文件名要带上类型' })).toMatchObject({ goal: expect.stringContaining('xxx-episode.zip'), }); - expect(asked.map(call => call.model)).toEqual(['deepseek-flash@latest[1m]', 'deepseek-pro@latest[1m]']); + expect(asked.map(call => call.model)).toEqual(['deepseek-flash@latest', 'deepseek-pro@latest']); const unusable = new WishRefiner(store, env, async input => { asked.push(input); return asked.length === 4 ? usable : { goal: '', acceptanceCriteria: 'none' }; }); await unusable.refine(owner, projectId, { goal: '下载文件名要带上类型' }); - expect(asked.slice(2).map(call => call.model)).toEqual(['deepseek-flash@latest[1m]', 'deepseek-pro@latest[1m]']); + expect(asked.slice(2).map(call => call.model)).toEqual(['deepseek-flash@latest', 'deepseek-pro@latest']); }); it('optimizes in production from the platform model connection, with no local login', async () => { // Sealed where connections are made; the deployed call only ever sees its id. @@ -160,11 +160,11 @@ describe('wish optimization', () => { expect(await refiner.available('demo')).toBe(true); await refiner.refine(owner, projectId, { goal: '下载文件名要带上类型' }); expect(asked[0]).not.toHaveProperty('home'); - expect(asked[0]!.model).toBe('deepseek-flash@latest[1m]'); + expect(asked[0]!.model).toBe('deepseek-flash@latest'); expect(asked[0]!.credentialEnv).toStrictEqual({ ANTHROPIC_API_KEY: 'tenant-fixture-key', - ANTHROPIC_MODEL: 'deepseek-flash@latest[1m]', - ANTHROPIC_SMALL_FAST_MODEL: 'deepseek-flash@latest[1m]', + ANTHROPIC_MODEL: 'deepseek-flash@latest', + ANTHROPIC_SMALL_FAST_MODEL: 'deepseek-flash@latest', ANTHROPIC_BASE_URL: 'https://model.example', }); }); diff --git a/wiki/features/wish-submission-and-refinement.md b/wiki/features/wish-submission-and-refinement.md index da5a4a8..636d985 100644 --- a/wiki/features/wish-submission-and-refinement.md +++ b/wiki/features/wish-submission-and-refinement.md @@ -25,7 +25,7 @@ `POST /v1/projects/:id/wish-refinements`(`apps/api/src/http.ts:409`)调用 `WishRefiner`(`apps/api/src/domain/wish-refiner.ts:113`)。行为要点: - 使用项目规则与内置 `WISH_RULES` 一起改写草稿(`apps/api/src/domain/wish-refiner.ts:10`)。 -- 首选模型是 `deepseek-flash@latest[1m]`,失败后回退到 `deepseek-pro@latest[1m]`;两个模型都可由环境变量覆盖(`apps/api/src/domain/wish-refiner.ts:98-104`)。 +- 首选模型是 `deepseek-flash@latest`,失败后回退到 `deepseek-pro@latest`;两个模型都可由环境变量覆盖(`apps/api/src/domain/wish-refiner.ts:98-104`)。 - 返回不可用时明确报错,而不是伪造一份「优化后的愿望」(`tests/wish-refiner.test.ts:131`)。 ## 模型白名单