Skip to content

feat(models): per-endpoint LLM stream timeout override - #5966

Open
ataliba wants to merge 3 commits into
odysseus-dev:devfrom
ataliba:feat/task-stream-timeout
Open

feat(models): per-endpoint LLM stream timeout override#5966
ataliba wants to merge 3 commits into
odysseus-dev:devfrom
ataliba:feat/task-stream-timeout

Conversation

@ataliba

@ataliba ataliba commented Aug 9, 2026

Copy link
Copy Markdown

Summary

agent_stream_timeout_seconds was global-only, so a single slow custom/local endpoint forced everyone to either eat a low ceiling for every provider or raise the timeout account-wide. Adds model_endpoints.stream_timeout_seconds (nullable, falls back to the global setting), routes both stream_agent_loop call sites through a single resolve_stream_timeout() so interactive chat and scheduled tasks pick it up the same way, and exposes it in the admin "Added Models" panel as a per-endpoint "Timeout" button.

Target branch

  • This PR targets dev, not main.

Linked Issue

Part of #2615 — covers the "configurable per model" ask for chat/agent. Deep Research still uses its own separate research_run_timeout_seconds setting and wasn't touched here.

Type of Change

  • New feature (non-breaking — adds new behaviour)

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (uvicorn app:app) and verified the change works end-to-end — local smoke test (create endpoint → PATCH stream_timeout_seconds → confirmed in list) plus a live production deploy where the button is now in daily use.

How to Test

  1. Open Settings → Added Models.
  2. Click "Timeout" on any endpoint row.
  3. Enter a value between 30–3600 (or leave blank to clear / fall back to the account default) and Save.
  4. Row now shows Timeout (Ns); a chat/task routed through that endpoint uses the new value as its LLM stream read-timeout instead of the global default.

Visual / UI changes

  • Screenshot attached below — see the "Timeout (600s)" button, styled with existing .admin-btn-sm class, no new component/colors introduced.
  • Style match: reuses admin-btn-sm, existing styledPrompt modal (same one used for endpoint rename), no new CSS.
  • No new component patterns — mirrors the Enable/Disable/Delete row buttons already in this panel.
  • Not a bulk/auto-generated PR.

Screenshots / clips

Screenshot From 2026-08-09 01-10-56

ataliba added 3 commits August 8, 2026 22:22
agent_stream_timeout_seconds was global-only, so a single slow custom
endpoint forced everyone to either eat a low ceiling or raise the
timeout account-wide (odysseus-dev#2615). Add model_endpoints.stream_timeout_seconds
(nullable, falls back to the global setting), route both stream_agent_loop
call sites through a single resolve_stream_timeout() so interactive chat
and scheduled tasks pick it up the same way, and expose it on the
model-endpoints list/get/PATCH routes (clamped 30-3600s).
_migrate_add_endpoint_stream_timeout used PRAGMA table_info, which is
SQLite-only and fails silently on Postgres (caught, logged, column
never added). Unlike the pre-existing PRAGMA migrations — which only
backfill columns that predate a given Postgres install's initial
create_all() — this is a brand-new column that a running Postgres
instance never got, so skipping it would leave every model_endpoints
query broken (ORM expects a column the table doesn't have). Use
SQLAlchemy's inspector instead, which works on both dialects.
stream_timeout_seconds was only reachable via a raw PATCH call. Add a
"Timeout" button next to Enable/Disable on each model-endpoint row,
using the existing styledPrompt pattern (same as endpoint rename) to
set/clear the value (blank = fall back to the account-wide default).
@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant