Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## v1.1.1 (2026-08-31)
- Added Code and Minimal tool modes, on-demand tool discovery, and permission-scoped CLI tool access
- Added a Tape Trace Inspector for Agent runs, provider requests, tool calls, and Skill usage
- Improved long-context compaction and overflow recovery while preserving full conversation history
- Unified Skills into a shared library with per-Agent enablement and progressive loading, and restored manual installation from folders, ZIP archives, URLs, and Git repositories
- Added managed Node.js and uv toolchains with detection, installation, repair, and recovery, plus terminal authentication for ACP agents
- Redesigned provider Settings with staged credential verification, API key copying, and direct chat entry; added validated custom request headers with cross-origin protections
- Added APIMart, Synthorai, and RunInfra providers, native APIMart image and video generation, and Codex image generation support
- Upgraded Markstream to 2.0.6 and reduced Markdown streaming stalls with split rendering and a managed worker pool
- Improved workspace navigation, conversation retry, and permission prompt recovery, and reduced startup delays
- Made Agent stop requests interrupt stalled provider and browser waits, and added configurable Code Mode cell timeouts
- Repaired usage statistics and MCP startup, retained corrupt databases for recovery, and fixed Ollama context budgets and provider timeout handling
- Refreshed the built-in model and ACP catalogs
- 新增 Code 与 Minimal 工具模式、按需工具发现,以及受权限约束的 CLI 工具访问
- 新增 Tape Trace Inspector,用于查看 Agent 运行、Provider 请求、工具调用与 Skill 使用记录
- 改进长上下文压缩与溢出恢复,同时保留完整对话历史
- 将 Skills 统一为共享库,支持逐 Agent 启用与渐进式加载,并恢复从文件夹、ZIP 压缩包、URL 与 Git 仓库手动安装
- 新增托管式 Node.js 与 uv 工具链,支持检测、安装、修复与恢复,并为 ACP Agent 新增终端身份验证
- 重做 Provider 设置,支持暂存并验证凭据、复制 API Key 和直接开始聊天;新增经过验证且具备跨域保护的自定义请求头
- 新增 APIMart、Synthorai 与 RunInfra Provider,支持 APIMart 原生图片与视频生成,以及 Codex 图片生成
- 将 Markstream 升级至 2.0.6,并通过分段渲染与受控 Worker 池减少 Markdown 流式渲染卡顿
- 改进工作区导航、对话重试与权限提示恢复,并减少启动延迟
- 使 Agent 停止请求能够中断卡住的 Provider 与浏览器等待,并支持配置 Code Mode 代码单元超时
- 修复用量统计与 MCP 启动,保留损坏数据库以便恢复,并修复 Ollama 上下文预算与 Provider 超时处理
- 刷新内置模型与 ACP 目录

## v1.1.1-beta.5 (2026-08-27)
- Added built-in APIMart and Synthorai providers, including native APIMart image and video generation
- Added validated per-provider custom request headers with cross-origin protections
Expand Down
31 changes: 31 additions & 0 deletions README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@
href="https://go.apimart.ai/gh-deepchat">こちらから登録</a>して利用を開始できます。
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.openmodel.ai?ref=ZGLyq8YQ">
<img src="./assets/sponsors/openmodel.png" alt="OpenModel" width="240" />
</a>
</td>
<td width="75%">
本プロジェクトをご支援いただいている OpenModel に感謝します!OpenModel は、対応モデルで
Codex に最大 90%、Claude Code に最大 60%
のクライアント専用割引を提供し、開発者が作業方法を変えずに API
コストを削減できるよう支援します。OpenModel API キーを接続するだけで、これまでどおり Codex
または Claude Code
を使用できます。対応クライアントは自動的に検出され、追加パラメーターや手動ルーティングなしで割引ルートが適用されます。また、API
キーごとにフォールバック動作を設定し、割引ルートが一時的に利用できない場合に、標準料金で利用を続けるか停止するかを選択できます。DeepChat
ユーザーは<a href="https://www.openmodel.ai?ref=ZGLyq8YQ">こちら</a>から登録できます。
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.packyapi.ai/register?aff=0A33">
<img src="./assets/sponsors/packycode.png" alt="PackyCode" width="240" />
</a>
</td>
<td width="75%">
PackyCode は、Claude Code、Codex、Gemini
などの中継サービスを提供する、安定性と高いパフォーマンスを備えた API
中継プロバイダーです。自動フェイルオーバー、スマートルーティング、無制限の同時実行などの機能により、AI
を真の生産性向上ツールにします。<a
href="https://www.packyapi.ai/register?aff=0A33">こちら</a>から登録して、今すぐ利用を開始できます。
</td>
</tr>
</table>

## 📑 目次
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@
here</a> to get started.
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.openmodel.ai?ref=ZGLyq8YQ">
<img src="./assets/sponsors/openmodel.png" alt="OpenModel" width="240" />
</a>
</td>
<td width="75%">
Thanks to OpenModel for sponsoring this project! OpenModel offers client-specific discounts of
up to 90% for Codex and 60% for Claude Code across supported models, helping developers cut API
costs without changing how they work. Just connect your OpenModel API key and keep using Codex
or Claude Code as usual — supported clients are detected automatically and discounted routes
are applied with no extra parameters or manual routing required. You can also configure
fallback behavior per API key, choosing whether to continue at standard pricing or stop when a
discounted route is temporarily unavailable. DeepChat users can register via <a
href="https://www.openmodel.ai?ref=ZGLyq8YQ">this link</a>.
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.packyapi.ai/register?aff=0A33">
<img src="./assets/sponsors/packycode.png" alt="PackyCode" width="240" />
</a>
</td>
<td width="75%">
PackyCode is a stable, high-performance API relay provider, offering relay services for Claude
Code, Codex, Gemini, and more. With automatic failover, smart routing, and unlimited
concurrency, it turns AI into a real productivity tool. Register via <a
href="https://www.packyapi.ai/register?aff=0A33">this link</a> and get started!
</td>
</tr>
</table>

## 📑 Table of Contents
Expand Down
28 changes: 28 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,34 @@
href="https://go.apimart.ai/gh-deepchat">注册链接</a>注册即可开用。
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.openmodel.ai?ref=ZGLyq8YQ">
<img src="./assets/sponsors/openmodel.png" alt="OpenModel" width="240" />
</a>
</td>
<td width="75%">
感谢 OpenModel 对本项目的支持!OpenModel 为 Codex 和 Claude Code 提供高达 90%
的客户专属折扣,涵盖所有支持的模型,帮助开发者在不改变工作方式的前提下降低 API
成本。只需连接您的 OpenModel API 密钥,即可像往常一样继续使用 Codex 或 Claude
Code——系统会自动检测支持的客户端,并应用折扣路由,无需额外参数或手动路由。您还可以为每个
API 密钥配置备用方案,选择在折扣路由暂时不可用时继续按标准价格计费或停止计费。DeepChat
用户可以通过<a href="https://www.openmodel.ai?ref=ZGLyq8YQ">此链接</a>注册。
</td>
</tr>
<tr>
<td width="25%" align="center">
<a href="https://www.packyapi.ai/register?aff=0A33">
<img src="./assets/sponsors/packycode.png" alt="PackyCode" width="240" />
</a>
</td>
<td width="75%">
PackyCode 是一家稳定、高效的 API 中转服务商,提供 Claude Code、Codex、Gemini
等多种中转服务。具备自动故障转移、智能路由和无限并发等多种功能,让 AI
编程成为真正的生产力工具。点击<a
href="https://www.packyapi.ai/register?aff=0A33">此链接</a>注册,立即开始使用!
</td>
</tr>
</table>

## 📑 目录
Expand Down
Binary file added assets/sponsors/openmodel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sponsors/packycode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions docs/features/experimental-tool-modes/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Agent Mode 是兼容基线。工具 registry、disabled-tool 配置、权限、
Code Mode 保留当前已启用工具的能力,但不把这些工具逐个发送给模型:

- `openai-codex` 路由使用 Codex 风格的 raw JavaScript `exec` 和续跑 `wait`;
- 其他 function-tool 路由只发送 `run_code`,参数固定为
`{ code: string, description: string }`;
- Function-tool routes expose `run_code` with
`{ code: string, description: string, timeout_ms?: number }`;
- 两种入口都进入同一个 `RunCodeRuntimeManager`,不存在 `transport` 或第二套 runtime;
- function-tool 路由把当前目录生成成 TypeScript SDK,Codex 路由把嵌套声明写入 `exec`
描述;
Expand Down Expand Up @@ -188,11 +188,18 @@ IPC allowlist、V8 内存限制、heartbeat 和强制回收的组合。
| READY | 5 秒 |
| heartbeat 丢失 | 约 3.5 秒后终止 |
| VM 同步执行 slice | 2 秒 |
| cell 总执行时间 | 5 分钟 |
| cell 总执行时间 | Default 5 minutes; optional `timeout_ms` override |
| yielded / permission cell lease | 60 秒 |
| RSS hard ceiling | 512 MiB |
| STOP grace | 500 ms 后 `kill()` |

`timeout_ms` is a positive integer in milliseconds, up to `2147483647`. Function-tool routes pass
it as an optional `run_code` argument; Codex routes use the first-line `exec` pragma. Models omit
it for routine work and request a larger value only when the operation is expected to exceed five
minutes. The deadline covers the cell and its awaited subtools, is not reset by `wait` or permission
continuation, and does not extend a subtool's own timeout. User cancellation remains independent
of the selected duration. Invalid timeout values fail before dispatch.

成功、异常、取消、超时、进程退出、会话清理和应用退出都进入同一个幂等 cleanup:取消嵌套
调用,清理 timer/listener/active map,发送 `STOP`,超时后强制 `kill()`。失败 cell 不自动
重放,避免重复执行 Shell、文件或 MCP 副作用。
Expand Down
92 changes: 92 additions & 0 deletions docs/issues/agent-cancellation-code-timeout/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Agent Cancellation and Code Cell Timeouts

## Context

[Issue #2221](https://github.com/ThinkInAIXYZ/deepchat/issues/2221) reports a Code Mode run that
stopped progressing and could not be stopped by the user. Its partial trace records a provider
429 followed by a scheduled retry; it does not identify the complete incident sequence.

Independent reproduction identifies two cancellation boundaries that require protection:

- A provider iterator can remain pending after the Run signal is aborted. Waiting for its next
event or asynchronous cleanup must not prevent attempt settlement.
- An unresolved browser Promise can leave a YoBrowser CDP command and its activity waiting
indefinitely unless both observe the tool cancellation signal.

Code cells already have a five-minute execution deadline. That default is useful, but a longer
operation must be able to request a longer cell lifetime without weakening user cancellation.

## Contract

### User Cancellation

- Deliver the Run signal to the provider immediately. The provider-attempt owner also interrupts
its own iterator wait if the provider ignores that signal.
- Request iterator cleanup without waiting indefinitely after cancellation. Observe late
rejections, discard late output, and record the attempt as aborted exactly once.
- Preserve usage observed before cancellation and existing no-replay rules for committed output.
- Browser tools observe cancellation while waiting and check the signal immediately before
dispatch. A canceled readiness wait must not dispatch a CDP command later.
- Cancellation ends browser activity without projecting a late response into the canceled run.
It does not claim to undo browser or external side effects already dispatched.
- Code cell startup and execution both observe cancellation. An abandoned utility process must
be reclaimed even if it becomes ready after cancellation.
- Do not add a whole-run deadline or infer failure merely from a lack of output.

### Code Cell Execution Limit

- `run_code` accepts optional `timeout_ms`, an integer duration in milliseconds. Omitting it uses
`300000` milliseconds, or five minutes. `code` and `description` remain the only required fields.
- The valid range is `1` through `2147483647`, the host timer's supported range. Invalid values fail
before a utility process or tool dispatch starts.
- The Code Mode `exec` frontend accepts the same optional field in its first-line pragma, because
both frontends share the same cell runtime.
- The limit covers one cell, including awaited subtools. It starts when the cell is attached and
does not restart on yield, `wait`, or a permission continuation.
- The tool description, parameter description, and SDK prompt all instruct the model to omit the
field for routine work and set a larger value only when the current operation is expected to
exceed five minutes. A cell override does not extend a subtool's own timeout.
- User cancellation always takes precedence over a longer requested timeout. Existing source,
output, concurrency, heartbeat, memory, startup, and abandoned-cell limits remain unchanged.

## Ownership and Scope

`DeepChatContextCoordinator` owns provider iterator cancellation and attempt provenance.
`AgentToolManager`, `YoBrowserToolHandler`, and the existing browser command path carry the tool
signal through dispatch and response handling. `ToolService` validates the public timeout input;
`RunCodeRuntimeManager` applies the selected cell deadline. Code Mode definitions and generated
SDK text expose the same contract.

This change does not modify provider retry budgets, add dependencies, introduce a new task
scheduler, change UI layout, automatically replay canceled work, or add an unlimited timeout mode.

## Acceptance Criteria

- Stopping a silent provider settles the attempt without needing another provider event or a
cooperative iterator `return()`; late output does not start a tool or create another outcome.
- A normal long-running operation is not canceled merely because it is silent.
- Stopping a pending CDP call returns control and prevents delayed dispatch after readiness.
- An omitted cell timeout still expires at five minutes; an explicit longer timeout survives that
boundary and expires at the requested duration.
- A cell with an extended timeout still stops promptly when the user cancels.
- Invalid timeout values do not dispatch work, and both model-facing frontends document the
default, omission guidance, and extension semantics.

## Implementation and Validation

- [x] Provider and browser waits observe cancellation without requiring downstream cooperation.
- [x] Utility startup observes cancellation; both frontends accept the optional cell timeout.
- [x] The maintained Code Mode contract and model-facing instructions describe the same behavior.
- [x] Regression coverage protects cancellation, late completion, and timeout overrides.
- [x] Formatting, i18n, lint, type checks, and relevant test suites pass.

Validation uses Node 24.18.0 and pnpm 10.34.5:

- `pnpm run format`, `pnpm run i18n`, `pnpm run lint`, and `pnpm run typecheck` pass.
- 407 main-process tests pass across 13 relevant suites: Code Mode, ToolService, browser tools,
provider attempts and retries, stream processing, Run lifecycle, and abortable waits.
- All three ChatPage stop-request tests pass, covering duplicate requests, unsuccessful stop
responses, and rejected stop requests.
- Fake-clock cases verify the five-minute default, a ten-minute override, and explicit
cancellation of a provider silent for fifteen minutes and a CDP command silent for ten minutes.
Browser integration cases use mocked Electron boundaries; no live provider credentials are used.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DeepChat",
"version": "1.1.1-beta.5",
"version": "1.1.1",
"description": "DeepChat,一个简单易用的 Agent 客户端",
"main": "./out/main/index.js",
"author": "ThinkInAIXYZ",
Expand Down Expand Up @@ -172,9 +172,9 @@
"@iconify/vue": "^5.0.1",
"@lingual/i18n-check": "0.9.5",
"@lucide/vue": "^1.24.0",
"@pierre/diffs": "^1.2.12",
"@pinia/colada": "^0.20.0",
"@playwright/test": "^1.60.0",
"@pierre/diffs": "^1.2.12",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.3.0",
"@tiptap/core": "^2.27.2",
Expand Down Expand Up @@ -206,7 +206,7 @@
"electron-vite": "5.0.0",
"jsdom": "^26.1.0",
"katex": "^0.16.47",
"markstream-vue": "2.0.1-beta.1",
"markstream-vue": "2.0.6",
"mermaid": "^11.16.1",
"minimatch": "^10.2.5",
"monaco-editor": "^0.55.1",
Expand Down
Loading