Repository navigation
Description
Deep Code v0.5.0 发布说明
本次更新为 Deep Code 带来了手动上下文压缩命令 /compact、Ctrl+R 历史反向搜索、新的CLI命令参数、DeepSeek 官方网页搜索 API 接入、全新升级的权限系统,以及 VSCode 插件的 Slash 命令与 Plan 模式支持。这是一个以「可观测性」和「可控性」为主题的版本:你可以更清楚地看到 Deep Code 在做什么,也可以更细粒度地决定它能做什么。
全新功能
1. 手动上下文压缩:/compact
此前 Deep Code 只支持达到阈值后的自动压缩。v0.5.0 新增 /compact 命令,可以在任何时候手动压缩当前会话,主动释放上下文空间,让任务对话可以持续推进。
围绕压缩,这个版本做了一系列机制升级:
- 更健壮的压缩逻辑:借鉴 DSH 的策略,正确处理被中断的工具调用、按字节估算请求体积,避免压缩本身触发上下文超限。新增
retainRatio和retainTokens两项配置,自动压缩后会按比例(默认保留上下文窗口的 16%)或按绝对 token 数保留最近的完整对话。工具调用与结果保持完整,不会因截断产生孤儿调用。 /undo可以回到压缩前:/undo现在能从压缩检查点恢复原始用户输入和完整对话,压缩不再是单向操作。- 默认自动压缩阈值从 50% 上调到 80%:减少不必要的提前压缩,充分利用 DeepSeek 模型的 1M 上下文窗口。
配置示例(两者互斥,项目级配置会整体覆盖用户级策略):
{
"autoCompactWindow": "180K",
"retainTokens": 32768
}2. Ctrl+R 历史反向搜索
终端用户熟悉的 Ctrl+R 来了。在输入框按 Ctrl+R 即可搜索当前会话及跨会话保存的所有用户输入:
- 输入关键词实时预览匹配结果;
Ctrl+R/↑查找更早的匹配,Ctrl+S/↓查找更新的匹配;Enter把结果放入输入框继续编辑(不会直接发送),Esc/Ctrl+C取消并恢复原草稿。
跨会话历史保存在 ~/.deepcode/history.jsonl,可在 settings.json 中配置持久化策略和体积上限:
{
"history": {
"persistence": "saveAll",
"maxBytes": 10485760
}
}persistence 设为 "none" 可停止保存(已有历史仍可搜索);maxBytes 默认 10 MiB,超限时自动裁剪最旧记录,设为 0 表示不限大小。
3. CLI指定配置文件:-s / --settings
如果需要在多个 API 账号、多个环境或 CI 之间切换,可以使用 -s / --settings 显式指定一个配置文件:
deepcode -s ./settings.ci.json
deepcode -x -s ./settings.ci.json -p "运行检查并输出结果"指定的文件会被当作项目级配置源使用,这个功能适合需要“只读配置”或“每次运行使用不同配置”的场景。
4. CLI的exec模式支持 --session-id 与 --json
面向脚本化和自动化场景,exec 模式新增两个参数:
--session-id <uuid>:以指定 ID 创建并持久化会话,之后可以用--resume精确接回;--json:以单个 JSON 对象输出最终的助手回复,方便程序解析。
deepcode --exec --json --session-id 3f4b... -p "总结这个仓库的结构"5. 配置诊断:deepcode --doctor
环境出问题、配置不生效、API 连不上——现在一条命令就能定位:
deepcode --doctor # 检查当前配置、API 连接和安装环境
deepcode --doctor -s ./settings.json # 检查指定的配置文件报告会列出配置文件路径、加载状态、每个配置项的最终值及其来源(用户级还是项目级)。密钥和自定义环境变量值不会显示。检查结果分 PASS、WARN、FAIL、SKIP 四档,存在 FAIL 时退出码为 1,方便接入 CI 或排查脚本。诊断只读不修改任何配置。
6. DeepSeek 官方网页搜索 API
DeepSeek 上线了官方网页搜索 API,Deep Code 第一时间接入。在 settings.json 中开启:
{
"deepseekSearchApiEnabled": true
}当 BASE_URL 为 https://api.deepseek.com 时生效。按官方文档,网页搜索按请求次数计费(每 1,000 次成功请求 5 元),不按 token 或结果条数计费。关闭开关或使用其他 API 地址时,保持原有的内置搜索行为不变。
7. 权限系统全面升级
v0.5.0 对权限体系做了四项重要改进,目标是「少打断、可预期」:
/permissions交互式权限编辑器:不用再手写 JSON。在编辑器里可以把默认模式设为allowAll或askAll,把每个权限范围单独设为允许、拒绝、询问或跟随默认,并实时预览当前项目的实际生效配置。- 会话级授权:权限确认菜单新增 "Yes, during this session" 选项——本次会话内同类操作不再询问,但不写入配置文件。适合临时授权一批操作,又不留下长期权限。
- 写入位置可选:
/model和/permissions保存配置时,现在可以选择写入用户级还是项目级配置,不再默认只写项目级。 - 写入前先看 diff:Write 和 Edit 工具请求权限时,会直接展示将要写入或修改的内容差异,批准与否有据可依。
8. 会话自动标题与终端状态
Deep Code 借鉴了codex的策略,能够根据用户消息自动生成会话标题了,resume 列表里一眼就能找到想恢复的那个。终端标签页标题也会同步显示会话标题和实时状态指示(运行中、等待输入等)。
9. DeepCode Plus 快速配置
开通 DeepCode Plus 订阅后,运行 deepcode --plus 按提示输入 API Key,验证通过即自动保存到 ~/.deepcode-plus/settings.json。也可以在用户级或项目级 settings.json 的 env.PLUS_API_KEY 中配置。
10. VSCode 插件:Slash 命令与 Plan 模式
VSCode Companion 大幅补齐了与 CLI 的能力差距:
- 输入框支持完整的 Slash 命令体系(
/model、/compact、/permissions等); - 支持 Plan 模式切换,计划完成后弹出后续操作菜单(直接实施、调整计划等),与 CLI 体验对齐。
改进与优化
- 通知系统感知会话状态:
notify脚本不再只在任务完成时触发。现在会话完成、失败、等待用户输入、等待权限确认时都会执行通知脚本。- 彩蛋:新版通知还能怎么玩?试试这个:https://github.com/qorzj/red_alert_notify 。配置好通知脚本,然后竖起耳朵。"Construction complete, Commander."
- Process Output 与 Bash 历史:Bash 工具的进程输出展示和滚动体验大幅改进,支持 ANSI 颜色,并可以在进程输出历史间导航。
- raw 显示模式持久化:
/raw的选择会保存到全局配置,重启后保持。 - 欢迎界面适配窄终端:Logo 在窄窗口下自动裁剪,布局不再错乱。
- 修复
/undo草稿复现:回答或关闭问题后,恢复的草稿不再意外重新出现。 - Write 工具返回 snippet ID:写入结果可引用、可追踪。
升级方式
# 全局更新到最新版
npm install -g @vegamo/deepcode-cli@latest
# 查看当前版本
deepcode --version完整配置说明见 docs/configuration.md。
感谢使用 Deep Code!如有问题或建议,欢迎在 GitHub 仓库 提交 issue。
New Contributors
- @xiaofeilovecoding made their first contribution in fix(core): run the skill-digester helper as CommonJS #380
- @wang1408 made their first contribution in fix(cli): submit /plan arguments as a one-shot prompt #388
Full Changelog: v0.4.5...v0.5.0
Deep Code v0.5.0 Release Notes
This release brings manual context compaction with /compact, Ctrl+R reverse history search, new CLI options, integration with DeepSeek's official web search API, an upgraded permission system, and slash commands and Plan mode in the VSCode extension. This release focuses on visibility and control: you can see more clearly what Deep Code is doing and decide more precisely what it is allowed to do.
New Features
1. Manual Context Compaction: /compact
Previously, Deep Code only supported automatic compaction when a threshold was reached. v0.5.0 adds the /compact command, so you can compact the current session at any time, free up context space, and keep working through your task.
This release also includes several improvements to compaction:
- More robust compaction: Drawing on DSH's approach, compaction now correctly handles interrupted tool calls and estimates request sizes in bytes to prevent compaction itself from exceeding the context limit. Two new settings,
retainRatioandretainTokens, preserve recent complete conversations after automatic compaction, either as a proportion of the context window (16% by default) or as an absolute token count. Tool calls and their results remain intact, preventing orphaned calls caused by truncation. /undocan restore the conversation before compaction:/undocan now recover the original user input and complete conversation from a compaction checkpoint, making compaction reversible.- The default automatic compaction threshold increases from 50% to 80%: This reduces unnecessary early compaction and makes fuller use of DeepSeek models' 1M context window.
Configuration example (retainRatio and retainTokens are mutually exclusive; project-level configuration replaces the entire user-level retention policy):
{
"autoCompactWindow": "180K",
"retainTokens": 32768
}2. Ctrl+R Reverse History Search
The familiar terminal shortcut Ctrl+R is here. Press Ctrl+R in the input box to search all user input from the current session and saved history across sessions:
- Type keywords to preview matches in real time.
- Use
Ctrl+R/↑for older matches andCtrl+S/↓for newer matches. - Press
Enterto place a result in the input box for further editing (it will not be sent automatically), orEsc/Ctrl+Cto cancel and restore your original draft.
History across sessions is stored in ~/.deepcode/history.jsonl. You can configure its persistence policy and size limit in settings.json:
{
"history": {
"persistence": "saveAll",
"maxBytes": 10485760
}
}Set persistence to "none" to stop saving history (existing history remains searchable). maxBytes defaults to 10 MiB; the oldest entries are automatically removed when the limit is exceeded. Set it to 0 for no size limit.
3. Specify a CLI Configuration File: -s / --settings
When switching between API accounts, environments, or CI setups, use -s / --settings to explicitly select a configuration file:
deepcode -s ./settings.ci.json
deepcode -x -s ./settings.ci.json -p "Run the checks and report the results"The specified file is used as the project-level configuration source. This is useful when you need read-only configuration or a different configuration for each run.
4. --session-id and --json in CLI Exec Mode
Exec mode adds two options for scripting and automation:
--session-id <uuid>: Create and persist a session with a specified ID, then return to that exact session later with--resume.--json: Output the final assistant response as a single JSON object for easy parsing.
deepcode --exec --json --session-id 3f4b... -p "Summarize this repository's structure"5. Configuration Diagnostics: deepcode --doctor
Environment problems, configuration that does not take effect, or API connection failures can now be investigated with a single command:
deepcode --doctor # Check the current configuration, API connection, and installation environment
deepcode --doctor -s ./settings.json # Check a specified configuration fileThe report lists configuration file paths, loading status, and each setting's effective value and source (user-level or project-level). API keys and custom environment variable values are not displayed. Results are classified as PASS, WARN, FAIL, or SKIP. Any FAIL produces exit code 1, making the command suitable for CI and troubleshooting scripts. Diagnostics are read-only and do not modify any configuration.
6. DeepSeek's Official Web Search API
DeepSeek has launched an official web search API, and Deep Code now supports it. Enable it in settings.json:
{
"deepseekSearchApiEnabled": true
}This takes effect when BASE_URL is https://api.deepseek.com. According to the official documentation, web search is billed per request (CNY 5 per 1,000 successful requests), rather than by tokens or number of results. When the setting is disabled or a different API URL is used, the existing built-in search behavior is preserved.
7. Permission System Upgrade
v0.5.0 introduces four major permission improvements to reduce interruptions and make behavior more predictable:
- Interactive permission editor:
/permissions: Configure permissions without editing JSON by hand. Set the default mode toallowAlloraskAll, configure each permission scope to allow, deny, ask, or follow the default, and preview the effective configuration for the current project in real time. - Session-level approval: Permission prompts now include "Yes, during this session". Similar operations will no longer require approval during the current session, and no configuration file is changed. This is useful for temporarily authorizing a set of operations without granting lasting permissions.
- Choose where to save settings: When saving through
/modelor/permissions, you can now choose user-level or project-level configuration, instead of always saving at the project level. - Preview the diff before approving writes: Permission requests from the Write and Edit tools show the proposed changes, so you can review them before deciding whether to approve.
8. Automatic Session Titles and Terminal Status
Following Codex's approach, Deep Code can now automatically generate session titles from user messages, making it easier to find the session you want in the resume list. The terminal tab title also displays the session title and live status indicators, such as running or waiting for input.
9. Quick Setup for DeepCode Plus
After subscribing to DeepCode Plus, run deepcode --plus and enter your API key when prompted. Once validated, it is automatically saved to ~/.deepcode-plus/settings.json. You can also set env.PLUS_API_KEY in your user-level or project-level settings.json.
10. VSCode Extension: Slash Commands and Plan Mode
VSCode Companion closes much of the feature gap with the CLI:
- The input box supports the full slash command system, including
/model,/compact, and/permissions. - Plan mode switching is supported. Once a plan is complete, a follow-up menu offers actions such as implementing or adjusting the plan, matching the CLI experience.
Improvements
- Notifications reflect session status: The
notifyscript is no longer triggered only when a task finishes. It now runs when a session completes, fails, waits for user input, or waits for permission approval.- Easter egg: Want to try something fun with the new notifications? Take a look at https://github.com/qorzj/red_alert_notify . Configure the notification script, then listen closely. "Construction complete, Commander."
- Process Output and Bash history: The Bash tool's process output display and scrolling experience have been substantially improved, with ANSI color support and navigation between past process outputs.
- Persistent raw display mode: Your
/rawselection is saved in the global configuration and persists across restarts. - Welcome screen adapts to narrow terminals: The logo is automatically cropped in narrow windows to keep the layout intact.
- Fixed drafts reappearing after
/undo: Restored drafts no longer unexpectedly reappear after you answer or dismiss a question. - The Write tool returns a snippet ID: Write results can be referenced and tracked.
How to Upgrade
# Update globally to the latest version
npm install -g @vegamo/deepcode-cli@latest
# Check the current version
deepcode --versionFor the full configuration reference, see docs/configuration.md.
Thank you for using Deep Code! If you have questions or suggestions, please open an issue in the GitHub repository.
New Contributors
- @xiaofeilovecoding made their first contribution in fix(core): run the skill-digester helper as CommonJS #380
- @wang1408 made their first contribution in fix(cli): submit /plan arguments as a one-shot prompt #388
Full Changelog: v0.4.5...v0.5.0
Activity
tangben-cli commentedon Nov 3, 2026
标题没更新
[-]【Release Notes】v0.3.1[/-][+]【Release Notes】v0.5.0[/+]qorzj commentedon Nov 3, 2026
@tangben-cli 感谢提醒~