🔧 Default Copilot and Refiner to gateway model names without the [1m] suffix

This commit is contained in:
wishforge 2026-11-09 01:15:28 -08:00
parent ef23f119cf
commit 0c869d8b47
6 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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);

View File

@ -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 和优化都不可用 | — |

View File

@ -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. 在运行详情页观察:

View File

@ -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',
});
});

View File

@ -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`)。
## 模型白名单