fix(agent): honor configured auxiliary.title_generation.timeout (#32729) - #56285
fix(agent): honor configured auxiliary.title_generation.timeout (#32729)#56285Tranquil-Flow wants to merge 1 commit into
Conversation
…Research#32729) generate_title() hardcoded timeout=30.0 in its signature; auto_title_session() never passed an explicit timeout, so the configured auxiliary.title_generation.timeout was silently ignored and users saw 'Auxiliary title generation failed: Request timed out' regardless of their config. call_llm() already supports timeout=None and resolves the configured value when None is forwarded, so the fix is on the title_generator side: 1. agent/title_generator.py:54 — change generate_title signature default timeout: float = 30.0 -> timeout: Optional[float] = None 2. agent/auxiliary_client.py:5711 — change call_llm signature annotation timeout: float = None -> timeout: Optional[float] = None (annotation accuracy: the parameter defaulted to None and the body branches on None to read from config) Layers addressed (LAYERS.md): L1 generate_title signature default -> fixed (file 1) L2 auto_title_session does not inject -> already correct, regression test added L3 call_llm task-name threading -> preserved L4 config default value (30s) -> preserved L5 type-safety for Optional[float] -> fixed (file 2) Tests: tests/agent/test_title_generator_timeout_32729.py 5 new production-path tests; 3 RED on upstream/main, 5 GREEN with this fix. Full existing test_title_generator.py suite (23 tests) still passes. Full test_auxiliary_client.py suite (273 tests) still passes; one unrelated pre-existing timing flake (TestCodexAuxiliaryAdapterTimeout::test_enforces_ total_timeout_while_stream_keeps_emitting_events) deselected — verified passes in isolation on upstream/main.
Duplicate of #39035 — the same one-line fix ( |
|
Thanks — closing as superseded by #56322 (salvage of #41844), which lands the same core one-liner (generate_title timeout default 30.0 -> Optional[None] so call_llm resolves auxiliary.title_generation.timeout). We picked #41844 as the minimal creep-free base; your annotation tidy on call_llm (float=None -> Optional[float]=None) is a legitimate correctness improvement but not required for the fix, and #41844 is the smaller surface. Your dedicated test file was the most thorough in the cluster — credit for that. Feel free to push back or resubmit the annotation tidy standalone. |
Bug fix:
auxiliary.title_generation.timeoutconfig was being silently ignored.Reported in #32729: user updated
auxiliary.title_generation.timeoutinconfig.yamlto a high value (e.g. 1800) for a slow local LLM, but the titlegeneration worker continued to time out at 30 s and surface
Auxiliary title generation failed: Request timed out.after every session.Root cause
agent/title_generator.py::generate_title()(the worker entrypoint) hadtimeout: float = 30.0hardcoded in its signature. Its only caller(
auto_title_session) never passed an explicit timeout, so the hardcodeddefault was always what reached
call_llm()— which then refused to readauxiliary.title_generation.timeoutfrom config (the config lookup onlyfires when
call_llmis called withtimeout=None).In other words: the user's
auxiliary.title_generation.timeoutsetting wascorrect, complete, and respected by
call_llm. The contract break was asingle hardcoded signature default.
Fix (single-line, two production files)
agent/title_generator.py:54—timeout: float = 30.0→timeout: Optional[float] = None. The Optional type matchescall_llm'scontract and the existing helper resolves the configured timeout when None
is forwarded.
agent/auxiliary_client.py:5726—timeout: float = None→timeout: Optional[float] = None. Pure annotation accuracy: the runtimedefault was already
None; only the type was lying. Brings the signaturein line with the runtime branching on
Noneto consult the configuredtimeout.
Tests
tests/agent/test_title_generator_timeout_32729.py(new file, 5 tests):test_default_signature_is_optional_float_none— signature default isNone, type isOptional[float].test_no_explicit_timeout_forwards_none_to_call_llm— without an explicittimeout,
call_llmreceivestimeout=None(RED on upstream/main).test_explicit_timeout_from_caller_is_forwarded_unchanged— explicitcaller-supplied timeout is passed through verbatim.
test_auto_title_session_does_not_pass_timeout_to_generate_title—auto_title_sessiondoes not inject a timeout at the worker boundary(preserves the contract).
test_auto_title_session_full_call_chain_preserves_none_timeout—end-to-end chain
auto_title_session → generate_title → call_llmsurfacestimeout=Nonetocall_llm(RED on upstream/main).3 of 5 fail on
upstream/main; all 5 pass with the fix.Verification (post-rebase onto current
upstream/main)Rebase history
Built against
upstream/main=44ddc552f5at2026-07-01T10:00:00Z.Rebased onto current
upstream/main=1c350728ecbefore publication.Rebase applied cleanly with no conflicts. Final HEAD:
36476b1b698717aae7463266294afac6117800fb. Branch is exactly one focusedcommit ahead of
upstream/main.Cross-reference
PR #39035 by @rodboev (opened 2026-06-04, 28 days ago, still open) takes
the same approach for the
title_generatorfix but bundles an unrelated.github/workflows/docker.ymlchange splitting PR validation from cachedpublish builds (+22/-8 lines of CI infrastructure). This PR retains only
the surgical bug fix and adds the
Optional[float]annotation accuracyfix for
call_llm's signature. Maintainer can choose to merge one, theother, or both.
Notes
test_enforces_total_timeout_while_stream_keeps_emitting_eventstiming flake in
tests/agent/test_auxiliary_client.pyis deselected.Verified to fail in isolation on
upstream/mainwithout the fix applied —pre-existing, unrelated.
changes.
Auto-published by Moonsong via Path B automated pipeline.
Reviewed against CONTRIBUTING.md and AGENTS.md contribution rubric.