mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-17 23:52:29 +00:00
* fix: fetch terminal system prompt per request with TTL cache The system prompt was only fetched once in set_terminal_servers (startup or connection save) with a 3s timeout, using a synthetic 'system' user. That snapshot silently stays empty when the fetch races a cold-started orchestrator instance, and goes stale when instances are reprovisioned with a changed OPEN_TERMINAL_SYSTEM_PROMPT — recovering only after a restart or a manual connection re-save. - Fetch /system during get_terminal_tools with the user's own credentials via a central TTL-cached method (5 min per server+user; failures cached 60s so a dead instance doesn't stall every request), falling back to the cached snapshot. - Raise the fetch timeout from 3s to 30s so cold-provisioned instances can answer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KjnQJNKozp47vTB13pRyYs * refac: fetch the terminal system prompt per request without a cache Drop the module-level TTL cache and fetch the system prompt directly in get_terminal_tools, gathered with the existing uncached per-request cwd fetch that already follows this pattern. The fetch uses the user's own credentials and falls back to the set_terminal_servers snapshot, so a cold or unreachable instance degrades to the previous behaviour instead of needing an error cache. Also restore the 3s timeout: on the request path a 30s wait would stall chat completions, and a cold instance is covered by the snapshot fallback until it warms up. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| access_control | ||
| images | ||
| mcp | ||
| telemetry | ||
| actions.py | ||
| anthropic.py | ||
| asgi_middleware.py | ||
| audit.py | ||
| auth.py | ||
| automations.py | ||
| calendar.py | ||
| channels.py | ||
| chat.py | ||
| chat_fork.py | ||
| chat_id.py | ||
| chat_variables.py | ||
| code_interpreter.py | ||
| context_compaction.py | ||
| embeddings.py | ||
| files.py | ||
| filter.py | ||
| groups.py | ||
| headers.py | ||
| logger.py | ||
| memory.py | ||
| middleware.py | ||
| misc.py | ||
| model_ids.py | ||
| models.py | ||
| notifications.py | ||
| oauth.py | ||
| payload.py | ||
| pdf_generator.py | ||
| plugin.py | ||
| rate_limit.py | ||
| redis.py | ||
| response.py | ||
| sanitize.py | ||
| security_headers.py | ||
| session_pool.py | ||
| subagents.py | ||
| task.py | ||
| terminals.py | ||
| timers.py | ||
| tools.py | ||
| validate.py | ||
| valves.py | ||
| webhook.py | ||