hermes-agent/tests/run_agent
Teknium 54db7cbbe1
fix(agent): tiered context pressure warnings + gateway dedup (#6411)
Combines the approaches from PR #6309 (duan78) and PR #5963 (KUSH42):

Tiered warnings (from #5963):
- Replaces boolean _context_pressure_warned with float _context_pressure_warned_at
- Fires at 85% (orange) and re-fires at 95% (red/critical)
- Adds 'compacting context...' status message before compression

Gateway dedup (from #6309):
- Class-level dict _context_pressure_last_warned survives across AIAgent
  instances (gateway creates a new instance per message)
- 5-minute cooldown per session prevents warning spam
- Higher-tier warnings bypass the cooldown (85% → 95% always fires)
- Compression reset clears the dedup entry for the session
- Stale entries evicted (older than 2x cooldown) to prevent memory leak

Does NOT inject into messages — purely user-facing via _safe_print (CLI)
and status_callback (gateway). Zero prompt cache impact.

Fixes #6309. Fixes #5963.
2026-04-08 21:31:44 -07:00
..
__init__.py
…
test_413_compression.py
…
test_860_dedup.py
…
test_1630_context_overflow_loop.py
…
test_agent_guardrails.py
…
test_agent_loop.py
…
test_agent_loop_tool_calling.py
…
test_agent_loop_vllm.py
…
test_anthropic_error_handling.py
…
test_async_httpx_del_neuter.py
…
test_compression_boundary.py
…
test_compression_persistence.py
…
test_compressor_fallback_update.py
…
test_context_pressure.py fix(agent): tiered context pressure warnings + gateway dedup (#6411) 2026-04-08 21:31:44 -07:00
test_context_token_tracking.py
…
test_dict_tool_call_args.py
…
test_exit_cleanup_interrupt.py
…
test_fallback_model.py
…
test_flush_memories_codex.py fix(agent): respect config timeout for flush_memories instead of hardcoded 30s 2026-04-08 18:55:33 -07:00
test_interactive_interrupt.py
…
test_interrupt_propagation.py
…
test_long_context_tier_429.py
…
test_openai_client_lifecycle.py
…
test_percentage_clamp.py
…
test_primary_runtime_restore.py
…
test_provider_fallback.py
…
test_provider_parity.py
…
test_real_interrupt_subagent.py
…
test_redirect_stdout_issue.py
…
test_run_agent.py feat(qwen): add Qwen OAuth provider with portal request support 2026-04-08 13:46:30 -07:00
test_run_agent_codex_responses.py
…
test_session_meta_filtering.py
…
test_session_reset_fix.py
…
test_streaming.py
…
test_strict_api_validation.py
…
test_token_persistence_non_cli.py
…
test_tool_arg_coercion.py
…