mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[GH-ISSUE #36] issue: Terminal system prompt is never injected for orchestrator connections (/system fetch omits X-User-Id) #15
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/terminals#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Classic298 on GitHub (Jul 10, 2026).
Original GitHub issue: https://github.com/open-webui/terminals/issues/36
Terminal system prompt is never injected for orchestrator connections (
/systemfetch omitsX-User-Id)Summary
For Open Terminal connections of type orchestrator, the terminal system prompt is silently never injected into chats. The backend fetches the prompt at connection-save time via
GET {base}/api/configandGET {base}/system, but sends noX-User-Idheader (and no auth at all on the/api/configprobe). The Terminals orchestrator's/p/{policy_id}/*proxy routes requireX-User-Id(FastAPI required header), so the fetch fails with 422,get_terminal_system_prompt()swallows the error and returnsNone, andserver['system_prompt']is never set. Models receive no terminal system prompt — neither the container default nor a customOPEN_TERMINAL_SYSTEM_PROMPT.Direct (non-orchestrator) connections are unaffected.
Environment
mainghcr.io/open-webui/terminals:latest), Docker backendghcr.io/open-webui/open-terminal:latestReproduction
TERMINALS_API_KEY).http://<orchestrator>:3000, Policy IDdemo, Bearer key, Save.Expected: the system prompt contains
MARKER-12345(the prompt served by the policy container's/systemendpoint).Actual: no terminal system prompt is injected at all. The model only sees the tool descriptions.
Direct proof of the failing request (this is exactly what the backend sends):
Root cause
backend/open_webui/utils/tools.py:get_terminal_system_prompt()(~line 1056): the/api/configfeature probe is sent with no headers, and the/systemfetch only gets the bearer header passed in._fetch_system_prompt()insideset_terminal_servers()(~line 1135): buildsheadersfrom the bearer key only — never addsX-User-Id.The orchestrator's
/p/{policy_id}/{path}routes declareX-User-Idas a required header (terminals/routers/auth.py,verify_user_id), so both requests 422. All exceptions/non-200s are swallowed (return None), making the failure invisible.Suggested fix
Either (or both):
X-User-Idheader (e.g. a reserved system identifier) on the/api/configand/systemfetches for orchestrator connections, and pass auth headers to the/api/configprobe.GET /p/{policy_id}/systemandGET /p/{policy_id}/api/configfrom theX-User-Idrequirement (same pattern as the existing/p/{policy_id}/openapi.jsonspecial case, which serves via a system container). Companion issue filed there.Also worth logging the fetch failure at
warninginstead ofdebug— this failed silently for every orchestrator user.@owui-terminator[bot] commented on GitHub (Jul 10, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
This closed issue reports the same user-visible symptom: configuring
OPEN_TERMINAL_SYSTEM_PROMPTbut the system prompt not reaching models when terminal tools are enabled. It is likely the same underlying prompt-injection path failing, even though it doesn’t mention the orchestrator-specific header omission.by Classic298
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@Classic298 commented on GitHub (Jul 20, 2026):
fixed with open webui 0.10.3 or newer