hermes-agent/agent
Teknium bd7e480236
fix(compression): give fallback candidates their own timeout budget + escalate repeat-timeout cooldowns (#65143)
Fixes #62452. Two amplifiers turned one slow auxiliary route into a
per-turn multi-minute stall:

1. Fallback candidates inherited the exact effective_timeout the primary
   was called with. When the primary's deadline was short (tuned or
   already burned), an independently healthy fallback died on the same
   clock — the reporter's 163k-token compression needed ~90s on the
   fallback and got the primary's 30s, every turn. fallback_chain
   entries may now declare their own 'timeout' (seconds); both fallback
   candidate call sites (sync + async) resolve it via
   _fallback_entry_timeout, label-scoped so only configured-chain
   candidates are affected. No entry timeout → task-level timeout,
   preserving existing behavior.

2. A session whose transcript structurally cannot be summarized within
   the deadline re-attempted every 60s, re-burning the full timeout on
   every subsequent turn. Consecutive timeout-class failures now
   escalate the cooldown 60s → 300s → 900s (capped); any successful
   summary or session reset clears the streak. Timeout classification
   takes precedence over the streaming-closed 30s rung ('timed out'
   also matches _is_connection_error) and now recognizes the SDK's
   'Request timed out.' phrasing.

Fail-safe behavior is unchanged: all messages are preserved when every
candidate fails; the cooldown only spaces out retries.
2026-07-15 12:28:09 -07:00
..
lsp
…
pet
…
secret_sources
…
transports
…
__init__.py
…
account_usage.py
…
agent_init.py
…
agent_runtime_helpers.py
…
anthropic_adapter.py
…
async_utils.py
…
auxiliary_client.py
…
azure_identity_adapter.py
…
background_review.py
…
bedrock_adapter.py
…
billing_view.py
…
bounded_response.py
…
browser_provider.py
…
browser_registry.py
…
chat_completion_helpers.py
…
codex_responses_adapter.py
…
codex_runtime.py
…
coding_context.py
…
context_breakdown.py
…
context_compressor.py
…
context_engine.py
…
context_references.py
…
conversation_compression.py
…
conversation_loop.py
…
copilot_acp_client.py
…
credential_persistence.py
…
credential_pool.py
…
credential_sources.py
…
credits_tracker.py
…
curator.py
…
curator_backup.py
…
display.py
…
error_classifier.py
…
errors.py
…
file_safety.py
…
gemini_native_adapter.py
…
gemini_schema.py
…
i18n.py
…
image_gen_provider.py
…
image_gen_registry.py
…
image_routing.py
…
insights.py
…
iteration_budget.py
…
jiter_preload.py
…
kanban_stop.py
…
learn_prompt.py
…
learning_graph.py
…
learning_graph_render.py
…
learning_mutations.py
…
lmstudio_reasoning.py
…
manual_compression_feedback.py
…
markdown_tables.py
…
memory_manager.py
…
memory_provider.py
…
message_content.py
…
message_sanitization.py
…
moa_loop.py
…
moa_trace.py
…
model_metadata.py
…
models_dev.py
…
moonshot_schema.py
…
nous_rate_guard.py
…
onboarding.py
…
oneshot.py
…
plugin_llm.py
…
portal_tags.py
…
process_bootstrap.py
…
prompt_builder.py
…
prompt_caching.py
…
rate_limit_tracker.py
…
reactions.py
…
reasoning_timeouts.py
…
redact.py
…
replay_cleanup.py
…
retry_utils.py
…
runtime_cwd.py
…
secret_scope.py
…
shell_hooks.py
…
skill_bundles.py
…
skill_commands.py
…
skill_preprocessing.py
…
skill_utils.py
…
ssl_guard.py
…
ssl_verify.py
…
stream_diag.py
…
subdirectory_hints.py
…
system_prompt.py
…
think_scrubber.py
…
thinking_timeout_guidance.py
…
thread_scoped_output.py
…
title_generator.py
…
tool_dispatch_helpers.py
…
tool_executor.py
…
tool_guardrails.py
…
tool_result_classification.py
…
trace_upload.py
…
trajectory.py
…
transcription_provider.py
…
transcription_registry.py
…
tts_provider.py
…
tts_registry.py
…
turn_context.py
…
turn_finalizer.py
…
turn_retry_state.py
…
usage_pricing.py
…
verification_evidence.py
…
verification_stop.py
…
verify_hooks.py
…
vertex_adapter.py
…
video_gen_provider.py
…
video_gen_registry.py
…
web_search_provider.py
…
web_search_registry.py
…