Repository navigation
fix(computer): resolve a leading ~ in file tool paths to the computer's home - #2102
Merged
Merged
Conversation
…'s home File tools treated `~/notes/x` as a relative path, so on a team computer it was written to `bots/<id>/~/notes/x`, a literal `~` directory the shell never sees. The workspace root is the computer's home, so a leading `~` or `~/` now resolves to that root, the same as a leading `/`. `..` is still rejected.
|
@tc3oliver is attempting to deploy a commit to the Inbox Zero Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
[Medium impact] The PR appears safe to merge within its stated scope. SummaryFile tools now treat a leading
Reviews (2) · Last reviewed commit: "fix(computer): keep root display paths f..." · Reviewed by Greptile |
1 task done
Contributor
Playwright screenshotsNo new feature frames; gallery is suite-vs-main drift. Open screenshot gallery · Dashboard · CI run Updated for commit |
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.
Why
A bot that writes
~/notes/expenses.jsonlwith a file tool expects the file in its home directory, where its shell sees~. The file tools treated~as an ordinary folder name, so on a team computer the file landed in a literal~directory under the bot's folder, and the bot's shell commands could not find it at the path it used.What changed
File tool paths now treat a leading
~or~/as the workspace root, the same way a leading/already works, both when resolving a path and when shortening it for display.~name/xis left alone, and..is still rejected.On the Docker computer the workspace root is the shell's home, so file tools and shell now agree on
~. Hosted providers that keep the workspace in arakazo-homefolder under the user's home still differ from the shell, as they already do for/; that needs a provider-level change and is out of scope here.How tested
New unit tests cover
~,~/x, a backslash separator,~/shared/...,~x/y(not expanded) and~/../x(still throws) on team computers, a dedicated-computer case, and a listing under~/botskeeping its root path. They fail without the change. Lint and typecheck pass.