fix(workspace): preserve remote POSIX paths without macOS synthetic resolution - #7132
Conversation
|
| Filename | Overview |
|---|---|
| api/workspace.py | Remote workspace candidates and saved workspace entries now preserve normalized target-side POSIX paths without host-local canonicalization. |
| tests/test_remote_terminal_workspace.py | Adds regression coverage confirming that /home/developer remains unchanged when macOS-style synthetic resolution is simulated. |
Reviews (6): Last reviewed commit: "ci: trigger required checks (workflow di..." | Re-trigger Greptile
SummaryI read the complete two-file patch at head Code referenceThe intended fix is at if normalized_raw is not None and normalized_cwd is not None:
...
if posix_candidate == posix_base or _posix_is_within(posix_candidate, posix_base):
return Path(normalized_raw)
...
if candidate == base or _is_within(candidate, base):
return Path(raw)The first return is exactly what the reported macOS case needs. The regression at Diagnosis / recommendationKeep the absolute-POSIX branch change. Make the regression non-vacuous by monkeypatching Unless preserving raw non-POSIX target paths is independently required, leave the fallback return as Verification stepThe new test should fail on |
e2ad0df to
7b72267
Compare
|
Thank you for the thorough review and insightful suggestions! I have updated the PR (commit
Ready for re-review. |
…esolution (nesquena#7131) When hermes-webui runs on macOS with a remote terminal profile pointing to a Linux host (e.g. terminal.cwd='/home/<user>'), path resolution previously invoked Path.resolve(), expanding '/home' via macOS synthetic firmlinks to '/System/Volumes/Data/home/<user>' and failing validation. - Return Path(normalized_raw) directly from _remote_terminal_workspace_candidate - Check _remote_terminal_workspace_candidate in _clean_workspace_list before local _safe_resolve - Add unit test covering Linux /home/<user> remote paths without macOS expansion
b096714 to
6199ba3
Compare
…alfred-rootson) (#7150) Co-authored-by: n <a@n> Co-authored-by: alfred-rootson <alfred-rootson@users.noreply.github.com>
|
Shipping in exp-v0.52.249 — thanks @alfred-rootson. Verified the containment boundary holds: POSIX normalization rejects |
…esolution (nesquena#7132) * fix(workspace): preserve remote POSIX paths without macOS synthetic resolution (nesquena#7131) When hermes-webui runs on macOS with a remote terminal profile pointing to a Linux host (e.g. terminal.cwd='/home/<user>'), path resolution previously invoked Path.resolve(), expanding '/home' via macOS synthetic firmlinks to '/System/Volumes/Data/home/<user>' and failing validation. - Return Path(normalized_raw) directly from _remote_terminal_workspace_candidate - Check _remote_terminal_workspace_candidate in _clean_workspace_list before local _safe_resolve - Add unit test covering Linux /home/<user> remote paths without macOS expansion * ci: trigger required checks (workflow did not run on fork head) --------- Co-authored-by: n <a@n>
…a#7132, @alfred-rootson) (nesquena#7150) Co-authored-by: n <a@n> Co-authored-by: alfred-rootson <alfred-rootson@users.noreply.github.com>
Fixes #7131
Problem
When Hermes WebUI runs on macOS and uses a remote terminal profile (e.g., SSH backend) pointing to a Linux machine with
terminal.cwdset to/home/<user>, workspace path resolution fails with:On macOS (Darwin),
/homeis a synthetic firmlink mapped to/System/Volumes/Data/home. Calling Python's_resolve_path()/Path.resolve()on a target-side Linux path causes macOS to canonicalize/homeinto/System/Volumes/Data/home. Subsequent local filesystem checks (Path.exists()) fail because that path does not exist on the local macOS host.Solution
Path(normalized_raw)directly from_remote_terminal_workspace_candidate()once validated, bypassing local macOS_resolve_path()._clean_workspace_list(), check_remote_terminal_workspace_candidate(path)before attempting local_safe_resolve().tests/test_remote_terminal_workspace.pyensuring Linux home paths like/home/developerdo not expand to/System/Volumes/Data/home/developeron macOS.Verification
Ran
pytest tests/test_remote_terminal_workspace.py— 16/16 passed.