feat(agents): enforce one librarian timeout budget

- add LIBRARIAN_TIMEOUT config (default 180s) and enforce it with
  asyncio.wait_for inside delegate_to_librarian, covering the live
  paths (steward direct delegation and SSE streaming) that had no cap
- timeouts fail honestly: success=False with a curated butler sentence,
  detail in logs
- set an explicit timeout on TatlockOllamaProvider's AsyncOpenAI client
  from OLLAMA_TIMEOUT instead of the SDK default (~600s per LLM call)
- remove the contradictory unused 60s default from
  AgentRequest.timeout_seconds; coordination falls back to the
  configured budget

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 10:19:16 +02:00
co-authored by Claude Fable 5
parent 99e1fe33ca
commit 18f2e0efbd
9 changed files with 145 additions and 18 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ class TestAgentRequest:
assert request.task == "Find information about Docker"
assert request.context == ""
assert request.timeout_seconds == 60
# No hardcoded default - None defers to the configured budget
assert request.timeout_seconds is None
def test_request_with_context(self):
"""Test request with additional context."""