Skip to content

fix(watcher): 修复会话文件变更归属与高噪声过滤【已审核 PR】 - #1739

Open
Andreaseszhang wants to merge 1 commit into
proma-ai:mainfrom
Andreaseszhang:fix/session-change-attribution-202608181529
Open

fix(watcher): 修复会话文件变更归属与高噪声过滤【已审核 PR】#1739
Andreaseszhang wants to merge 1 commit into
proma-ai:mainfrom
Andreaseszhang:fix/session-change-attribution-202608181529

Conversation

@Andreaseszhang

Copy link
Copy Markdown
Contributor

概述

修复“本会话文件变更”的 watcher 路径归属:workspace 附件 IPC 失败时不再把全局路径错误归属给某个运行中会话,同时仍保留当前会话自身工作目录和会话级附件内的真实文件变化。补充 Python/uv 与测试缓存目录过滤,减少依赖产物填满右侧文件改动面板。

改动

  • apps/electron/src/renderer/hooks/useGlobalAgentListeners.ts — 将 watcher 归属改为显式 scope,区分 session-local 与 workspace 级路径。
  • apps/electron/src/renderer/lib/session-file-changes.ts — 新增可测试的 session watcher scope 归属逻辑;附件 IPC 不完整时仅匹配安全的 session-local 路径。
  • apps/electron/src/renderer/lib/session-file-changes.test.ts — 覆盖缺失 session、workspace scope 不完整及完整 scope 的路径边界。
  • apps/electron/src/main/lib/workspace-watcher-utils.ts — 忽略 .venvvenv、Python 测试缓存、__pypackages__.gradle 等高噪声目录。
  • apps/electron/src/main/lib/workspace-watcher.test.ts — 覆盖新增过滤目录,并确认通用 coverage/target/ 目录继续可观察。
  • apps/electron/package.json — Electron patch 版本升级至 0.17.43

测试方法

  1. 运行 bun test apps/electron/src/main/lib/workspace-watcher.test.ts apps/electron/src/renderer/lib/session-file-changes.test.ts
  2. 结果:8 个用例、24 个断言通过。
  3. 运行 git diff --check,通过。
  4. 运行时 A/B:正式版在 .venv 测试目录生成 500+ 文件后出现于右侧;本分支 dev 版未出现,确认 watcher 过滤生效。

备注

  • target/coverage/ 不做全局忽略,避免隐藏项目业务产物;其内部若包含既有 build/ 等高噪声段,仍遵循已有规则。
  • 完整 typecheck 未运行:该临时 worktree 未安装依赖,环境中没有 tsc

Made with Proma · GitHub

Prevent cross-session watcher attribution while retaining session-local paths during workspace attachment IPC failures. Ignore Python environment and cache directories without hiding generic target or coverage outputs.

Made-with: Proma
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