open-webui/src
Classic298 8e4cc946ce
fix: emit the resolved file path in terminal file events (#30282)
When a model calls display_file, write_file or replace_file_content with a relative path, Open Terminal resolves it against the session working directory and returns the absolute path, but the event sent to the browser carried the raw argument instead. The file panel matches that string against the file browser root, a relative path never matches, so the preview never opens, the panel jumps to the root and the session working directory is rewritten to the root. With the root turned off (OPEN_TERMINAL_FILE_BROWSER_ROOT=filesystem) there is nothing to clamp to and the relative string is sent to the terminal as the new working directory, moving it silently. The tool call itself succeeds either way, so the failure only shows up as a panel that will not open the file the model just wrote.

Both events now carry the path from the tool result and fall back to the argument when the result cannot be read, which is what build_terminal_file_tool_result already does for the chat file attachment. The same one-line rule is applied to the direct tool server path in the frontend, where the browser runs the tool itself and the write_file branch beside it was already correct.

Checked against a live Open Terminal: relative arguments now emit the absolute path, absolute ones are unchanged, non-existent files and inline displays still emit nothing, unreadable or error results still fall back to the argument, and run_command is untouched.

Related to #30051
2026-09-21 00:31:14 -04:00
..
lib fix: show a code run's error output alongside what it printed (#30286) 2026-09-21 00:30:55 -04:00
routes fix: emit the resolved file path in terminal file events (#30282) 2026-09-21 00:31:14 -04:00
app.css refac 2026-09-10 19:05:36 -04:00
app.d.ts chat feature added 2023-10-08 15:38:42 -07:00
app.html refac 2026-07-27 19:39:36 -04:00
tailwind.css chore: format 2026-08-31 10:48:28 -04:00