hermes-bsd/tests
Teknium 0375b2a0d7
fix(gateway): silence background agent terminal output (#3297)
* fix(gateway): silence flush agent terminal output

quiet_mode=True only suppresses AIAgent init messages.
Tool call output still leaks to the terminal through
_safe_print → _print_fn during session reset/expiry.

Since #2670 injected live memory state into the flush prompt,
the flush agent now reliably calls memory tools — making the
output leak noticeable for the first time.

Set _print_fn to a no-op so the background flush is fully silent.

* test(gateway): add test for flush agent terminal silence + fix dotenv mock

- Add TestFlushAgentSilenced: verifies _print_fn is set to a no-op on
  the flush agent so tool output never leaks to the terminal
- Fix pre-existing test failures: replace patch('run_agent.AIAgent')
  with sys.modules mock to avoid importing run_agent (requires openai)
- Add autouse _mock_dotenv fixture so all tests in this file run
  without the dotenv package installed

* fix(display): route KawaiiSpinner output through print_fn to fully silence flush agent

The previous fix set tmp_agent._print_fn = no-op on the flush agent but
spinner output and quiet-mode cute messages bypassed _print_fn entirely:
- KawaiiSpinner captured sys.stdout at __init__ and wrote directly to it
- quiet-mode tool results used builtin print() instead of _safe_print()

Add optional print_fn parameter to KawaiiSpinner.__init__; _write routes
through it when set. Pass self._print_fn to all spinner construction sites
in run_agent.py and change the quiet-mode cute message print to _safe_print.
The existing gateway fix (tmp_agent._print_fn = lambda) now propagates
correctly through both paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(gateway): silence hygiene and compression background agents

Two more background AIAgent instances in the gateway were created with
quiet_mode=True but without _print_fn = no-op, causing tool output to
leak to the terminal:
- _hyg_agent (in-turn hygiene memory agent)
- tmp_agent (_compress_context path)

Apply the same _print_fn no-op pattern used for the flush agent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(display): remove unused _last_flush_time from KawaiiSpinner

Attribute was set but never read; upstream already removed it.
Leftover from conflict resolution during rebase onto upstream/main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Dilee <uzmpsk.dilekakbas@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 17:40:31 -07:00
..
acp fix(acp): preserve session provider when switching models 2026-03-21 15:54:10 -07:00
agent fix: align Nous Portal model slugs with OpenRouter naming (#3253) 2026-03-26 13:49:43 -07:00
cron fix(cron): mark session as ended after job completes (#2998) 2026-03-25 11:13:21 -07:00
fakes
gateway fix(gateway): silence background agent terminal output (#3297) 2026-03-26 17:40:31 -07:00
hermes_cli fix: OpenClaw migration overwrites defaults and setup wizard skips imported sections (#3282) 2026-03-26 16:29:38 -07:00
honcho_integration
integration refactor: remove mini-swe-agent dependency — inline Docker/Modal backends (#2804) 2026-03-24 07:30:25 -07:00
skills feat(migration): comprehensive OpenClaw migration v2 — 17 new modules, terminal recap (#2906) 2026-03-24 19:44:02 -07:00
tools fix(security): restrict subagent toolsets to parent's enabled set (#3269) 2026-03-26 14:50:26 -07:00
__init__.py
conftest.py
run_interrupt_test.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_adapter.py fix(prompt-caching): skip top-level cache_control on role:tool for OpenRouter 2026-03-21 16:54:43 -07:00
test_anthropic_error_handling.py fix(agent): always prefer streaming for API calls to prevent hung subagents (#3120) 2026-03-26 01:22:31 -07:00
test_anthropic_oauth_flow.py
test_anthropic_provider_persistence.py
test_api_key_providers.py
test_atomic_json_write.py
test_atomic_yaml_write.py
test_auth_codex_provider.py
test_auth_nous_provider.py
test_auxiliary_config_bridge.py
test_batch_runner_checkpoint.py
test_cli_approval_ui.py
test_cli_background_tui_refresh.py fix(cli): refresh TUI before background task output to prevent status bar overlap (#3048) 2026-03-25 15:00:33 -07:00
test_cli_extension_hooks.py refactor(cli): add protected TUI extension hooks for wrapper CLIs 2026-03-21 09:42:07 -07:00
test_cli_init.py
test_cli_interrupt_subagent.py
test_cli_loading_indicator.py
test_cli_mcp_config_watch.py
test_cli_new_session.py
test_cli_plan_command.py
test_cli_prefix_matching.py
test_cli_preloaded_skills.py fix: move activated skills line below welcome text 2026-03-23 06:20:19 -07:00
test_cli_provider_resolution.py
test_cli_retry.py
test_cli_secret_capture.py
test_cli_skin_integration.py
test_cli_status_bar.py fix(tui): status bar duplicates and degrades during long sessions (#3291) 2026-03-26 17:33:11 -07:00
test_cli_tools_command.py
test_codex_execution_paths.py
test_codex_models.py
test_compression_boundary.py
test_config_env_expansion.py feat(config): support ${ENV_VAR} substitution in config.yaml (#2684) 2026-03-23 16:02:06 -07:00
test_context_pressure.py fix: reorder setup wizard providers — OpenRouter first 2026-03-24 12:50:24 -07:00
test_context_references.py fix(context): restrict @ references to safe workspace paths (#2601) 2026-03-23 06:40:05 -07:00
test_context_token_tracking.py fix(tests): resolve all consistently failing tests 2026-03-22 05:58:26 -07:00
test_crossloop_client_cache.py fix(agent): prevent AsyncOpenAI/httpx cross-loop deadlock in gateway mode (#2701) 2026-03-25 17:31:56 -07:00
test_dict_tool_call_args.py
test_display.py
test_evidence_store.py
test_exit_cleanup_interrupt.py fix: catch KeyboardInterrupt in exit cleanup handlers (#3257) 2026-03-26 14:34:31 -07:00
test_external_credential_detection.py
test_fallback_model.py
test_file_permissions.py
test_flush_memories_codex.py
test_hermes_state.py feat(sessions): add --source flag for third-party session isolation (#3255) 2026-03-26 14:35:31 -07:00
test_honcho_client_config.py
test_insights.py
test_interactive_interrupt.py
test_interrupt_propagation.py
test_managed_server_tool_support.py
test_minisweagent_path.py chore: remove all remaining mini-swe-agent references 2026-03-24 08:19:23 -07:00
test_model_metadata_local_ctx.py
test_model_provider_persistence.py
test_model_tools.py
test_model_tools_async_bridge.py
test_openai_client_lifecycle.py
test_personality_none.py
test_plugins.py fix(tests): resolve all consistently failing tests 2026-03-22 05:58:26 -07:00
test_plugins_cmd.py feat(cli): add hermes plugins install/remove/list command 2026-03-21 09:47:33 -07:00
test_provider_parity.py fix: align Nous Portal model slugs with OpenRouter naming (#3253) 2026-03-26 13:49:43 -07:00
test_quick_commands.py
test_real_interrupt_subagent.py
test_reasoning_command.py fix(cli): buffer reasoning preview chunks and fix duplicate display (#3013) 2026-03-25 12:16:39 -07:00
test_redirect_stdout_issue.py
test_resume_display.py
test_run_agent.py fix: graceful return on max retries instead of crashing thread 2026-03-25 19:00:39 -07:00
test_run_agent_codex_responses.py
test_runtime_provider_resolution.py fix(auth): preserve 'custom' provider instead of silently remapping to 'openrouter' 2026-03-24 06:41:11 -07:00
test_session_reset_fix.py fix(session): clear compressor summary and turn counter on /clear and /new (#3102) 2026-03-25 18:22:21 -07:00
test_setup_model_selection.py
test_sql_injection.py
test_streaming.py fix(agent): restore safe non-streaming fallback after stream failures (#3020) 2026-03-25 12:46:04 -07:00
test_timezone.py
test_tool_call_parsers.py fix(mistral-parser): handle nested JSON in fallback extraction 2026-03-21 09:41:17 -07:00
test_toolset_distributions.py
test_toolsets.py
test_trajectory_compressor.py
test_worktree.py
test_worktree_security.py