mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[GH-ISSUE #37] issue: /p/{policy_id}/system and /p/{policy_id}/api/config unreachable for Open WebUI (X-User-Id required, no system-container fallback) #13
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#13
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/37
/p/{policy_id}/systemand/p/{policy_id}/api/configunreachable for Open WebUI (X-User-Id required, no system-container fallback)Summary
Open WebUI's backend fetches a terminal server's system prompt via
GET {base}/api/config(feature probe) andGET {base}/systemwithout anX-User-Idheader. On the orchestrator, both paths fall into the generic policy proxy/p/{policy_id}/{path}, whoseverify_user_iddependency declaresX-User-Idas a required header — so the requests fail with 422 before auth even runs. Result: the system-prompt integration never works through the orchestrator, silently./p/{policy_id}/openapi.jsonalready solves this exact problem for tool discovery: it's a dedicated route that serves the response via a system-user container without requiringX-User-Id./systemand/api/configneed the same treatment.Environment
ghcr.io/open-webui/terminals:latest), Docker backend, API-key authReproduction
Expected:
/api/configreturns the container's feature flags and/systemreturns{"prompt": "MARKER-12345"}, served via a system container (like/p/demo/openapi.jsonalready does).Actual: both return
422 {"detail":[{"type":"missing","loc":["header","X-User-Id"], ...}]}. With anX-User-Idheader added, they work — but Open WebUI never sends one, so in practice the prompt is never delivered to chats.Root cause
terminals/routers/proxy.py:policy_proxy(/p/{policy_id}/{path:path}) depends onverify_user_id.terminals/routers/auth.py:verify_user_iddeclaresx_user_id: str = Header(..., alias="X-User-Id")— required, so FastAPI 422s when absent./p/{policy_id}/openapi.jsonhas a dedicated no-user route (policy_openapi_spec, served via_SYSTEM_USER_ID+_get_cached_spec).Suggested fix
Add dedicated routes mirroring
policy_openapi_spec:GET /p/{policy_id}/api/config→ proxy to a system-user instance of the policy (cacheable, small TTL).GET /p/{policy_id}/system→ proxy to a system-user instance of the policy.Both should require the normal API-key/JWT auth (
verify_api_key) but notX-User-Id. This makes the orchestrator interchangeable with a direct open-terminal instance for Open WebUI's config/system-prompt fetches, which is the proxy's stated design goal ("the path structure mirrors open-terminal exactly … so the two are interchangeable").Caveat worth documenting: the prompt is then rendered by the system container, so
{{home}}-style placeholders expand with that container's values.@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:
🟢 #36 issue: Terminal system prompt is never injected for orchestrator connections (
/systemfetch omitsX-User-Id)This is the same underlying problem: Open WebUI fetches
/api/configand/systemwithoutX-User-Id, and the orchestrator's proxy requires that header, causing 422s and preventing the system prompt from being injected.by Classic298
🟣 #29 issue: system prompt env var not respected
This closed issue reports the same user-visible symptom:
OPEN_TERMINAL_SYSTEM_PROMPTnot reaching models when terminals are enabled. It appears to be the earlier manifestation of the same system-prompt delivery bug.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.