Problem
When Open Terminal is shared by a team through Open WebUI, every chat of a given user sees the same home directory. A user who asks the model to "build me this spreadsheet" in chat A also sees the leftovers of chats B..Z in the file browser. There is no way to scope a chat to its own area.
Current behaviour (verified on ghcr.io/open-webui/open-terminal:latest)
OPEN_TERMINAL_FILE_BROWSER_ROOT accepts home, filesystem, or an explicit path with exactly one placeholder, {{home}} (open_terminal/main.py:157).
- A per-session cwd does exist (
_session_cwds, TTL from OPEN_TERMINAL_SESSION_CWD_TTL, default 7 days, sliding window), but it is only ever written by POST /files/cwd (main.py:487) — i.e. when a human navigates in the file browser. run_command and the file tools only read it through _get_session_cwd, so the model cannot create a directory and "move into" it.
- It is in-process memory only, so it is also lost on container restart.
The only workaround today is manual: a human opens the panel once, navigates into a folder, and that chat stays anchored there — for at most 7 days, and not across restarts.
Proposal
Accept a {{session}} placeholder (the Open WebUI chat/session id) in OPEN_TERMINAL_FILE_BROWSER_ROOT, resolved in _file_browser_root() right next to {{home}}, creating the directory on first use:
OPEN_TERMINAL_FILE_BROWSER_ROOT="{{home}}/chats/{{session}}"
Each chat then gets its own workspace. Shared state remains possible by pointing at paths outside the session directory.
Ideally the same resolved path would also become the default cwd for run_command and the file tools — otherwise the model writes into $HOME while the browser displays the session directory.
Why not the existing options
- Multi-user mode isolates users, not chats.
- A static subdirectory (e.g.
~/workspace) is the same folder for every chat, and it must pre-exist for each user or the panel shows "Directory not found".
Environment
ghcr.io/open-webui/open-terminal:latest (multi-user), Open WebUI 0.11.0, Docker Swarm, sandbox network with no egress.
Happy to open a PR if the approach sounds right.
Problem
When Open Terminal is shared by a team through Open WebUI, every chat of a given user sees the same home directory. A user who asks the model to "build me this spreadsheet" in chat A also sees the leftovers of chats B..Z in the file browser. There is no way to scope a chat to its own area.
Current behaviour (verified on
ghcr.io/open-webui/open-terminal:latest)OPEN_TERMINAL_FILE_BROWSER_ROOTacceptshome,filesystem, or an explicit path with exactly one placeholder,{{home}}(open_terminal/main.py:157)._session_cwds, TTL fromOPEN_TERMINAL_SESSION_CWD_TTL, default 7 days, sliding window), but it is only ever written byPOST /files/cwd(main.py:487) — i.e. when a human navigates in the file browser.run_commandand the file tools only read it through_get_session_cwd, so the model cannot create a directory and "move into" it.The only workaround today is manual: a human opens the panel once, navigates into a folder, and that chat stays anchored there — for at most 7 days, and not across restarts.
Proposal
Accept a
{{session}}placeholder (the Open WebUI chat/session id) inOPEN_TERMINAL_FILE_BROWSER_ROOT, resolved in_file_browser_root()right next to{{home}}, creating the directory on first use:Each chat then gets its own workspace. Shared state remains possible by pointing at paths outside the session directory.
Ideally the same resolved path would also become the default cwd for
run_commandand the file tools — otherwise the model writes into$HOMEwhile the browser displays the session directory.Why not the existing options
~/workspace) is the same folder for every chat, and it must pre-exist for each user or the panel shows "Directory not found".Environment
ghcr.io/open-webui/open-terminal:latest(multi-user), Open WebUI 0.11.0, Docker Swarm, sandbox network with no egress.Happy to open a PR if the approach sounds right.