Skip to content

feat: 添加 Windows 原生支持 - #4

Open
ChenTingToDo wants to merge 1 commit into
mcncarl:mainfrom
ChenTingToDo:feat/windows-support
Open

feat: 添加 Windows 原生支持#4
ChenTingToDo wants to merge 1 commit into
mcncarl:mainfrom
ChenTingToDo:feat/windows-support

Conversation

@ChenTingToDo

@ChenTingToDo ChenTingToDo commented Jul 17, 2026

Copy link
Copy Markdown

背景

Agent Memory Vault 目前的安装与自动化流程主要面向 Unix/macOS。在 Windows 上,直接使用时会遇到以下问题:使用 fcntl 的模块无法导入、无扩展名的 shebang 脚本不能直接执行,并且缺少原生的 Stop Hook 与定时 Audit 适配。

这个 PR 在保留现有 macOS/Linux 工作流和 Memory 数据格式的前提下,补充一套可维护的 Windows 原生支持。

主要改动

  • 新增仅依赖标准库的跨平台进程锁:Unix 使用 fcntl,Windows 使用 msvcrt
  • 统一处理 $HOME / USERPROFILE、UTF-8 Git 路径、SQLite 连接释放和 Python 子进程启动
  • 新增 PowerShell 一键安装器、Codex Stop Hook wrapper/安装器,以及幂等的 Task Scheduler Audit 管理脚本
  • 扩展 Doctor,增加 Windows Python、Git、PowerShell、Codex Hook 和计划任务检查
  • 修复语义检索明确关闭时,Closeout 仍强制调用可选 Zvec 的问题
  • 增加 Windows 使用文档、兼容性审计、跨平台测试,以及 Ubuntu/macOS/Windows CI 矩阵

实际测试

  • python -m compileall -q scripts tests
  • python -m unittest discover -s tests -v:Windows 本机 44 项全部通过
  • python scripts/agent_memory_check.py --skip-state-db
  • 使用 Windows PowerShell 5.1 解析检查全部新增 .ps1 文件
  • 在两个相互独立的含空格临时目录中完成完整安装和 Doctor 检查
  • 完成 Vault 初始化、24 篇 Markdown 的 SQLite/FTS 索引、INDEX 生成,以及 Windows PowerShell 搜索命中
  • 重复写入检查返回 NOOP,claimed-only Closeout 成功并生成 Git commit
  • PowerShell Stop Hook 自动 Closeout 成功,退出码为 0
  • Task Scheduler 完成安装、状态检查、手动运行(LastTaskResult=0)和卸载
  • Codex Hook 安装器能够保留无关 Hook,并可重复执行而不重复添加

兼容性

  • Windows 10 / Windows 11
  • PowerShell 7;脚本语法兼容 Windows PowerShell 5.1
  • Python 3.10+
  • Codex、Obsidian、SQLite、Git

没有对 macOS/Linux 引入有意的破坏性改动。Zvec 仍为可选能力,本次本机端到端测试未安装 Zvec。

补充说明

Windows 专项审计和安装说明分别位于:

  • docs/windows-compatibility-audit.md
  • docs/windows.md

@ChenTingToDo
ChenTingToDo marked this pull request as ready for review July 17, 2026 18:30
@ChenTingToDo ChenTingToDo changed the title feat: add native Windows support feat: 添加 Windows 原生支持 Jul 17, 2026
@ChenTingToDo
ChenTingToDo force-pushed the feat/windows-support branch from 2822863 to 521eb31 Compare July 17, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant