Skip to content

Commit 80d9162

Browse files
author
Yogthos
committed
fix: show resolved absolute path in permission dialog, restore buffer.rs
When the LLM sends malformed paths like '1' as a write target, the permission dialog showed 'path: 1 (inside project)' which confused users — they couldn't tell what file would be modified. Now shows both the raw input AND the resolved absolute path: 'path: 1 → /home/user/project/1 (inside project)'. Also reverted ui/buffer.rs corruption from botched merge.
1 parent a2bce4e commit 80d9162

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

src/ui/mod.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3492,19 +3492,27 @@ pub async fn run_interactive(
34923492
| "list_symbols" | "get_symbol_body"
34933493
| "find_definition" | "find_callers" | "find_callees" => {
34943494
let cwd = session.working_dir.as_str();
3495-
let path_hint = if !cwd.is_empty() {
3495+
if !cwd.is_empty() {
34963496
let abs = crate::permission::checker::resolve_absolute(
34973497
&ask_req.input, cwd,
34983498
);
3499-
if abs.starts_with(cwd) {
3500-
" (inside project)"
3499+
let hint = if abs.starts_with(cwd) {
3500+
"(inside project)"
35013501
} else {
3502-
" (outside project)"
3502+
"(outside project)"
3503+
};
3504+
// Show both the raw input AND the resolved absolute
3505+
// path so the user can see what file will actually
3506+
// be modified — crucial when LLM sends nonsense like
3507+
// path: "1" that resolves to /cwd/1.
3508+
if abs == ask_req.input || abs == safe_input {
3509+
format!("path: {} {}", abs, hint)
3510+
} else {
3511+
format!("path: {} → {} {}", safe_input, abs, hint)
35033512
}
35043513
} else {
3505-
""
3506-
};
3507-
format!("path: {}{}", safe_input, path_hint)
3514+
format!("path: {}", safe_input)
3515+
}
35083516
}
35093517
"bash" => format!("command: {}", safe_input),
35103518
"task" | "task_status" => format!("task: {}", safe_input),

0 commit comments

Comments
 (0)