Skip to content

Releases: Chasen-Liao/pi-agent-desktop

v0.7.16

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 24 Jun 06:51

UI/UX Enhancements and Massive Installer Size Optimization

v0.7.14

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 24 Jun 04:20

UI/UX Enhancements

v0.7.13 — Code Review 修复

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 21 Jun 01:45

🔧 v0.7.13 — Code Review 修复

本版本修复 v0.7.12(pi core 升级)发布后由 3 个并行 review subagent(GLM-5.2)发现的问题。pi 核心依赖版本不变(仍是 @earendil-works/pi-aipi-coding-agent0.79.8)。

📦 安装

下载下方 Pi-Agent-Desktop-Setup-0.7.13.exe(约 200 MB)。已安装 0.7.12 的用户直接运行新安装包覆盖升级即可,安装程序会自动关闭运行中的实例。

🐛 修复内容

Critical — 测试中的进程泄漏

electron/process-tree.test.ts

  • try/finally 包裹测试体,确保断言失败时 spawn 的 parent 与 grandchild(都是 setInterval 死循环)不会作为僵尸进程泄漏。之前如果 drain 超时,每次失败泄漏两个无限期存活的 Node 进程 —— 正是原修复想解决的并行测试负载场景。
  • 断言 killProcessTree() 返回值为 null,区分"函数报告错误"和"进程因别的原因结束"。
  • 5 秒 pidDeadline 定时器在所有路径中清理(之前即使成功也悬挂 5 秒,拖慢测试运行器)。
  • drain 循环现在只接受完整(以换行结束的)行。之前的循环会从被切分的 "1234\n" 中接受半截 "12",返回 pid 12 —— 若 12 恰好存在则静默错误,若属于另一个进程则灾难性后果。
  • 用 1 秒轮询替换固定的 500ms post-kill sleep(成功时更快,慢速 CI 上更可靠)。
  • 新增 waitForExit() 辅助函数,先同步检查 exitCode/killed 再等待 'exit' 事件,避免 finally 块中 await once(parent, "exit") 在父进程已退出时陷入死锁。

Important — installer 测试覆盖

lib/installer-script.test.mjs

  • 新增 CommandLine 空安全断言:验证脚本中 $_.CommandLine -and$_.CommandLine.IndexOf 之前(短路求值保护),恢复 v0.7.12 删除 doesNotMatch 时丢失的覆盖。
  • 新增 $_.Path.StartsWith 断言到 closeInstallDirProcesses —— 没有它宏可能误杀同名的不相关应用。
  • 加强 logInstallDirProcesses 测试:之前匹配裸词 "Path"(同义反复 —— Select-Object Id,Name,Path 也含 "Path"),现在匹配 $_.Path.StartsWith($INSTDIR) 真正验证安装目录过滤器完整。

Important — 文档自相矛盾

docs/ARCHITECTURE.md

  • §7:删除陈旧描述"AgentSession.fork() 原地修改 wrapper 内部状态"。这是旧行为,与 §14.2 直接矛盾 —— §14.2 正是本次重构的全部意义。已对照 lib/rpc-manager.ts 验证:根本没有 this.inner.fork() 调用,fork 通过 SessionManager.createBranchedSession() + 全新 startRpcSession() 完成。
  • §7 状态图:把 fork() 后立即 destroy() 改成 send("fork") 后立即 destroy() —— 裸 fork() 读起来像 AgentSession.fork() 存在(实际不存在)。

CLAUDE.md

  • 补上遗漏的"或首条消息前的 SessionManager.create()"括注。AGENTS.md 和 §14.2 都提到双路径,CLAUDE.md 之前漏了。

Minor

AGENTS.md

  • 修复 startRpcSession 签名参数名:cwdnewCwd,与 lib/rpc-manager.ts:162 的实际变量名一致。

✅ 验证

  • npm test:135/135 全部通过
  • npx tsc --noEmit:通过
  • npm run lint:通过
  • npm run dist:生成 Pi-Agent-Desktop-Setup-0.7.13.exe(199.68 MB)

📝 Review 过程

由 3 个并行 subagent(GLM-5.2)审查 v0.7.12:

  • Agent 1:依赖升级(package.json / lockfile)
  • Agent 2:测试修复(process-tree / installer-script)
  • Agent 3:文档更新(AGENTS / CLAUDE / ARCHITECTURE)

共发现 2 个 Critical、5 个 Important、8 个 Minor 问题。本次提交修复所有 Critical 和 Important,Minor 中的 1 个(AGENTS.md 参数名)一并修复。

v0.7.12 — Pi Core 升级 0.78.0 → 0.7.8

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 21 Jun 01:11

🚀 v0.7.12 — Pi Core 升级(0.78.0 → 0.79.8)

升级上游 pi 核心依赖 @earendil-works/pi-ai@earendil-works/pi-coding-agent0.78.0 到最新的 0.79.8(上游 2026-06-19 发布,跨越 10 个版本)。

📦 安装

下载下方 Pi-Agent-Desktop-Setup-0.7.12.exe(约 200 MB),双击运行即可。已安装旧版本的用户直接运行新安装包即可覆盖升级,安装程序会自动关闭运行中的实例。

✨ 上游主要变更(对桌面端影响最大的)

v0.78.1 —— Electron 打包关键修复

  • 修复 SDK 嵌入打包 Node 应用时 ENOENT 失败(createAgentSession() 不再要求 bundle 旁有 package.json),直接修复 Electron 场景
  • 修复 HTML session export 中的存储型 XSS
  • 修复超大 JSONL 会话文件的打开/列出(改用逐行读取)

v0.79.0 —— 项目信任机制

  • 加载 .pi 配置前询问用户(defaultProjectTrust 设置可控制默认行为)

v0.79.5 —— Provider 配置

  • 全局 httpProxy 设置(统一 HTTP_PROXY/HTTPS_PROXY
  • auth.json API key 支持 provider 级别的 env 覆盖

v0.79.6 —— 关键 fetch 修复

  • 修复 HTTP dispatcher 不再覆盖 caller 显式传入的 fetch 实现

v0.79.7 —— RPC 客户端

  • RPC unknown-command 错误现在包含 request id,避免客户端 hang 等待响应

v0.79.8(最新)—— 对桌面端最有价值

  • Selective provider base entry points@earendil-works/pi-ai/base + @earendil-works/pi-agent-core/base,让打包应用排除未使用的 provider transports,减小 Electron bundle 体积
  • Post-compaction token 估算compact 结果和 compaction_start/compaction_end 事件现在包含估算的 post-compaction token 数 —— 可以在 UI 显示上下文压缩量
  • Mistral prompt caching(session affinity + cached-token usage/cost accounting)
  • 安全修复:undici 和打包的 protobufjs 漏洞
  • 修复 overflow 触发的 auto-compaction 重试已完成响应

🔧 本仓库的修复

修复了 3 个验证升级时发现的 pre-existing 测试失败(与本次升级无关,但一起修了):

  • electron/process-tree.test.ts:改用逐行读取 parent stdout 直到拿到有效 PID,避免并行测试负载下首个 chunk 切分导致 childPid 解析为 NaN
  • lib/installer-script.test.mjs:同步正则以匹配已重构为 Get-Process 的安装脚本(性能优化时把 Get-CimInstance Win32_Process 改了,但测试断言未同步)

✅ 验证

  • npm test:135/135 全部通过
  • npx tsc --noEmit:通过
  • npm run lint:通过
  • npm run dist:生成 Pi-Agent-Desktop-Setup-0.7.12.exe(199.68 MB)

完整 changeloghttps://github.com/earendil-works/pi/releases(v0.78.1 → v0.79.8)

v0.7.11

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 16 Jun 05:10

🚀 Features / 新特性

  • Native Custom Title Bar / 原生自定义标题栏
    • Integrated a custom title bar that perfectly matches the application's visual theme (both dark and light modes).
    • 移除了传统的 Windows 标题栏,实现了与应用深浅色主题完美融合的原生自定义标题栏。
    • Maintained the standard Windows 11 window controls (minimize, maximize, close) with proper snap layouts support.
    • 保留了 Windows 11 原生的窗口控制按钮(最小化、最大化、关闭),并支持贴靠布局。
    • Added a drag region to the top toolbar for seamless window dragging.
    • 在顶部工具栏增加了拖拽区域,方便直接拖动整个应用窗口。

🐛 Bug Fixes / 问题修复

  • Fixed an issue where the file panel toggle button and standard window controls could overlap.
  • 修复了文件面板开关按钮与系统窗口控制按钮可能重叠的问题,为其分配了专属的安全边距。

v0.7.10

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 13 Jun 18:33

Pi Agent Desktop v0.7.10 😎

🇨🇳 中文说明

我们很高兴发布 v0.7.10 版本!本次更新专注于系统架构稳定性、渲染效率以及异步 I/O 吞吐性能的深度优化。我们解决了一系列潜在的连接风暴、内存泄漏和主线程同步阻塞问题,以带来更稳定、低延迟的高频流式对话体验。

🚀 核心改进与优化

  1. SSE 连接指数退避重连与自愈故障恢复 (优化点 5)
    • 改进:SSE 连接断开时的自动重试机制从固定 1 秒探针升级为指数退避重连算法(1s -> 2s -> 4s -> 8s -> 16s,最大 30s 延迟),并将连续失败尝试次数上限限制为 5 次。
    • 自愈:当自动重连耗尽进入失败状态时,聊天视口顶部将渲染红色网络异常通知条,支持用户一键“手动重新连接”并重置重试计数。
  2. onDestroy 清理回调队列 (优化点 6)
    • 改进:重构了 AgentSessionWrapper 中的清理注销逻辑,支持同时安全注册多个注销钩子。销毁会话时采用 try-catch 循环保护执行所有回调。
    • 收益:避免了多个内部模块间清理动作互相覆盖的隐患,彻底消除 Electron 与 Server 的 IPC 句柄内存泄露。
  3. 去定时器化与消息组件 Memo 隔离 (优化点 7 & 8)
    • 改进:将 UserMessageViewAssistantMessageView 通过 React.memo 包裹以避免重复重绘;彻底移除了流式接收时每 300ms 心跳触发的 setInterval 轮询定时器,改用 useEffect 配合纯数据驱动推演 TPS 吞吐率和 thinking 运行时长。
    • 收益:消除了高频流式输出下的计时器和状态竞争(Timer-State Competition),极大降低了 CPU 占用,打字流更加平稳流畅。
  4. 全异步会话 I/O 文件加载 (优化点 9)
    • 改进:全面使用 fs/promises 重写读盘机制,实现异步 JSONL 解析与首行会话头读取,替换掉原先在 API 接口中同步阻塞的 SessionManager.open() 方法。
    • 收益:防止在加载、切换较大会话历史文件时死锁 Node.js 服务端的事件循环,消除了页面出现无响应或卡顿的现象。
  5. 消息列表原生 CSS 虚拟化 (优化点 10)
    • 改进:在消息列表容器中引入了现代浏览器原生的 CSS 虚拟化特性:content-visibility: autocontain-intrinsic-size: auto 150px
    • 收益:由 Chromium 容器自动跳过视口外消息 DOM 的排版重绘计算。既保持了极简的 DOM 结构,又完美兼容现有的 React Ref 滚动锚定,保障超长历史对话下的 60fps 流畅滑动。
  6. 规范硬化与 100% 测试通过
    • 移除了测试代码中所有遗留的 explicit any,清理了所有未使用的变量及导入。
    • 类型校验 (npx tsc --noEmit)、ESLint 代码规范审计 (npm run lint) 和全量单元测试(135 个用例 100% 通过)均无错通过。

🇬🇧 English Release Notes

We are excited to release v0.7.10! This release focuses on deep optimizations in system architectural stability, rendering efficiency, and asynchronous I/O performance. We resolved potential connection storms, memory leaks, and event-loop blocking issues to deliver a smoother, low-latency, high-frequency streaming conversation experience.

🚀 Key Improvements & Optimizations

  1. Exponential Backoff Reconnection & Self-Healing (Opt 5)
    • Change: Replaced the fixed 1-second reconnect probe for Server-Sent Events (SSE) with an Exponential Backoff Reconnection Algorithm (1s -> 2s -> 4s -> 8s -> 16s, capped at 30s) and capped consecutive failures at 5 attempts.
    • Self-Healing: When attempts are exhausted, a red network error banner appears at the top of the chat, allowing users to trigger a manual reconnect instantly and reset the retry count.
  2. Multiple onDestroy Cleanup Callbacks (Opt 6)
    • Change: Upgraded the cleanup mechanism in AgentSessionWrapper to support a registry of multiple callback hooks, executed safely within a try-catch loop upon session destruction.
    • Impact: Eliminates cleanup overrides between internal modules, completely resolving memory and IPC handle leakage between Electron and the server.
  3. No-Timer TPS Calculation & Memoized Message Views (Opt 7 & 8)
    • Change: Wrapped sub-message views (UserMessageView, AssistantMessageView) with React.memo to isolate rendering. Removed the 300ms setInterval heartbeat loop, using a pure data-driven useEffect to calculate TPS and thinking duration on block updates.
    • Impact: Resolves timer-state competition during token streaming, drastically lowering CPU usage and resulting in a much smoother typewriter effect.
  4. Fully Asynchronous Session I/O Loading (Opt 9)
    • Change: Rewrote JSONL file loading and header extraction with asynchronous I/O using fs/promises. Removed all blocking synchronous SessionManager.open() invocations within the API layer.
    • Impact: Prevents Node.js event-loop starvation when loading or switching large session files, eliminating freeze and stutter issues.
  5. Native CSS Virtualization for Message Lists (Opt 10)
    • Change: Integrated native browser virtualization using content-visibility: auto and contain-intrinsic-size: auto 150px on message wrapper elements.
    • Impact: Offloads off-screen DOM layout and repaint operations directly to Chromium. This keeps the DOM tree lightweight while preserving existing React Refs and scroll anchoring, ensuring a fluid 60fps scrolling experience for long conversations.
  6. Strict Code Audits & 100% Unit Test Pass
    • Removed all explicit any casts from test mocks and cleaned up all unused imports and variables.
    • Successfully validated TypeScript types (npx tsc --noEmit), passed ESLint audits (npm run lint), and passed 135/135 unit tests successfully.

v0.7.9

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 10 Jun 14:29

中文

🔒 安全加固

  • 为 AgentSession 增加 JSONL 写入锁机制,防止多请求并发写入导致会话文件损坏。
  • 改进 API 错误处理:统一错误响应格式,避免敏感信息泄露到客户端。
  • 修复 Electron 构建配置中环境变量过滤逻辑,防止服务端环境变量泄漏到渲染进程。

📋 Electron 日志增强

  • 日志格式新增 scope 字段,支持区分主进程、渲染进程和子进程日志来源,便于多源日志排查。

⚡ 大文件查看性能优化

  • FileViewer 新增虚拟化渲染层:仅渲染可视区域内的代码行,大幅降低大文件(>5000 行)打开时的内存占用和卡顿。
  • 大文件自动切换为纯文本模式,保留行号显示,避免语法高亮导致界面无响应。

🔄 自动更新支持

  • electron-updater 从开发依赖移至运行时依赖,确保生产构建中包含自动更新功能。
  • 精简 electron-builder 打包资源,移除冗余文件减小安装包体积。

🧪 测试体系完善

  • 统一所有测试入口为 npm test 单一命令,同步更新 CI 配置。
  • 新增 log-formatfile-viewer-virtualizationrpc-manager 等模块的测试覆盖。

🧹 代码清理

  • 删除过时的架构评审文档、实施计划、设计规格书等约 10,000 行历史文档。
  • 清理未使用的 Open Design skill 脚手架和临时图片资源。
  • 更新 .gitignore 忽略开发时产生的临时日志和 /tmp/ 目录。

English

🔒 Security Hardening

  • Added JSONL write-lock mechanism for AgentSession to prevent concurrent write corruption of session files.
  • Improved API error handling with unified error response format, preventing sensitive information leakage to the client.
  • Fixed Electron build config environment variable filtering to prevent server-side env vars from leaking to the renderer process.

📋 Enhanced Electron Logging

  • Added scope field to log format, enabling differentiation between main process, renderer process, and child process log sources for easier multi-source debugging.

⚡ Large File Viewer Performance

  • Added virtualization layer to FileViewer: only renders code lines within the visible viewport, dramatically reducing memory usage and lag when opening large files (>5000 lines).
  • Large files automatically switch to plain-text mode with line numbers, preventing syntax-highlighting from freezing the UI.

🔄 Auto-Update Support

  • Moved electron-updater from devDependencies to runtime dependencies, ensuring auto-update functionality is included in production builds.
  • Trimmed electron-builder packaging resources to reduce installer size.

🧪 Test Infrastructure

  • Unified all test entry points under a single npm test command, synchronized CI configuration accordingly.
  • Added test coverage for log-format, file-viewer-virtualization, rpc-manager, and other modules.

🧹 Housekeeping

  • Removed ~10,000 lines of obsolete architecture review docs, implementation plans, and design specs.
  • Cleaned up unused Open Design skill scaffolding and temporary image assets.
  • Updated .gitignore to exclude dev-time temp logs and /tmp/ directory.

v0.7.8

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 04 Jun 14:23

中文

  • 完成剩余 P1 加固:增强桌面端本地服务启动、重启恢复和端口选择逻辑。
  • 优化大文件源码查看:大文件自动使用纯文本渲染并保留行号,避免语法高亮导致界面卡顿。
  • 加固技能搜索 API 地址校验:生产环境仅允许官方 https://skills.sh,开发/测试环境仅允许 HTTPS localhost。
  • 优化 Electron 打包资源配置,确保更新器依赖和 Next.js standalone 运行时资源随安装包发布。
  • 增加针对文件查看器、端口选择和技能搜索地址白名单的测试覆盖。

English

  • Completed remaining P1 hardening for desktop local service startup, restart recovery, and port selection.
  • Improved large source file viewing by switching large files to a plain text renderer with line numbers to avoid syntax-highlighting stalls.
  • Hardened Skills API base URL validation: production is restricted to official https://skills.sh, while development/test localhost overrides must use HTTPS.
  • Improved Electron packaging resources so updater dependencies and Next.js standalone runtime files are included in the installer.
  • Added test coverage for the file viewer, port selection, and Skills API URL allowlist behavior.

v0.7.7

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 02 Jun 14:36

0.7.7 更新内容

新功能

  • /statusline 斜杠命令 + git 状态 API — 切换底部状态栏(窗口 + 会话 + git)。新增 GET /api/statusline?cwd=... 路由,返回分支、与上游的 ahead/behind 数量、修改/暂存/未跟踪/已删除文件数,以及最近一次提交。

API 错误处理重构(P1-1)

  • 新增 lib/api-error 辅助函数:errorMessage()getRequestId()logApiError()
  • 14 个 API 路由迁移到新 helpers;所有响应现在都带 x-request-id 响应头,便于跨栈关联日志。

Bug 修复

  • useAgentSession 挂载副作用(P0-6) — 切换 session 时正确重置状态,避免残留的 streaming / compacting 状态。
  • lib/normalize.ts — 去除冗余类型断言。

测试

  • 新增 31 个单元测试,覆盖 lib/api-errorlib/normalizelib/slash-commands(含新增的 /statusline 项)。

文档

  • 新增 P0 架构评审、设计文档与实施计划,位于 docs/superpowers/

完整变更:v0.7.6...v0.7.7


What's in 0.7.7

New Features

  • /statusline slash command + git status API — toggle the bottom status bar (window + session + git). New GET /api/statusline?cwd=... route returns branch, ahead/behind counts, modified/staged/untracked/deleted file counts, and last commit.

API error handling refactor (P1-1)

  • New lib/api-error helpers: errorMessage(), getRequestId(), logApiError().
  • 14 API routes migrated to use the helpers; every response now carries an x-request-id header for cross-stack correlation.

Bug fixes

  • useAgentSession mount effect (P0-6) — properly resets state on session change to avoid stale streaming/compacting state.
  • lib/normalize.ts — removed redundant type casts.

Tests

  • 31 new unit tests covering lib/api-error, lib/normalize, and lib/slash-commands (including the new /statusline entry).

Documentation

  • P0 architecture review, design specs, and implementation plans under docs/superpowers/.

Full Changelog: v0.7.6...v0.7.7

v0.7.5

Choose a tag to compare

@Chasen-Liao Chasen-Liao released this 30 May 06:26

Changes

  • Add slash command menu in the chat input.
  • Show built-in commands and enabled skills from the current workspace.
  • Bump desktop app version to 0.7.5.