fix(tee): render absolute log path in hints instead of ~ shorthand#2701
Closed
cc1a2b wants to merge 1 commit into
Closed
fix(tee): render absolute log path in hints instead of ~ shorthand#2701cc1a2b wants to merge 1 commit into
cc1a2b wants to merge 1 commit into
Conversation
The tee "full output" and "see remaining: tail …" hints rendered the log path with the `~` home-directory shorthand. That form is not usable when copied verbatim into a follow-up shell command: `~` does not expand inside quotes and home paths can contain spaces (e.g. macOS `~/Library/Application Support`), so agents/LLMs that reuse the path hit "file not found" — and paths with spaces/backticks can even trigger spurious permission prompts. Render the absolute path in `display_path`, the single source shared by both hints. The path is already absolute (built from `data_local_dir()`), so this only drops the `~` strip-prefix step. Add a regression test for a path under the home directory; the existing tests use `/tmp` paths and never exercised the `~` branch. Closes rtk-ai#1644
|
|
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.
Summary
~home-directory shorthand, which is not safely copy-pasteable.~does not expand inside quotes, and home paths can contain spaces (e.g. macOS~/Library/Application Support), so agents/LLMs that reuse the path verbatim hit "file not found" (and space/backtick paths can even trigger spurious tool-permission prompts).display_path— the single source shared by both the[full output: …]hint and the[see remaining: tail -n +N …]hint. The path is already absolute (built fromdata_local_dir()), so this only drops the~strip-prefix step.format_hinttests use/tmppaths and never exercised the~branch.Note: this is a fresh, rebased-on-
developtake on the same fix previously explored in the now-closed #1657 (closed by its author as stale), extended to cover both hints via the shareddisplay_pathhelper plus a home-path regression test.Test plan
cargo fmt --all -- --check— cleancargo clippy --all-targets— no new warnings ontee.rscargo test --bins core::tee— 21 passed (incl. newtest_display_path_is_shell_safe_for_home_paths)$HOME/Library/Application Support/rtk/tee/…now renders the absolute path (no~), socat "<path>"works when pasted.