From 5f30c0dc5311f13f0a9a9397bcba2f6e158d93e0 Mon Sep 17 00:00:00 2001 From: Jay4242 <96741732+Jay4242@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:00:02 -0700 Subject: [PATCH 1/2] fix: make title generation timeout configurable via auxiliary.title_generation.timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit generate_title() passed a hardcoded timeout=30.0 to call_llm(), which short-circuited the config-backed _get_task_timeout('title_generation') resolution. This made auxiliary.title_generation.timeout in config.yaml a dead key — the value was never consulted. Changed the default from 30.0 to None so call_llm() resolves timeout from config (falling back to _DEFAULT_AUX_TIMEOUT, 30s) when not explicitly overridden. Matches the pattern used by every other auxiliary task (compression, web_extract, session_search, approval). --- agent/title_generator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/title_generator.py b/agent/title_generator.py index 3f617093c0b6..0d4113d5dfc6 100644 --- a/agent/title_generator.py +++ b/agent/title_generator.py @@ -28,7 +28,7 @@ def generate_title( user_message: str, assistant_response: str, - timeout: float = 30.0, + timeout: Optional[float] = None, failure_callback: Optional[FailureCallback] = None, main_runtime: dict = None, ) -> Optional[str]: @@ -42,6 +42,10 @@ def generate_title( auxiliary call raises — the caller typically wires this to ``AIAgent._emit_auxiliary_failure`` so the user sees a warning instead of silently accumulating untitled sessions. + + ``timeout`` defaults to ``None``, which makes ``call_llm()`` resolve it + from ``auxiliary.title_generation.timeout`` in config.yaml (falling + back to 30 s). Pass a float to override programmatically. """ # Truncate long messages to keep the request small user_snippet = user_message[:500] if user_message else "" From c0aa1916b2a79220669d493a17ff36b7281b094d Mon Sep 17 00:00:00 2001 From: Jay4242 <96741732+Jay4242@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:57:14 -0700 Subject: [PATCH 2/2] fix(agent): make title generation timeout configurable via auxiliary.title_generation.timeout --- tests/agent/test_title_generator.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/agent/test_title_generator.py b/tests/agent/test_title_generator.py index e10cba76a89a..1dfb28cfc704 100644 --- a/tests/agent/test_title_generator.py +++ b/tests/agent/test_title_generator.py @@ -113,6 +113,22 @@ def mock_call_llm(**kwargs): user_content = captured_kwargs["messages"][1]["content"] assert len(user_content) < 1100 # 500 + 500 + formatting + def test_passes_timeout_none_when_not_specified(self): + """When no timeout is given, None is passed so config resolution works.""" + captured_kwargs = {} + + def mock_call_llm(**kwargs): + captured_kwargs.update(kwargs) + resp = MagicMock() + resp.choices = [MagicMock()] + resp.choices[0].message.content = "Title" + return resp + + with patch("agent.title_generator.call_llm", side_effect=mock_call_llm): + generate_title("q", "a") + + assert captured_kwargs["timeout"] is None + class TestAutoTitleSession: """Tests for auto_title_session() — the sync worker function."""