Skip to content

fix(agent): honor configured auxiliary.title_generation.timeout (#32729) - #56285

Closed
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/32729-aux-title-timeout
Closed

fix(agent): honor configured auxiliary.title_generation.timeout (#32729)#56285
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/32729-aux-title-timeout

Conversation

@Tranquil-Flow

Copy link
Copy Markdown
Contributor

Bug fix: auxiliary.title_generation.timeout config was being silently ignored.

Reported in #32729: user updated auxiliary.title_generation.timeout in
config.yaml to a high value (e.g. 1800) for a slow local LLM, but the title
generation 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) had
timeout: float = 30.0 hardcoded in its signature. Its only caller
(auto_title_session) never passed an explicit timeout, so the hardcoded
default was always what reached call_llm() — which then refused to read
auxiliary.title_generation.timeout from config (the config lookup only
fires when call_llm is called with timeout=None).

In other words: the user's auxiliary.title_generation.timeout setting was
correct, complete, and respected by call_llm. The contract break was a
single hardcoded signature default.

Fix (single-line, two production files)

  1. agent/title_generator.py:54timeout: float = 30.0
    timeout: Optional[float] = None. The Optional type matches call_llm's
    contract and the existing helper resolves the configured timeout when None
    is forwarded.
  2. agent/auxiliary_client.py:5726timeout: float = None
    timeout: Optional[float] = None. Pure annotation accuracy: the runtime
    default was already None; only the type was lying. Brings the signature
    in line with the runtime branching on None to consult the configured
    timeout.

Tests

tests/agent/test_title_generator_timeout_32729.py (new file, 5 tests):

  • test_default_signature_is_optional_float_none — signature default is
    None, type is Optional[float].
  • test_no_explicit_timeout_forwards_none_to_call_llm — without an explicit
    timeout, call_llm receives timeout=None (RED on upstream/main).
  • test_explicit_timeout_from_caller_is_forwarded_unchanged — explicit
    caller-supplied timeout is passed through verbatim.
  • test_auto_title_session_does_not_pass_timeout_to_generate_title
    auto_title_session does 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_llm surfaces
    timeout=None to call_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)

tests/agent/test_title_generator.py .......... 23 passed
tests/agent/test_title_generator_timeout_32729.py ..... 5 passed
tests/agent/test_auxiliary_client.py ........ 274 passed
                                              (1 pre-existing timing flake
                                              deselected: fails on
                                              upstream/main in isolation)

Rebase history

Built against upstream/main = 44ddc552f5 at 2026-07-01T10:00:00Z.
Rebased onto current upstream/main = 1c350728ec before publication.
Rebase applied cleanly with no conflicts. Final HEAD:
36476b1b698717aae7463266294afac6117800fb. Branch is exactly one focused
commit 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_generator fix but bundles an unrelated
.github/workflows/docker.yml change splitting PR validation from cached
publish builds (+22/-8 lines of CI infrastructure). This PR retains only
the surgical bug fix and adds the Optional[float] annotation accuracy
fix for call_llm's signature. Maintainer can choose to merge one, the
other, or both.

Notes

  • One pre-existing test_enforces_total_timeout_while_stream_keeps_emitting_events
    timing flake in tests/agent/test_auxiliary_client.py is deselected.
    Verified to fail in isolation on upstream/main without the fix applied —
    pre-existing, unrelated.
  • No new dependencies, no AI attribution, no config-file changes, no skill
    changes.

Auto-published by Moonsong via Path B automated pipeline.
Reviewed against CONTRIBUTING.md and AGENTS.md contribution rubric.

…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.
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/config Config system, migrations, profiles provider/ollama Ollama / local models P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 1, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #39035 — the same one-line fix (agent/title_generator.py timeout default 30.0Optional[None] so call_llm resolves auxiliary.title_generation.timeout from config) for #32729. #39035 is the earliest open PR in this cluster (canonical). Related competing open fixes: #41844, #41841. Earliest overall was closed #18129.

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/ollama Ollama / local models type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants