fix(watcher): 修复会话文件变更归属与高噪声过滤【已审核 PR】 - #1739
Open
Andreaseszhang wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复“本会话文件变更”的 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— 忽略.venv、venv、Python 测试缓存、__pypackages__、.gradle等高噪声目录。apps/electron/src/main/lib/workspace-watcher.test.ts— 覆盖新增过滤目录,并确认通用coverage/与target/目录继续可观察。apps/electron/package.json— Electron patch 版本升级至0.17.43。测试方法
bun test apps/electron/src/main/lib/workspace-watcher.test.ts apps/electron/src/renderer/lib/session-file-changes.test.ts。git diff --check,通过。.venv测试目录生成 500+ 文件后出现于右侧;本分支 dev 版未出现,确认 watcher 过滤生效。备注
target/与coverage/不做全局忽略,避免隐藏项目业务产物;其内部若包含既有build/等高噪声段,仍遵循已有规则。typecheck未运行:该临时 worktree 未安装依赖,环境中没有tsc。Made with Proma · GitHub