Skip to content

Commit 0f46729

Browse files
committed
release: v0.41.6 — archive pure-export + watchdog stays on duty
- Archive becomes a pure Markdown export; one-shot idempotent migration un-hides legacy soft-archived sessions (Issue #169 / PR #170). - Watchdog turns now track read_terminal targets in run._monitoredBgJobs so the BG_WAIT_SKIPPED_MODEL_DONE guard no longer cuts off long-running monitoring turns started in an earlier turn. - Migration failures route through Logger (replacing console.warn). - .vscodeignore filters .tmp-*.json/.txt/.md to keep PR-review scratch caches out of the shipped VSIX. Release notes: release/notes_v0416.md
1 parent 8358728 commit 0f46729

3 files changed

Lines changed: 134 additions & 4 deletions

File tree

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
session-*.log
1212
**/*.map
1313
release/**
14+
# Local PR-review scratch caches (GH API dumps); must never ship in the VSIX
15+
.tmp-*.json
16+
.tmp-*.txt
17+
.tmp-*.md
1418

1519
# 源码(已通过 esbuild 打包到 out/)
1620
src/**

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ You only need the following keys to get started — at minimum just the first on
101101
| **Ecosystem AI-rule discovery** — auto-injects `DEEPCOPILOT.md`, `.github/copilot-instructions.md`, `AGENTS.md`, `.cursor/rules/*.mdc`, `CLAUDE.md` | **项目规则自动发现**:自动注入工作区下的主流 AI 规则文件(GitHub Copilot / Cursor / Claude 等),让模型了解项目约定 |
102102
| **Context window management** *(new in 0.41.0)* — structure-aware truncation, per-file dedup, rolling summary; `/compact [focus]` force-compacts, `/context` opens a token breakdown, `/fork [name]` branches a new session from any message | **上下文窗口管理** *(0.41.0 新增)*:结构感知截断、同文件去重、滚动摘要;`/compact [focus]` 立即压缩,`/context` 查看 token 占用细分,`/fork [name]` 从任一消息派生新会话 |
103103
| **Footer context ring** *(new in 0.41.0)* — ring indicator next to the footer ramps green → yellow → orange → red across 60 / 85 / 100% thresholds; click to open the same breakdown as `/context` | **底部 Context Ring** *(0.41.0 新增)*:底栏环形进度指示,按 60% / 85% / 100% 阈值由绿渐变到红;点击展开与 `/context` 一致的占用细分 |
104+
| **Archive = pure export** *(updated in 0.41.6)* — "Archive" now writes a Markdown snapshot under `.deep-copilot/archives/` and **leaves the session alone**; old soft-hidden sessions are auto-unarchived on first launch | **存档 = 纯导出** *(0.41.6 调整)*:点「存档」只生成 `.deep-copilot/archives/` 下的 Markdown 快照,**不再隐藏会话**;老版本被隐藏的会话升级后首次启动自动还原。 |
105+
| **Watchdog turns stay on duty** *(new in 0.41.6)* — when the agent monitors a long-running background job (training, build, dev server) via `read_terminal`, the turn refuses to end until the job finishes or the 4 h per-turn budget elapses | **值守任务不提前退出** *(0.41.6 新增)*:模型用 `read_terminal` 盯住某个后台任务(训练 / 构建 / 开发服务)后,turn 不会在“我会持续盯”之后静默断开,直到任务结束或命中 4h 本轮预算 |
104106

105107
---
106108

@@ -117,7 +119,7 @@ You only need the following keys to get started — at minimum just the first on
117119
# 从 GitHub Releases 下载最新版 / Download from GitHub Releases:
118120
# https://github.com/ZhouChaunge/DeepCopilot/releases
119121

120-
code --install-extension deep-copilot-0.41.0.vsix
122+
code --install-extension deep-copilot-0.41.6.vsix
121123
```
122124

123125
Or in VS Code: **Extensions** view → `` menu → **Install from VSIX...** and pick the file.
@@ -161,11 +163,11 @@ npm run build
161163

162164
# 4. Package as VSIX · 打包 VSIX
163165
npm run package
164-
# -> outputs deep-copilot-0.41.0.vsix
165-
# -> 产出 deep-copilot-0.41.0.vsix
166+
# -> outputs deep-copilot-0.41.6.vsix
167+
# -> 产出 deep-copilot-0.41.6.vsix
166168

167169
# 5. Install locally · 本地安装
168-
code --install-extension deep-copilot-0.41.0.vsix --force
170+
code --install-extension deep-copilot-0.41.6.vsix --force
169171
```
170172

171173
### Watch mode · 监听模式(开发期)
@@ -481,6 +483,11 @@ The hook's stdout/stderr is appended to the tool result so the model can react
481483
<details>
482484
<summary>点击展开完整更新日志 · Click to expand full changelog</summary>
483485

486+
### v0.41.6 — Archive 纯导出 · 值守任务不提前退出
487+
488+
- 中文:①**Issue #169:Archive 语义改为「纯导出」**——点「存档」只会在 `.deep-copilot/archives/` 下生成 Markdown 快照,会话本身保持原状(不再软隐藏、不会被切走、同一会话连点两次会生成两个 md);出错或取消保存不再错误地改动 `archived` 状态。另加一次性迁移 `_migrateArchivedFlagIfNeeded`:由 `globalState['deepseekAgent.archiveSemanticsV2Migrated']` 守护,升级后首次启动自动把旧版本软隐藏的会话全部还原到侧边栏,失败走 `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', ...)`,不阻塞激活。②**值守任务不提前退出**——在之前的状态下,如果后台任务(例如训练)是在更早的 turn 启动的,`BG_WAIT_SKIPPED_MODEL_DONE` 守卫会在模型说完「我会持续监控」之后立刻结束会话。本版本新增 `run._monitoredBgJobs` 跟踪集:模型调用 `read_terminal(terminal: "deepseek-job-*")` 读取某个后台任务后,该 jobId 被记为「当前运行在主动监控」;agent-loop 的提前退出守卫同时检查该集合,只要被监控的 bg job 仍在跑,turn 就会继续等待、走快照,直到任务结束事件抵达或命中 4h 本轮预算。③迁移错误调用 `Logger`(取代 `console.warn`),为 `deepseekAgent.enableDebugLog` 下的 Deep Copilot Debug 输出面板补齐一致的错误上下文。④`.vscodeignore` 补上 `.tmp-*.json/.txt/.md` 过滤,防止 PR 评论缓存等临时文件被打进 VSIX。
489+
- English: ①**Issue #169 — Archive becomes pure export**: clicking "Archive" only writes a Markdown snapshot under `.deep-copilot/archives/` and leaves the session completely untouched (no more soft-hide, no more current-session-swap, clicking twice on the same session simply produces two snapshots); failure paths and save-dialog cancellation no longer mutate `archived` state. A one-shot idempotent migration `_migrateArchivedFlagIfNeeded` (guarded by `globalState['deepseekAgent.archiveSemanticsV2Migrated']`) flips every legacy `archived: true` session back to `false` on first launch so previously-hidden sessions reappear in the sidebar. Failure routes through `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', ...)` instead of blocking activation. ②**Watchdog turn stays on duty**: when a background job (training, build, dev server) was started in an earlier turn, `run._sessionStartedBgJobs` is empty in the current turn, so the `BG_WAIT_SKIPPED_MODEL_DONE` guard used to terminate the conversation right after the model promised to keep monitoring. The agent now tracks every `deepseek-job-*` terminal the model inspects via `read_terminal` in `run._monitoredBgJobs`; the agent-loop guard refuses to end the turn while any such monitored job is still alive, so the loop keeps polling and emitting 4-minute snapshots until the job finishes or the 4 h per-turn budget elapses. ③Routes migration failures through `Logger` (replacing `console.warn`) so diagnostics respect `deepseekAgent.enableDebugLog` and surface in the "Deep Copilot Debug" output channel. ④`.vscodeignore` now filters `.tmp-*.json/.txt/.md`, preventing local PR-review scratch caches from accidentally leaking into the shipped VSIX.
490+
484491
### v0.41.0 — Context Window 优化套件 · 会话切换闪屏修复
485492

486493
- 中文:①**Issue #142:上下文窗口管理重构**——结构感知截断(保留最新工具结果完整内容,旧轮次保留摘要骨架);同文件多次读取自动去重(仅保留最后一次完整内容,先前版本折叠为 `<file path=... read-collapsed='true'/>` 占位);超阈值时启用**滚动摘要**(rolling summary)按需调用模型把更早的对话压缩成结构化摘要节点;MCP 工具支持 per-server 显式 opt-out;大文件读取附带 **read-large-file hint** 提醒模型按需 grep 而非整文件读入。②**新增三个斜杠命令**:`/compact [focus]` 立即压缩当前会话历史(可附主题词偏置摘要方向,自动读取 `.deepcopilot/compact.md` 或 `CLAUDE.md` 作为项目级 compact 指令);`/context` 弹出当前会话的 token 占用细分(system / messages / tools / files / hints);`/fork [name]` 把当前会话从某条消息派生为新会话,保留上下文起点。③**底部 Context Ring 指示器**:替换原状态点(`#foot .dot`),在底部状态栏右下角新增环形进度(`#ft-ctx`),颜色随上下文占用阈值 `<60%` 绿 → `<85%` 黄 → 橙 → 红渐变;点击展开 popover 显示与 `/context` 一致的细分;事件源 `ctxUsage` 来自 agent-loop 每轮回写。④**Issue #143:会话切换闪屏 / 滚动条抖动修复**——切走再切回正在运行的会话时,缓冲事件被同步重放,每个事件触发一次 `requestAnimationFrame` 滚动,导致明显闪烁。修复:`_loadSession` 用 `setTimeout(..., 0)` 把事件重放推到下一个宏任务,并以 `replayStart` / `replayEnd` 信封包裹;webview 端新增 `_replaying` 标志,在重放期间 `ascroll()` 静默,结束时一次性滚到底。⑤Anthropic / OpenAI 客户端小幅清理;`errors.js` 文案微调;`file-read.js` 增加大文件提示输出;`session-store.js` 适配 rolling summary 节点的持久化与回放。

release/notes_v0416.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Deep Copilot v0.41.6
2+
3+
> 中文版在下方 / English notes below.
4+
5+
## 🇨🇳 中文
6+
7+
主题:**Archive 改为纯导出 · 值守任务不再提前结束会话 · 打包卫生**
8+
9+
### 🐞 修复 1:Archive 语义改为「纯导出」(Issue #169
10+
11+
旧版「存档」实际上是「软隐藏 + 导出」——点一下生成 Markdown,同时把会话从侧边栏抽走,连点两次第二次还会把它「unarchive」回来,体验和菜单文案完全不符。
12+
13+
**新行为(PR #170**
14+
15+
- `archive(id)` 只做一件事:调用 `exportSessionToMarkdown` 把整个会话渲染为 Markdown,写到 `.deep-copilot/archives/yyyyMMdd-HHmmss-<title>.md`
16+
- **不再**`archived` 置为 `true`**不再** 把当前激活的 session 切走,**不再** 广播 `sessionLoaded` 空消息。
17+
- 出错或用户在保存对话框里取消,session 状态都保持原样——只 toast 一下。
18+
- 同一会话连点两次「存档」 → 生成两个 md 文件,会话本体不动。
19+
20+
**一次性迁移** `_migrateArchivedFlagIfNeeded`
21+
22+
-`globalState['deepseekAgent.archiveSemanticsV2Migrated']` 守护,幂等;
23+
- 升级到本版本后**首次启动**会把所有旧 `archived: true` 的会话翻回 `false`,让侧边栏重新看到它们;
24+
- 失败走 `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', { message, stack })`,下次启动自动重试,不阻塞激活;
25+
- 仅当真有 session 被翻转时才调 `postList()`,避免无谓刷新。
26+
27+
> ⚠️ 兼容性:升级后曾经被「藏起来」的所有会话会一次性回到侧边栏。`.filter(s => !s.archived)` / `find(s => !s.archived)` 这两处过滤器保留,作为 schema 向后兼容;后续 minor 版本会移除 `archived` 字段。
28+
29+
### 🐞 修复 2:值守任务不再被提前掐断
30+
31+
模型执行「值守」类任务(盯训练、盯长跑构建、盯日志)时,如果那个 bg job 是在**上一个 turn** 启动的,当前 turn 的 `run._sessionStartedBgJobs` 是空集,`BG_WAIT_SKIPPED_MODEL_DONE` 守卫就会在模型说完「我会持续监控」之后**立刻**结束 turn,把值守静默掐断——用户看着模型像断片一样不再有任何后续。
32+
33+
**修复**
34+
35+
- `src/chat/tool-executor.js` 新增对 `read_terminal(terminal: "deepseek-job-*")` 的拦截:当模型读取某个后台任务的终端输出时,把该 jobId 记入 `run._monitoredBgJobs`,作为「当前 run 正在主动监控该任务」的信号。
36+
- `src/chat/agent-loop.js`
37+
- 初始化 `run._monitoredBgJobs = new Set()`
38+
- bg job 结束事件同步清理该集合;
39+
- `BG_WAIT_SKIPPED_MODEL_DONE` 守卫新增 `_hasMonitoredRunningJob` 条件——任何被监控且仍活着的 bg job 都会阻止 turn 提前退出,循环继续走 4 分钟快照 / 等结束事件,直到任务完成或命中 4h 本轮预算。
40+
41+
### 🛠 修复 3:迁移失败走 `Logger`(替换 `console.warn`
42+
43+
`_migrateArchivedFlagIfNeeded` 的失败分支改用 `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', { message, stack })`,统一走 Deep Copilot Debug 输出面板,符合仓库已有的 `src/logger.js` 路径。
44+
45+
### 🧹 打包卫生
46+
47+
`.vscodeignore` 增加 `.tmp-*.json` / `.tmp-*.txt` / `.tmp-*.md` 过滤规则,防止本地拉取 PR 评论 / Review API 时产生的临时缓存文件被打进 VSIX。
48+
49+
### 🔒 安全 / 兼容性
50+
51+
- Webview CSP 不变。
52+
- 不引入新运行时依赖。
53+
- Archive 旧 md 文件(`.deep-copilot/archives/*.md`)原封不动。
54+
- Watchdog 改动只放宽提前退出条件,不改变正常 turn 结束语义;模型从未 `read_terminal` 过的 bg job(例如旁路 dev server)依然走老的 short-circuit。
55+
56+
### 关联
57+
58+
- Issue #169(archive 语义)
59+
- PR #170(本版本合并 PR)
60+
- 衍生自 #165 / PR #166 的 archive 讨论
61+
62+
---
63+
64+
## 🇺🇸 English
65+
66+
Theme: **Archive becomes a pure export · watchdog turns stay on duty · packaging hygiene**
67+
68+
### 🐞 Fix 1 — Archive semantics: pure export (Issue #169)
69+
70+
Pre-#169 the "Archive" action was actually "soft-hide + export": it produced a Markdown snapshot but *also* swept the session out of the sidebar; clicking the same row a second time silently un-hid it. The menu label promised one thing, the behaviour did another.
71+
72+
**New behaviour (PR #170)**:
73+
74+
- `archive(id)` does exactly one thing: call `exportSessionToMarkdown` to render the whole session to `.deep-copilot/archives/yyyyMMdd-HHmmss-<title>.md`.
75+
- It no longer sets `archived = true`, no longer swaps `sessionId` to null, no longer broadcasts a `sessionLoaded` empty message.
76+
- On error or user-cancelled save dialog, session state is untouched — only a toast.
77+
- Clicking "Archive" twice on the same session produces two snapshots; the session itself stays put.
78+
79+
**One-shot migration** `_migrateArchivedFlagIfNeeded`:
80+
81+
- Idempotent, guarded by `globalState['deepseekAgent.archiveSemanticsV2Migrated']`.
82+
- On first launch after upgrade, flips every legacy `archived: true` back to `false` so old hidden sessions reappear in the sidebar.
83+
- Failure routes through `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', { message, stack })`; the next launch retries because the flag was never written. Activation is never blocked.
84+
- `postList()` only fires when something actually changed.
85+
86+
> ⚠️ Compatibility: every session that used to be hidden by the old archive flow will reappear in the sidebar exactly once after this upgrade. The `.filter(s => !s.archived)` and `find(s => !s.archived)` call-sites are kept as a no-op safety net so the data schema stays backward-compatible; a future minor release will drop the field.
87+
88+
### 🐞 Fix 2 — Watchdog turns no longer cut themselves off
89+
90+
When the model is asked to watch a long-running background job (training, build, dev server), and that job was spawned in an *earlier* turn, the current turn's `run._sessionStartedBgJobs` is empty. The `BG_WAIT_SKIPPED_MODEL_DONE` guard would then end the turn the instant the model said "I'll keep monitoring", silently dropping the watchdog. Users would see the model go quiet right after promising to stay on duty.
91+
92+
**Fix**:
93+
94+
- `src/chat/tool-executor.js` now hooks `read_terminal(terminal: "deepseek-job-*")`: inspecting a `deepseek-job-*` terminal in this run adds that jobId to `run._monitoredBgJobs` — a signal that the model is actively watching the job.
95+
- `src/chat/agent-loop.js`:
96+
- Initialises `run._monitoredBgJobs = new Set()`.
97+
- Clears entries when the corresponding bg-job-end event fires.
98+
- Adds `_hasMonitoredRunningJob` to the early-exit guard; as long as any monitored job is still alive, the turn refuses to end and keeps polling / emitting 4-minute snapshots until the job finishes or the 4-hour per-turn budget elapses.
99+
100+
### 🛠 Fix 3 — Migration failures use `Logger` (not `console.warn`)
101+
102+
`_migrateArchivedFlagIfNeeded` now routes its failure path through `Logger.info('ARCHIVE_V2_MIGRATION_FAILED', { message, stack })`, matching the repo's existing `src/logger.js` pipeline so diagnostics respect `deepseekAgent.enableDebugLog` and land in the "Deep Copilot Debug" output channel.
103+
104+
### 🧹 Packaging hygiene
105+
106+
`.vscodeignore` now filters `.tmp-*.json` / `.tmp-*.txt` / `.tmp-*.md`, so scratch files created locally while pulling PR comments or review payloads via the GitHub API never end up shipped inside the VSIX.
107+
108+
### 🔒 Security / compatibility
109+
110+
- Webview CSP unchanged.
111+
- No new runtime dependencies.
112+
- Existing archive Markdown files (`.deep-copilot/archives/*.md`) are untouched.
113+
- The watchdog change only loosens the early-exit guard; it does not change normal turn-end semantics. Bg jobs the model never inspected via `read_terminal` (e.g. a side-channel dev server) still go through the original short-circuit.
114+
115+
### Related
116+
117+
- Issue #169 (archive semantics)
118+
- PR #170 (this release was merged via PR #170)
119+
- Continuation of the archive discussion from #165 / PR #166

0 commit comments

Comments
 (0)