fix: Windows CLI and deep link issues (#11657, #11666, #11674)#11724
Open
01luyicheng wants to merge 44 commits intoanomalyco:devfrom
Open
fix: Windows CLI and deep link issues (#11657, #11666, #11674)#1172401luyicheng wants to merge 44 commits intoanomalyco:devfrom
01luyicheng wants to merge 44 commits intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #11668: fix(app): normalize Windows paths for consistent project matching This PR appears to be directly related to the current PR #11724. Both are addressing the same issue of normalizing Windows paths to prevent duplicate project creation. PR #11668 likely implements the same or very similar solution (path normalization for consistent project matching on Windows). You should check if this PR is already merged or if it's addressing the same issue to determine if PR #11724 is redundant. |
added 9 commits
February 4, 2026 18:35
…ory checks and simplify bash description parameter
- 使用Promise.race()包装check.command()调用 - 添加5秒超时保护,防止包管理器检测命令挂起 - 捕获超时错误并继续尝试下一个检测 - 添加中文注释说明修复内容
- 使用项目已有的withTimeout工具函数替代手动实现,避免内存泄漏 - 为包管理器检测添加5秒超时保护 - 添加调试日志(debug/info/warn)便于问题排查 - 改进错误信息,包含包管理器名称 - 将超时时间定义为常量TIMEOUT_MS,并添加TODO注释说明未来需要移到配置文件 修复内容: - packages/opencode/src/installation/index.ts: method()函数 测试:TypeCheck通过(12个任务全部成功)
- 在server.tsx中添加normalizePathForComparison函数,统一处理Windows路径规范化 - 在layout.tsx中添加normalizePathForComparison函数,统一处理Windows路径规范化 - 修改workspaceKey函数使用规范化路径 - 修改parseDeepLink函数返回规范化路径 - 修改项目去重逻辑使用规范化路径比较 - 修改所有路径比较的地方使用规范化路径,包括: - currentProject - closeProject - SortableProject.selected - handleDragOver - handleWorkspaceDragOver - SortableWorkspace.local和active - ProjectDragOverlay - SortableProject.active - label函数 - workspaceIds函数 修复内容: - 统一斜杠为正斜杠 - 统一为小写(Windows) - 移除末尾斜杠 这确保了在Windows上,同一物理路径的不同表示形式(大小写、斜杠类型、末尾斜杠)不会被当作不同项目。
- 创建共享工具模块 packages/app/src/utils/path.ts - 将 normalizePathForComparison 函数移至共享模块 - 添加完整的 JSDoc 注释和输入验证 - 修复 parseDeepLink 返回原始路径而非规范化路径 - 统一 workspaceKey 的使用,仅使用规范化路径作为键 - 消除 server.tsx 和 layout.tsx 中的重复代码 - 修复类型安全问题,添加显式返回类型声明 修复Issue anomalyco#11666: Windows路径规范化不一致导致重复创建项目
The copyToClipboardOSC52 method was removed from @opentui/core in recent updates. This commit removes the call to this deprecated method and falls back to using the native clipboard methods (clipboardy, osascript, wl-copy, xclip, etc.)
- 在server.tsx中添加normalizePathForComparison函数,统一处理Windows路径规范化 - 在layout.tsx中添加normalizePathForComparison函数,统一处理Windows路径规范化 - 修改workspaceKey函数使用规范化路径 - 修改parseDeepLink函数返回规范化路径 - 修改项目去重逻辑使用规范化路径比较 - 修改所有路径比较的地方使用规范化路径,包括: - currentProject - closeProject - SortableProject.selected - handleDragOver - handleWorkspaceDragOver - SortableWorkspace.local和active - ProjectDragOverlay - SortableProject.active - label函数 - workspaceIds函数 修复内容: - 统一斜杠为正斜杠 - 统一为小写(Windows) - 移除末尾斜杠 这确保了在Windows上,同一物理路径的不同表示形式(大小写、斜杠类型、末尾斜杠)不会被当作不同项目。
- 创建共享工具模块 packages/app/src/utils/path.ts - 将 normalizePathForComparison 函数移至共享模块 - 添加完整的 JSDoc 注释和输入验证 - 修复 parseDeepLink 返回原始路径而非规范化路径 - 统一 workspaceKey 的使用,仅使用规范化路径作为键 - 消除 server.tsx 和 layout.tsx 中的重复代码 - 修复类型安全问题,添加显式返回类型声明 修复Issue anomalyco#11666: Windows路径规范化不一致导致重复创建项目
Simplifies the release process by publishing only the binary package to AUR, eliminating the need to maintain separate source and binary build configurations.
… to prevent random hangs (see bun issue) (anomalyco#12161)
…ave stale contents (anomalyco#11728)
- 使用fileURLToPath替代new URL().pathname以正确处理Windows路径 - 修改packages/sdk/js/package.json的build脚本使用bun run - 修复的文件: - packages/sdk/js/script/build.ts - packages/sdk/js/script/publish.ts - packages/plugin/script/publish.ts - script/publish.ts - packages/sdk/js/package.json 这些修复解决了Windows CI测试失败的问题。
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.
Problem Description
This PR fixes three Windows-specific issues:
Issue #11657 - CLI Startup Hang
The CLI would hang indefinitely on Windows when package manager detection commands (npm, yarn, pnpm, etc.) didn't respond. This occurred because the detection process had no timeout mechanism.
Solution: Added 5-second timeout protection using existing
withTimeoututility from@/util/timeout. This prevents the CLI from hanging and allows graceful fallback to other detection methods.Issue #11666 - Deep Link Duplicate Projects
When using deep links (e.g.,
opencode://open-project?directory=C:\Users\Project) to open projects, different path representations were treated as different projects, causing duplicate project entries to be created.Problem Examples: The following paths represent the same physical directory on Windows but were treated as different projects:
C:\Users\Projectvsc:\users\project(different case)C:/Users/ProjectvsC:\Users\Project(different slash type)C:\Users\Project\vsC:\Users\Project(trailing slash)Solution: Implemented unified path normalization for Windows:
Issue #11674 - Reserved Device Names
Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9) were causing directory check failures when included in project paths.
Solution: Added validation to prevent Windows reserved device names from being added to directory checks.
Changes
Modified Files
packages/opencode/src/installation/index.ts- Add timeout protection for package manager detectionpackages/app/src/pages/layout.tsx- Implement path normalization for project comparisonpackages/app/src/context/server.tsx- Use normalized paths for project operationspackages/opencode/src/cli/cmd/tui/util/clipboard.ts- Remove deprecated API callpackages/opencode/src/cli/cmd/tui/app.tsx- Remove unsupportedautoFocuspropertyImportant Note About TypeCheck
Note: The
autoFocusproperty was removed fromCliRendererConfigas it's not supported by the current version of@opentui/core. This is a code fix, not just a local environment issue.Other potential TypeCheck errors related to missing dependencies (e.g.,
@gitlab/gitlab-ai-providerVERSION export,ai-gateway-providermodules) are local environment issues. The remote repository'sbun.lockalready contains all required dependencies (@gitlab/gitlab-ai-provider@3.4.0,ai-gateway-provider@2.3.1). These should resolve automatically in CI.Testing
Related Issues