clavue-v1 1.4.0 → 1.6.0

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 CHANGED
@@ -4,6 +4,31 @@ clavue / 克拉维 发布说明。本文件在构建时注入运行时,驱动
4
4
 
5
5
  格式约定(`parseChangelog` 依赖):二级标题为 `## <版本> - <日期>`,条目以 `- ` 开头,一行一条,命令与模型名保留英文。
6
6
 
7
+ ## 1.6.0 - 2026-09-03
8
+
9
+ - 启动时弹出升级对话框:发现新版本后可在对话框内用 Ctrl+U / Enter 立即安装,Esc 本次跳过;开发树与 headless 不弹
10
+ - 新增 `/update`:检查并安装最新 clavue-v1,成功后提示退出重开
11
+ - npm 版本查询与全局安装改为包名 clavue-v1,不再误查 clavue
12
+ - 流中途断开后自动续写:已产出的内容保留,不再整轮重发;与输出截断恢复共享 3 次预算,`CLAVUE_STREAM_CUT_RESUME=0` 关闭
13
+ - 被截断的工具调用若参数完整则照常执行,不完整则丢弃并要求重发
14
+ - 工具调用死循环守卫:相同调用、相同结果连续 3 次提醒模型换路,5 次中止本轮;`CLAVUE_TOOL_LOOP_WARN` / `CLAVUE_TOOL_LOOP_ABORT` / `CLAVUE_TOOL_LOOP_GUARD=0`
15
+ - 槽位回退链:`CLAVUE_COMBO_MAIN=deepseek-v4,glm-5.3` 逗号分隔即回退链,模型不存在 / 过载耗尽 / 连续 5xx 时会话内粘性切换到下一个并提示一次;`/provider current` 与仪表盘显示当前位置;`CLAVUE_COMBO_CHAIN=0` 关闭
16
+ - 每槽位 effort:`CLAVUE_COMBO_<SLOT>_EFFORT=low|medium|high|xhigh|max` 对任意模型下发(Anthropic 方言 `output_config.effort`,Responses 方言 `reasoning.effort`),被 400 拒绝即去掉重试并记住该模型;`/effort` 仍只作用于 main 槽
17
+ - 失控预算(默认开启):`CLAVUE_MAX_CONCURRENT_SUBAGENTS`(默认 20)、`CLAVUE_MAX_SUBAGENTS_PER_SESSION`(默认 200,`/clear` 重置)、`CLAVUE_MAX_SUBAGENT_SPAWN_DEPTH`(默认 3)、`CLAVUE_MAX_WEB_SEARCHES_PER_SESSION`(默认 200);超限返回预算错误而非故障,`CLAVUE_RUNAWAY_BUDGETS=0` 关闭
18
+ - 子代理碰到 `maxTurns` 时父代理看到的内容以 `[partial]` 开头,并提示可通过 SendMessage 续接,不再伪装成已完成
19
+ - `/tasks` 与代理详情显示每个子代理的槽位 · 模型 · effort
20
+ - 网关鲁棒性(默认开启,`CLAVUE_GATEWAY_NORMALIZE=0` 关闭):流中 `tool_use` 缺 `id` 时补 `toolu_clavue_<n>`,缺 `name` 时降级为文本;非流式回退丢弃缺字段的 thinking/text 块而不崩溃
21
+ - 恢复会话时清洗孤儿 `tool_result`、补齐缺失结果、剔除空 content 与非法块类型;有修复时一行提示「已修复 N 处历史记录问题」,不改写其他 CLI 的源文件
22
+ - 非流式整轮重发只允许零字节输出(无 `message_start` 或无 `content_block_start`);已产出内容走流中断续写,避免双倍计费
23
+ - idle watchdog 把 SSE 注释行与 `event: ping` 心跳视为活动,避免自定义网关 keep-alive 被误杀
24
+ - `/cost` 增加缓存命中率 / miss / 重缓存 / 冷热一行;statusline JSON 增加 `prompt_cache`;前缀因 tools / system / model / effort / betas 变化时按类别首次提示一行,`/doctor` 列出最近 5 次;`CLAVUE_CACHE_PREFIX_GUARD=0` 关闭观察与提示
25
+
26
+ ## 1.5.0 - 2026-09-02
27
+
28
+ - 新增 `/resume-codex`、`/resume-claude`、`/resume-grok`:列出其他 CLI 在当前项目的会话,`latest / 序号 / id 前缀 / 标题关键词` 一键导入并在 Clavue 中接续;`--all` 浏览所有项目
29
+ - 导入只读取来源文件:Codex `~/.codex/sessions` rollout、Claude Code `~/.claude/projects`、Grok Build `~/.grok/sessions`(含 sqlite 索引),过滤 AGENTS.md / environment_context 等注入内容
30
+ - `/resume` 找不到会话时提示跨工具导入命令
31
+
7
32
  ## 1.4.0 - 2026-09-02
8
33
 
9
34
  - 启动画面改为 clavue 仪表盘:`路由`(Provider · 主机 · 有效模型 · effort)、`槽位`(四个 `CLAVUE_COMBO_*`)、`公告`、`最近会话`、`新特性`
package/README.md CHANGED
@@ -65,8 +65,8 @@ npx -y clavue-v1
65
65
  Run a specific version with `npx`:
66
66
 
67
67
  ```bash
68
- npx -y clavue-v1@1.4.0 --version
69
- npx -y clavue-v1@1.4.0
68
+ npx -y clavue-v1@1.6.0 --version
69
+ npx -y clavue-v1@1.6.0
70
70
  ```
71
71
 
72
72
  Install globally from npm when you want the `clavue-v1` command to stay available:
@@ -88,7 +88,7 @@ curl -fsSL https://unpkg.com/clavue-v1/install.sh | bash
88
88
  Install a specific version globally:
89
89
 
90
90
  ```bash
91
- curl -fsSL https://unpkg.com/clavue-v1@1.4.0/install.sh | bash -s -- 1.4.0
91
+ curl -fsSL https://unpkg.com/clavue-v1@1.6.0/install.sh | bash -s -- 1.6.0
92
92
  ```
93
93
 
94
94
  ## Quick Start: Official Clavue Cloud
@@ -181,6 +181,17 @@ The startup box is a single-column dashboard rather than a marketing panel. Unde
181
181
  - Provider smoke-test sessions (`Reply with exactly: OK`, `ping`, …) are hidden from `最近会话`.
182
182
  - The full dashboard appears after an upgrade or during project onboarding; routine startups use the condensed header. Set `CLAVUE_FORCE_FULL_LOGO=1` to always show it.
183
183
 
184
+ ### Startup update / 启动升级
185
+
186
+ Interactive TUI sessions check npm for a newer `clavue-v1` after first paint (the check does not block the first frame). If an update is available, a Chinese dialog offers in-place install:
187
+
188
+ ```text
189
+ 发现新版本 1.6.0(当前 1.5.0)
190
+ Ctrl+U / Enter 立即升级 · Esc 本次跳过 · /update 随时再来
191
+ ```
192
+
193
+ npm global/local and native installs apply in-process. Package-manager and `npx` sessions show the exact command (`brew upgrade clavue`, `npx -y clavue-v1@latest`) instead of running `npm i -g`. `/update` repeats the same check from the prompt. Set `CLAVUE_STARTUP_UPDATE_PROMPT=0` to hide the dialog; silent auto-install then follows the existing updater unless `DISABLE_AUTOUPDATER` is set.
194
+
184
195
  ### Data sharing (帮助改进 Clavue)
185
196
 
186
197
  Sessions that run on the **official Clavue cloud** (`api.clavue.com`) are used to improve Clavue models, in the same shape as Claude and Grok: participation is on by default, the CLI tells you once at startup, and you can turn it off at any time.
@@ -246,6 +257,28 @@ CLAVUE_COMBO_REVIEW_GRACE_MS=5000 # bounded wait for the final verdict at
246
257
  CLAVUE_COMBO_REVIEW_FIX_LOOP=1 # opt-in: a chain-end "P0:" verdict grants one bounded fix turn
247
258
  ```
248
259
 
260
+ ### Slot chains and per-slot effort
261
+
262
+ Each `CLAVUE_COMBO_<SLOT>` value may be a comma-separated fallback chain.
263
+ The first model is primary; on 404 / model-not-found, exhausted 529 overload,
264
+ or exhausted 5xx the session sticks to the next element and prints one Chinese
265
+ warning. `/provider current` and the dashboard slot row show `a → b (当前 2/2)`.
266
+ `CLAVUE_COMBO_CHAIN=0` keeps the first element only. `--fallback-model` still
267
+ applies when no `main` chain is set.
268
+
269
+ ```bash
270
+ CLAVUE_COMBO_MAIN=deepseek-v4,glm-5.3
271
+ CLAVUE_COMBO_REVIEW=gpt-5.4,claude-sonnet-4-6
272
+ CLAVUE_COMBO_MAIN_EFFORT=xhigh # low|medium|high|xhigh|max; any model string
273
+ CLAVUE_COMBO_REVIEW_EFFORT=medium # plan/review/light hops use their own slot
274
+ # CLAVUE_COMBO_CHAIN=0 # disable sticky advancing
275
+ # CLAVUE_SLOT_EFFORT_LEARN=0 # do not remember effort-parameter 400s
276
+ ```
277
+
278
+ Slot effort is sent as Anthropic `output_config.effort` (Responses dialect maps
279
+ it to `reasoning.effort`). A 400 that names effort is retried once without it
280
+ and remembered for the process. `/effort` still only affects the `main` slot.
281
+
249
282
  - `overlap` fires the review hop without blocking; the verdict is injected
250
283
  at the next loop boundary so the developer model actually acts on it.
251
284
  In the shipped A/B it roughly halves the review tax versus `serial`
@@ -299,7 +332,7 @@ Version check:
299
332
 
300
333
  ```bash
301
334
  npx -y clavue-v1 --version
302
- npx -y clavue-v1@1.4.0 --version
335
+ npx -y clavue-v1@1.6.0 --version
303
336
  # available after a global install
304
337
  clavue-v1 --version
305
338
  ```
@@ -335,6 +368,62 @@ Canonical configuration names:
335
368
 
336
369
  ## In-Session Workflows
337
370
 
371
+ ### Turn reliability guards
372
+
373
+ Turns resume instead of silently completing or re-billing when a stream dies after content has already arrived. Incomplete tool calls are dropped and re-asked; complete ones still run. A loop of the same tool, same arguments, and same result warns the model at 3 repeats and aborts the turn at 5.
374
+
375
+ ```text
376
+ CLAVUE_STREAM_CUT_RESUME=0 disable stream-cut continuation (default on)
377
+ CLAVUE_TOOL_LOOP_GUARD=0 disable the tool-call loop guard (default on)
378
+ CLAVUE_TOOL_LOOP_WARN=3 warn after N identical repeats
379
+ CLAVUE_TOOL_LOOP_ABORT=5 abort the turn after N identical repeats
380
+ ```
381
+
382
+ ### Cache economics
383
+
384
+ `/cost` prints a cache line (`命中率` · `miss` · `重缓存` · `热`/`冷`) from session cache-read and cache-write tokens. Statusline JSON includes `prompt_cache: { hit_ratio, misses, recached_tokens, state }` when the guard is on. A prefix-stability observer hashes the finalized system prompt, tools, model, effort, and betas (reusing the existing break-detection hashes) and records the last five changes. The first change of each category in a process prints one dim Chinese line; `/doctor` lists `category summary`. The guard observes only — it never mutates the request.
385
+
386
+ ```text
387
+ CLAVUE_CACHE_PREFIX_GUARD=0 disable prefix observation and notices (default on)
388
+ ```
389
+
390
+ ### Gateway robustness
391
+
392
+ Third-party gateways sometimes omit `tool_use.id` / `name`, return thinking/text blocks with missing fields, or write illegal content into a session JSONL. Clavue fills missing ids as `toolu_clavue_<n>`, downgrades nameless tool calls to text, drops malformed blocks on the non-streaming fallback, and repairs in-memory history on `/resume` / `--continue` (one Chinese line: `已修复 N 处历史记录问题`). A full non-streaming retry is allowed only for zero-byte streams; content-bearing cuts resume instead of double-billing. SSE comments and `event: ping` keep the idle watchdog alive.
393
+
394
+ ```text
395
+ CLAVUE_GATEWAY_NORMALIZE=0 disable gateway repairs (default on)
396
+ ```
397
+
398
+ ### Runaway budgets
399
+
400
+ Caps stop a session from spawning unbounded nested agents or burning the search quota. Over-limit tool errors name the budget (not a crash) and the env var to raise. `/clear` resets session totals; in-flight children are not killed. A subagent that hits `maxTurns` returns `[partial]` so the parent can continue it with SendMessage. `/tasks` shows slot · model · effort on each agent row.
401
+
402
+ ```text
403
+ CLAVUE_MAX_CONCURRENT_SUBAGENTS=20 live children (0 = unlimited)
404
+ CLAVUE_MAX_SUBAGENTS_PER_SESSION=200 spawned this session (0 = unlimited)
405
+ CLAVUE_MAX_SUBAGENT_SPAWN_DEPTH=3 nest depth (0 = unlimited)
406
+ CLAVUE_MAX_WEB_SEARCHES_PER_SESSION=200 WebSearch calls (0 = unlimited)
407
+ CLAVUE_RUNAWAY_BUDGETS=0 disable every cap
408
+ ```
409
+
410
+ ### Resume sessions from other CLIs
411
+
412
+ Work that started in Codex, Claude Code, or Grok Build can be continued in Clavue without copying anything by hand. Each product gets its own command; with no argument it lists that product's sessions for the current project, with a reference it imports the transcript and hands the model a condensed continuation seed.
413
+
414
+ ```text
415
+ /resume-codex list Codex sessions for this project (newest first)
416
+ /resume-codex --all browse every project
417
+ /resume-codex latest import the newest one and continue here
418
+ /resume-codex 3 by list position
419
+ /resume-codex 019f58 by id prefix
420
+ /resume-codex 限流 上线 by words in the title
421
+ /resume-claude … same for Claude Code's own session store
422
+ /resume-grok … same for Grok Build (directory store or sqlite index)
423
+ ```
424
+
425
+ The other product's files are read-only; Clavue never writes to their directories. The seed carries the recent turns (tool payloads clipped), the tools and files that were touched, and an instruction to summarize first and never re-run recorded commands blindly. Harness-injected pseudo-user turns (`# AGENTS.md instructions`, `<environment_context>`, IDE context blocks) are dropped. Plain `/resume` still restores Clavue's own sessions and points to these commands when nothing matches.
426
+
338
427
  `/provider` manages saved profiles, current environment state, API URL, credential type, and model-slot routing from one place. Use it when you want to switch, validate, repair, or save the active route.
339
428
 
340
429
  ```text
@@ -369,7 +458,7 @@ Typing `agent teams` at the start of a prompt opens the same native `/team` flow
369
458
  `/goal` turns a one-line objective into a durable mission. Clavue writes a ledger under `.clavue/goals/`, defines the plan itself, and keeps working across turns until evidence proves the objective, the budget runs out, or a real blocker appears. The loop is bounded: 20 auto-continued turns or 6 hours, whichever comes first. Exhaustion pauses the goal with an explicit `budget_exhausted` event; `/goal resume` grants a fresh budget. Completion is refused until at least one piece of evidence is on record, and starting a new goal supersedes the live one with an audit event.
370
459
 
371
460
  ```text
372
- /goal ship the 1.4.0 release and verify npm, GitHub, and the website
461
+ /goal ship the 1.6.0 release and verify npm, GitHub, and the website
373
462
  /goal criteria npm run check passes on main
374
463
  /goal evidence npm run test:fast passed (24 files)
375
464
  /goal status
@@ -471,6 +560,7 @@ npm run package:release
471
560
  - `npm run check`: full local verification gate used by CI
472
561
  - `npm run build`: runs `check` and previews the publishable npm tarball with `npm pack --dry-run`
473
562
  - `npm run package:release`: runs `check` and produces archives in `release-artifacts/`
563
+ - Publishing: the `Release Clavue` workflow verifies and packages on tag push, but npm publishing currently runs from the maintainer machine: `cd "/Volumes/myhd 1/clavue-v1/clavue-v1" && npm publish --access public --registry https://registry.npmjs.org` (the explicit registry matters because the local default is an npm mirror). Configure a trusted publisher for `clavue-v1` on npmjs.com to let CI publish instead.
474
564
  - `npm run rebuild:experimental`: manual alias for `npm run verify:source-build`
475
565
  - `npm run rebuild:experimental:legacy`: older reconstruction path kept for manual investigation
476
566