mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #148] fix: make uvicorn's keep-alive timeout configurable, default 75s #139
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#139
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/148
Author: @dvystrcil
Created: 8/1/2026
Status: 🔄 Open
Base:
main← Head:fix/uvicorn-keep-alive-timeout📝 Commits (1)
94716b8fix: make uvicorn's keep-alive timeout configurable, default 75s📊 Changes
3 files changed (+27 additions, -2 deletions)
View changed files
📝
CHANGELOG.md(+6 -0)📝
open_terminal/cli.py(+8 -2)📝
open_terminal/env.py(+13 -0)📄 Description
Problem
I run open-terminal behind Open WebUI as a tool backend. Occasionally a tool call would fail with
ConnectionResetError/Connection reset by peereven though the underlying command had actually completed successfully.Root cause: uvicorn's default
timeout_keep_aliveis 5 seconds, which can be shorter than the client's own HTTP connection-pool reuse window. If the client (Open WebUI, or any pooled HTTP client) holds a connection open longer than 5s of idle time and then reuses it, the server has already closed it server-side -- the write lands on a dead socket and the client sees a reset, even though nothing about the request itself was wrong.Fix
Adds
OPEN_TERMINAL_UVICORN_TIMEOUT_KEEP_ALIVE(oruvicorn_timeout_keep_aliveinconfig.toml), following the exact same pattern as the existingOPEN_TERMINAL_UVICORN_LOOPoption. Defaults to 75s, matching gunicorn/nginx's common default and comfortably exceeding most client-side pool idle timeouts.Testing
No test harness exists in this repo currently, so verified manually: built a venv from this branch (
pip install -e .), started the server (open-terminal run), confirmed it boots cleanly and serves/healthcorrectly with the new parameter wired throughuvicorn.run(). Confirmedtimeout_keep_aliveis a real, documented uvicorn.run() parameter viainspect.signature.Happy to adjust the default or naming convention if you'd prefer something different.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.