#30051·open-webui

issue: Terminal working directory resets to the file browser root after every command

Author: frost19kCreated Sep 15, 2026Updated Sep 17, 2026
Labelsbug

Before Submitting

  • I searched open and closed issues and discussions for an existing report.
  • I checked whether this is already fixed on the dev branch or latest source.
  • I understand that maintainers want a well-written issue before any code pull request.
  • I am using the latest available version of Open WebUI for my install method.
  • This is not a security vulnerability.

Installation Method

Docker

Open WebUI Version

v0.11.3

Operating System

Debian 13

Browser

Firefox

Ollama Version

No response

Summary

In a chat with Open Terminal enabled, after selecting a folder in the file browser panel, the terminal session's working directory follows the selection — but only until the next command is run. Every command execution is followed by a silent reset of the session's working directory back to the file browser root, so from the second command onward everything runs in the root regardless of the folder the user selected.

Expected Behavior

Once a folder is selected in the file browser, the session's working directory should remain in that folder until the user navigates elsewhere or agent runs a cd.

Actual Behavior

Command #1 after selecting a folder runs in the selected folder (e.g. pwd prints [browser-root]/subfolder).

Command #2, seconds later, runs in the file browser root (pwd prints [browser-root]).

The file browser panel also visibly jumps back to the root after each command run.

The reset is silent: no error, no output, and the UI still shows the folder selection until the panel refreshes to root.

Steps to Reproduce

  1. Deploy Open WebUI (v0.11.3) with Open Terminal enabled and a file browser root configured (default or via OPEN_TERMINAL_FILE_BROWSER_ROOT).
  2. Open a chat, then open the file browser panel and navigate into a subfolder below the root.
  3. Run a first command, e.g. pwd — it prints the subfolder.
  4. Wait a few seconds and run pwd again — it now prints the root.
  5. In the container/reverse-proxy access logs, observe that each POST /execute is followed by a POST /files/cwd whose path is the root.

Logs, Screenshots, and Config

Additional Information

  • The reset is only observable when the selected folder is below the file browser root; selecting the root itself produces no visible change, which likely explains why this can go unnoticed.
  • Possibly related past work in the same component: #29000 / #29006 (file browser root clamp), though that issue concerns a different behaviour.
  • open-terminal version: 0.12.5 (installed via pipx inside the terminal container).