Trim the deployment directory pasted into the desktop setup screen - #454
Merged
davidmckayv merged 2 commits intoSep 9, 2026
Merged
Conversation
The screen enables Start on `root.trim() !== ""` and then sent the untrimmed string -- the same trap the four settings beside it were taken out of. A trailing space makes a second directory beside the one `default_root` names, so the tray's Stop and the next launch look somewhere else; a leading space stops the path being absolute, so the deployment lands wherever the window is running from. Trimmed at both ends now, with spaces inside the path left alone.
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 8, 2026 22:31
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # CHANGELOG.md
davidmckayv
approved these changes
Sep 9, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed against the real Rust (no exfil/backdoor/injection; correctness verified). Both CI and Desktop (rust build) green on this head. CHANGELOG rebase on validated substance.
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.
#417 trimmed four of the values entered on the desktop setup screen. There is a fifth on the same
screen — Where OpenBot lives — and it is still sent untrimmed, gated by the same
trim()thatprompted that fix.
The gap
desktop/src/App.tsxenables Start on the trimmed value and sends the raw one:Three commands take that string and make a path of it verbatim:
This one is not a credential, it is a place on disk, so the two ways it goes wrong are different
from the credential case:
Stop calls
default_root()and the next launch is offereddefault_root()again, and neither hasthe space in it — so the deployment that was laid down is one nothing on screen reaches: Stop runs
compose downin the wrong tree, and starting again re-fetches the whole release into the otherdirectory.
" /home/me/OpenBot"is not absolute —Path::componentsreads it as" ","Users", … and thedeployment is laid out relative to wherever the window is running from.
A path picks these up the same way a key does: copied out of a document, or dragged in with the
newline at the end of the line.
The change
One trim, at the point the typed string becomes a path, named so all three commands share it. Both
ends only — a space inside a path is part of a directory's name.
Failing first
mainhas no such function, so the fail-before run implementsroot_fromasmain's own rule,which is
PathBuf::from(typed)at each of the three call sites, and nothing else:With
typed.trim():85 of those 87 are the suite as it stands on
main, all still passing.Against over-correcting
a_space_inside_the_path_is_part_of_the_pathpins what must still come through untouched, and itpassed in the failing run above as well as after the change — the trim must not reach inside the
path:
/home/me/My Files/OpenBot— a home directory with a space in it.C:\Users\me\Open Bot— the same on Windows./home/me/OpenBot— an ordinary path, handed back exactly as it was.The trade this does make is that a directory whose name genuinely ends in a space can no longer be
named from this box. That is the same trade #417 made for the credentials, for the same reason: the
screen's own enable check already treats the trimmed value as the value, so a person who typed one
was going to be told the button was available and then given something else.
Verified with
clippy finished with no warnings on the crate;
fmt --checkis clean.Note on the changelog
A deployment behaves differently afterwards — the directory a person names is the directory that is
used — so there is a
## Unreleasedentry. It shares that anchor with other open pull requests andmay need a one-line rebase.