Skip to content

Give the dashboard's task-service client a 30s read timeout - #439

Merged
tildesrc merged 1 commit into
mainfrom
panopticon/dashboard-client-timeout
Oct 28, 2026
Merged

tildesrc merged 1 commit into
mainfrom
panopticon/dashboard-client-timeout

Conversation

@tildesrc

Copy link
Copy Markdown
Contributor

The dashboard's TaskServiceClient was built with a bare httpx.Client, so it used httpx's default 5 s timeout. The full GET /tasks read (~790 KB for ~860 tasks, plus a filesystem check per task for unhidden artifacts) regularly takes longer than that on a loaded host. The task service's SQLite busy timeout is also 5 s, so the client gave up at exactly the moment the server was still waiting on a lock.

  • terminal/__main__.py adds SERVICE_TIMEOUT = httpx.Timeout(30.0, connect=5.0) and a _service_client() helper. Every client built in that file uses it: dashboard, tasks, console/start, and the quickstart client passed to the console. Reads now get 30 s; connect stays at 5 s, so a service that's down still fails fast.
  • list_tasks_versioned is unchanged. Its per-request Timeout(wait + 10.0) still overrides the client default for the long-poll.
  • Tests in tests/terminal/test_cli.py pin the timeout values, check that the dashboard's client is built with them, and check (via httpx.MockTransport) that the long-poll still sends wait + 10 while a plain read sends the client default.

Other httpx.Client call sites (the container entrypoint, hook and agent; the session service; console.py's join resolver; sessions.py) still use the default. They don't do the dashboard's full list read.

🤖 Generated with Claude Code

The full GET /tasks read regularly outlasts httpx's 5s default on a loaded
host, and the service's SQLite busy timeout is also 5s, so the client gave
up just as the server was waiting on a lock. The CLI's client now reads for
30s and connects within 5s; list_tasks_versioned's per-request wait + 10
long-poll timeout still overrides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tildesrc
tildesrc marked this pull request as ready for review October 28, 2026 19:35
@tildesrc
tildesrc merged commit 52136a2 into main Oct 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant