Skip to content

fix(auxiliary): floor compression timeout so reasoning models don't fall back to marker (#54915) - #54943

Closed
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/54915-compression-timeout-floor
Closed

fix(auxiliary): floor compression timeout so reasoning models don't fall back to marker (#54915)#54943
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/54915-compression-timeout-floor

Conversation

@Tranquil-Flow

Copy link
Copy Markdown
Contributor

Problem

When Hermes uses a reasoning model (e.g. Codex / GPT-5.5) as the auxiliary
compression provider (auxiliary.compression.provider: auto), context
compression can time out at the default 120 s and silently fall back to the
deterministic context marker — losing the LLM summary:

Compression summary failed: Codex auxiliary Responses stream exceeded 120.0s total timeout.
Inserted a fallback context marker.

The root cause is that call_llm(task="compression", ...) resolves its
timeout from auxiliary.compression.timeout (default 120 s) with no floor.
A reasoning model summarising a large context can legitimately exceed 120 s.

Fix

Adds a bounded 300 s floor to config-derived compression timeouts only:

  • New constant _COMPRESSION_TIMEOUT_FLOOR_SECONDS = 300.0 (finite, bounded).
  • New helper _effective_aux_timeout(task, timeout) — single source of truth
    used by both call_llm (sync) and async_call_llm (async). It resolves the
    timeout as before, then applies max(effective, floor) only when
    timeout is None and task == "compression".

This honours all constraints from the issue:

  • Only compression is floored — other auxiliary tasks keep their own timeouts.
  • An explicit per-call timeout= override is not floored.
  • The floor is a minimum (max), so a higher config value is kept unchanged.
  • The timeout stays bounded (never infinite).
  • Both sync and async paths are covered.

Verification

  • RED: 2 tests fail on upstream/main f1345290e — the 120 s config timeout
    reaches the client unfloored (assert 120.0 >= 300.0).
  • GREEN: all 7 new tests pass with the fix.
  • Regression: 223 passed across the auxiliary + compressor test suites.

Tests exercise the real call_llm / async_call_llm production paths (mocked
LLM client) and assert the timeout that reaches client.chat.completions.create.

Closes #54915.


Auto-published by Moonsong via Path B automated pipeline.

@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 P2 Medium — degraded but workaround exists labels Jun 29, 2026
@teknium1

teknium1 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #59807 — your commit was cherry-picked onto current main with authorship preserved (370a489). Verified the floor propagates into the Codex Responses stream total_timeout (the exact failing path from the issue). Thanks!

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

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex GPT-5.5 compression can time out at 120s and fall back to marker

3 participants