@migor/cli 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -1
- package/dist/AGENTS.md +1 -1
- package/dist/templates.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@
|
|
|
5
5
|
(0.x 阶段:minor 可含破坏性变更,每个破坏性变更都在对应版本的「迁移」小节里写明)。
|
|
6
6
|
决策的完整证据链在 `docs/spec.md` §10(带时间线的决策日志)。
|
|
7
7
|
|
|
8
|
+
## [0.6.3] - 2026-09-18
|
|
9
|
+
|
|
10
|
+
> 本版主题:把第六轮 16 条的共同根因(「约定写在文档里、但没有门禁」)收口 ——
|
|
11
|
+
> 守卫注册表 + 三个新架构守卫 + 适配器对拍矩阵;`exactOptionalPropertyTypes` 全量迁移;
|
|
12
|
+
> OpenAI 适配器补齐客户端内层重试(与 anthropic 对称)。**无破坏性变更**。
|
|
13
|
+
|
|
14
|
+
### 新增(守卫基建 + 适配器对齐)
|
|
15
|
+
|
|
16
|
+
- **守卫注册表 `docs/guards.md`**:「哪类危险由谁守」的单源清单(§1 已挂守卫 → 保护的
|
|
17
|
+
不变量 → 退化后果;§2 待守缺口;§3 写法纪律),配套 PR 模板的「危险类自查 5 问」。
|
|
18
|
+
- **两个新架构守卫**:`tests/architecture/transport-errors.test.ts`(`integrations` 的
|
|
19
|
+
传输抛错必须带数值 `status`,否则 `classifyError` 判 unknown、重试层静默失效 ——
|
|
20
|
+
上线当天即抓到 `otlp.ts` 的同形漏网)与 `tests/architecture/tsconfig-strictness.test.ts`
|
|
21
|
+
(`exactOptionalPropertyTypes` / `strict` / `types:["node"]` 三个承重开关不得被关)。
|
|
22
|
+
另有元守卫 `tests/docs/guards-registry.test.ts` 防注册表本身腐化。
|
|
23
|
+
- **`OpenAIClientOptions.maxRetries`(缺省 2)**:OpenAI 适配器补齐**客户端内层重试**
|
|
24
|
+
(408/409/429/5xx + `retry-after` 尊重,与 `createAnthropicClient` 逐字对齐)——
|
|
25
|
+
此前同一个 429 在 anthropic 打 3 次网络请求、在 openai 只打 1 次(引擎层那一次)。
|
|
26
|
+
对称性由 `tests/integrations/adapter-parity.test.ts` 守住(一份场景表跑两侧 + 跨侧
|
|
27
|
+
对称断言)。
|
|
28
|
+
- **`exactOptionalPropertyTypes` 开启并完成迁移**(39 处 `error TS` 全清):结果/状态
|
|
29
|
+
记录改必填 `T | undefined`、内部管道 `?: T | undefined`、**公共入参签名不动**(调用点
|
|
30
|
+
条件展开或 `omitUndefined`)。「显式 undefined ≠ 不传」从此是类型级约束 ——
|
|
31
|
+
`retry: { maxAttempts: undefined }` 静默关重试这类写法在编译期就写不出来。
|
|
32
|
+
|
|
33
|
+
### 修复
|
|
34
|
+
|
|
35
|
+
- **`createOtlpExporter` 非 2xx 改抛 `OtlpExportError`**(带数值 `status`):此前裸
|
|
36
|
+
`Error` 会被 `classifyError` 判 `unknown` + 不可重试(与 OpenAI 适配器同形的病,
|
|
37
|
+
由新守卫抓到)。
|
|
38
|
+
|
|
39
|
+
### 重构
|
|
40
|
+
|
|
41
|
+
- 两条适配器的 client 层退避(`backoffMs` / `interruptibleSleep`)单源收进
|
|
42
|
+
`core/timeout.ts` —— 此前曾短暂存在 anthropic / openai 两份逐字副本;「不与引擎层
|
|
43
|
+
`backoffDelay` 合并」的例外仍在(±25%+retry-after vs ±20%,策略不同)。
|
|
44
|
+
|
|
8
45
|
## [0.6.2] - 2026-09-18
|
|
9
46
|
|
|
10
47
|
> 本版主题:第六轮全量 review 收口 —— 16 条「不报错地不干活」修复(含两处**语义变更**,见下)、
|
|
@@ -331,7 +368,8 @@
|
|
|
331
368
|
首个公开发布:`@migor/agentia` + `@migor/cli`(scope `@migor/*`),两包版本同步。
|
|
332
369
|
框架本体单包;CLI 独立成包(workspaces)。
|
|
333
370
|
|
|
334
|
-
[Unreleased]: https://github.com/retrychx/agentia/compare/v0.6.
|
|
371
|
+
[Unreleased]: https://github.com/retrychx/agentia/compare/v0.6.3...HEAD
|
|
372
|
+
[0.6.3]: https://github.com/retrychx/agentia/releases/tag/v0.6.3
|
|
335
373
|
[0.6.2]: https://github.com/retrychx/agentia/releases/tag/v0.6.2
|
|
336
374
|
[0.6.1]: https://github.com/retrychx/agentia/releases/tag/v0.6.1
|
|
337
375
|
[0.6.0]: https://github.com/retrychx/agentia/releases/tag/v0.6.0
|
package/dist/AGENTS.md
CHANGED
|
@@ -450,7 +450,7 @@ process.on('SIGTERM', async () => {
|
|
|
450
450
|
| `mapWithConcurrency` | 有界并发 map(结果保序);`maxToolConcurrency` 的底座,也可自用 |
|
|
451
451
|
|
|
452
452
|
- **取消**:`app.run(messages, { signal })` 传 `AbortSignal` —— 框架会 abort 在飞请求(内置 Anthropic / OpenAI 适配器都转发 `signal`),run 以 `stopReason='aborted'` 收尾(算失败)。`createHttpHandler` 已内置「客户端断开即中止」;`AsyncRunner.runTimeoutMs` 到点同样是**真中止**(构造期校验:必须 ≥ 0 的**有限**数 —— NaN/Infinity 会被 `setTimeout` 钳到 1ms,等于每个任务立即超时,故直接抛错;要「不限」传 0 或不设)。
|
|
453
|
-
- **重试**:缺省自动重试可重试失败(429 / 5xx / 连接失败),指数退避 + 抖动。`retry: false` 关闭,或 `retry: { maxAttempts, baseDelayMs, maxDelayMs, jitter, onRetry }` 调参。**只在本次尝试尚未产出任何文本时重试**(已吐出的字无法撤回)。⚠️ 与底层 client
|
|
453
|
+
- **重试**:缺省自动重试可重试失败(429 / 5xx / 连接失败),指数退避 + 抖动。`retry: false` 关闭,或 `retry: { maxAttempts, baseDelayMs, maxDelayMs, jitter, onRetry }` 调参。**只在本次尝试尚未产出任何文本时重试**(已吐出的字无法撤回)。⚠️ 与底层 client 的**内置重试**叠加 —— **两条内置适配器口径一致**(`createAnthropicClient` / `createOpenAIClient` 都有 `maxRetries`,缺省 2,重试同一状态码集合 408/409/429/5xx)—— 建议二选一调(这里 `maxAttempts: 1`,或 `<适配器>({ maxRetries: 0 })`)。
|
|
454
454
|
- **流式**:`POST /run` 带 `Accept: text/event-stream` → SSE 逐帧下发(`text.delta` / `run.end` / `error`);不带该头仍回一元 JSON。
|
|
455
455
|
- **工具超时 / 并发闸门**:`toolTimeoutMs` 超时**不杀 run**(该条 tool_result 记 `is_error`,模型可换路);`maxToolConcurrency` 给同回合的并行工具设上限(默认全并行)。⚠️ 超时 = **放弃等待**,`AgentTool.run` 没有 signal 参数,**副作用可能已发生** —— 想真停的工具请自行读 `ToolRunContext.signal`。**超时判定只有一个裁判**:`toolTimeoutMs` 是唯一判据 —— 工具自带的超时(如 MCP 桥的 `timeoutMs`)在设了本项时**不参与**判定;反过来说,工具自判的超时(抛 `code='timeout'` 的错误)与引擎判的记**同一类账**(`errorKind='timeout'`),并同样回 `is_error`。
|
|
456
456
|
|
package/dist/templates.js
CHANGED
|
@@ -62,7 +62,7 @@ export function projectPackageJson(name) {
|
|
|
62
62
|
start: 'node dist/main.js',
|
|
63
63
|
typecheck: 'tsc --noEmit -p tsconfig.json',
|
|
64
64
|
},
|
|
65
|
-
dependencies: { '@migor/agentia': '^0.6.
|
|
65
|
+
dependencies: { '@migor/agentia': '^0.6.3' },
|
|
66
66
|
devDependencies: {
|
|
67
67
|
tsx: '^4.19.0',
|
|
68
68
|
typescript: '^7.0.2',
|