Repository navigation
feat(sidebar): open workspace in the system file manager - #907
Merged
Merged
Conversation
Adds a button left of the terminal button in the file explorer header that opens the current session workspace in Explorer (Windows), Finder (macOS), or xdg-open (Linux). The path goes through the same allow-list as /api/terminal, and requests that do not come from a loopback host are refused so a phone on the LAN does not raise a window on the server. That host check is a usability guard, not access control: the real boundaries are the default 127.0.0.1 bind and the path allow-list.
Kano-u
added a commit
to Kano-u/pi-web
that referenced
this pull request
Sep 29, 2026
Owner
|
Thanks @Xiaooi, we're going with this one for #859. It's the narrow version we want: one button on the explorer root, directories only, the same allow-list as Merged locally with current Small follow-ups, none blocking:
Generated by Claude Code |
agegr
added a commit
that referenced
this pull request
Sep 30, 2026
* fix(open-in-explorer): authorize the path before looking at it POST stat()ed the requested cwd before the allow-list check, so a path outside the roots answered 400 (a file), 500 (missing) or 403 (a directory) and told the caller whether it exists. Check the allow-list first; isExistingFilePathAllowed() already requires the path to exist. Also translate the new module's comments to English like the rest of the codebase, note that macOS `open` launches .app bundles, and add the route to the AGENTS.md file map. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * refactor(subagents): share parseNpmSource through lib/npm-source subagents.ts imported plugin-updates.ts only for parseNpmSource, which pulled child_process, semver and the SDK package manager into the session-reader import graph. Move the parser into a dependency-free module that both use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * fix(chat): word the unanswered truncation notice for a full context too A length stop with no answer is not always thinking's fault: pi clamps the output to the room left in the context, so a nearly full context can return nothing at all. Name both causes and drop the fixed "medium or below" advice, which is wrong for sessions already on a low level. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ --------- Co-authored-by: Claude <[email protected]>
Kano-u
pushed a commit
to Kano-u/pi-web
that referenced
this pull request
Oct 2, 2026
Kano-u
pushed a commit
to Kano-u/pi-web
that referenced
this pull request
Oct 2, 2026
…#907 agegr#941 agegr#946 agegr#961 agegr#968 agegr#969 agegr#1007 agegr#1008 agegr#1009 agegr#1010) 上游已把我们提前摘取的 agegr#884 / agegr#871 / agegr#996 / agegr#961 原样合并(agegr#961 逐字节相同), agegr#967 与 agegr#963 由上游的 agegr#1009 / agegr#1008 接管。 冲突解决: - demo/ 对齐上游 fe288c0,撤销 agegr#963 对 demo 的两处改动(`@/lib/chat-phase-label` 在 demo/lib 下不存在,会打断 Pages 构建)。 - AGENTS.md:保留我们的 default-project 条目,open-folder 换成上游的 open-in-explorer。 - MessageView.tsx / SessionSidebar.tsx / FileExplorer.tsx:以上游为准, DismissButton 采用上游的独立文件,保留我们的思考卡片与文件管理改动。 - SessionSidebar 移除引用已删函数的旧 agegr#951 工作区按钮(agegr#951 的其他入口另行收尾)。
Kano-u
pushed a commit
to Kano-u/pi-web
that referenced
this pull request
Oct 2, 2026
上游只接受「资源管理器头部一个按钮」的窄版(agegr#907 / a0c00f3,含 agegr#1010 的收尾), 并以「超出薄前端范围」关闭了我们的宽版 agegr#951,因此移除 agegr#951 的两个额外入口: - 聊天回复里行内代码路径的 chip(MarkdownBody.tsx 还原上游版本, lib/file-links.ts、MarkdownBody.test.mjs、file-links.test.mjs 与 app/globals.css 的样式一并还原) - 文件查看器头部的「在资源管理器中显示」按钮 同时删除只服务于它们的模块:/api/open-folder、lib/open-folder.ts、 lib/path-actions.ts、hooks/useLocalFileManager.ts、lib/loopback-host.ts, 以及两条只被它们使用的 i18n 文案。上游的 /api/open-in-explorer + lib/open-in-file-manager.ts(含平台文案、远程/不支持时的置灰与错误提示) 保持不变。
Kano-u
pushed a commit
to Kano-u/pi-web
that referenced
this pull request
Oct 2, 2026
agegr#967 / agegr#963 已由上游的 agegr#1009 / agegr#1008 落地,agegr#961 上游原样合并(逐字节相同), agegr#951 已收敛到上游的 agegr#907,agegr#960 上下游都拒绝——这些都与上游一致,按台账规则删行。 agegr#899 上游关闭但本地保留,状态注明为永久分叉。
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
Adds a button left of the terminal button in the file explorer header that opens the current session workspace in Explorer (Windows), Finder (macOS), or xdg-open (Linux). The path goes through the same allow-list as /api/terminal, and requests that do not come from a loopback host are refused so a phone on the LAN does not raise a window on the server. That host check is a usability guard, not access control: the real boundaries are the default 127.0.0.1 bind and the path allow-list. Co-authored-by: xiao <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
* fix(open-in-explorer): authorize the path before looking at it POST stat()ed the requested cwd before the allow-list check, so a path outside the roots answered 400 (a file), 500 (missing) or 403 (a directory) and told the caller whether it exists. Check the allow-list first; isExistingFilePathAllowed() already requires the path to exist. Also translate the new module's comments to English like the rest of the codebase, note that macOS `open` launches .app bundles, and add the route to the AGENTS.md file map. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * refactor(subagents): share parseNpmSource through lib/npm-source subagents.ts imported plugin-updates.ts only for parseNpmSource, which pulled child_process, semver and the SDK package manager into the session-reader import graph. Move the parser into a dependency-free module that both use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * fix(chat): word the unanswered truncation notice for a full context too A length stop with no answer is not always thinking's fault: pi clamps the output to the room left in the context, so a nearly full context can return nothing at all. Name both causes and drop the fixed "medium or below" advice, which is wrong for sessions already on a low level. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ --------- Co-authored-by: Claude <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
Adds a button left of the terminal button in the file explorer header that opens the current session workspace in Explorer (Windows), Finder (macOS), or xdg-open (Linux). The path goes through the same allow-list as /api/terminal, and requests that do not come from a loopback host are refused so a phone on the LAN does not raise a window on the server. That host check is a usability guard, not access control: the real boundaries are the default 127.0.0.1 bind and the path allow-list. Co-authored-by: xiao <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
* fix(open-in-explorer): authorize the path before looking at it POST stat()ed the requested cwd before the allow-list check, so a path outside the roots answered 400 (a file), 500 (missing) or 403 (a directory) and told the caller whether it exists. Check the allow-list first; isExistingFilePathAllowed() already requires the path to exist. Also translate the new module's comments to English like the rest of the codebase, note that macOS `open` launches .app bundles, and add the route to the AGENTS.md file map. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * refactor(subagents): share parseNpmSource through lib/npm-source subagents.ts imported plugin-updates.ts only for parseNpmSource, which pulled child_process, semver and the SDK package manager into the session-reader import graph. Move the parser into a dependency-free module that both use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ * fix(chat): word the unanswered truncation notice for a full context too A length stop with no answer is not always thinking's fault: pi clamps the output to the room left in the context, so a nearly full context can return nothing at all. Name both causes and drop the fixed "medium or below" advice, which is wrong for sessions already on a low level. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ --------- Co-authored-by: Claude <[email protected]>
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.
What
Adds a button to the file explorer header (left of the terminal button) that opens the current session workspace in the OS file manager: Explorer on Windows, Finder on macOS,
xdg-openelsewhere.Why
Reviewing files the agent just wrote usually means reaching for the OS file manager. Until now the only way was to copy the path out of the app.
How
lib/open-in-file-manager.ts— platform to command mapping, loopback-host check, detached launch.explorer.execan exit with code 1 even on success, so only spawn success counts.app/api/open-in-explorer/route.ts—GETcapability probe (supported/reason/platform) so the UI can label and disable the button;POSTopens the folder. The path goes through the same allow-list as/api/terminal(getAllowedFileRoots()+isExistingFilePathAllowed()).components/SessionSidebar.tsx— the button plus an inline, dismissible error line.components/DismissButton.tsx— extracted fromFileExplorer.tsxso both reuse it.The button is disabled when the request does not come from a loopback host, so a phone on the LAN does not raise a window on the server. That check is a usability guard, not access control —
Hostis client-controlled. The real boundaries are the default127.0.0.1bind and the path allow-list.Testing
npx tsc --noEmit,npm run lint,npm testpass locally.Host: 192.168.1.20→ 403; path outside the allow-list → 403; missingcwd→ 400; failures stay visible until dismissed and clear on the next success.openand Linuxxdg-open(no machine available) — covered by unit tests only.