hermes-agent/tests/run_agent
Teknium ea81aa2eec
fix: guard api_kwargs in except handler to prevent UnboundLocalError (#7376)
When _build_api_kwargs() throws an exception, the except handler in
the retry loop referenced api_kwargs before it was assigned. This
caused an UnboundLocalError that masked the real error, making
debugging impossible for the user.

Two _dump_api_request_debug() calls in the except block (non-retryable
client error path and max-retries-exhausted path) both accessed
api_kwargs without checking if it was assigned.

Fix: initialize api_kwargs = None before the retry loop and guard both
dump calls. Now the real error surfaces instead of the masking
UnboundLocalError.

Reported by Discord user gruman0.
2026-04-10 15:12:00 -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
…
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
…
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 fix: guard api_kwargs in except handler to prevent UnboundLocalError (#7376) 2026-04-10 15:12:00 -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_switch_model_context.py
…
test_token_persistence_non_cli.py
…
test_tool_arg_coercion.py
…
test_unicode_ascii_codec.py
…