hermes-agent/tests
Teknium 15cfd20820
fix: cap context pressure percentage at 100% in display (#3480)
* fix: cap context pressure percentage at 100% in display

The forward-looking token estimate can overshoot the compaction threshold
(e.g. a large tool result pushes it from 70% to 109% in one step). The
progress bar was already capped via min(), but pct_int was not — causing
the user to see '109% to compaction' which is confusing.

Cap pct_int at 100 in both CLI and gateway display functions.

Reported by @JoshExile82.

* refactor: use real API token counts for compression decisions

Replace the rough chars/3 estimation with actual prompt_tokens +
completion_tokens from the API response. The estimation was needed to
predict whether tool results would push context past the threshold, but
the default 50% threshold leaves ample headroom — if tool results push
past it, the next API call reports real usage and triggers compression
then.

This removes all estimation from the compression and context pressure
paths, making both 100% data-driven from provider-reported token counts.

Also removes the dead _msg_count_before_tools variable.
2026-03-27 21:42:09 -07:00
..
acp
…
agent perf(ttft): cache skills prompt with shared skill_utils module (salvage #3366) (#3421) 2026-03-27 10:54:02 -07:00
cron fix(cron): prevent recurring job re-fire on gateway crash/restart loop (#3396) 2026-03-27 08:02:58 -07:00
fakes
…
gateway fix(api-server): cancel orphaned agent + true interrupt on SSE disconnect (salvage #3399) (#3427) 2026-03-27 11:33:19 -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: guard aux LLM calls against None content + reasoning fallback + retry (salvage #3389) (#3449) 2026-03-27 15:28:19 -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(anthropic): use model-native output limits instead of hardcoded 16K (#3426) 2026-03-27 13:02:52 -07:00
test_anthropic_error_handling.py fix(ci): pin acp <0.9 and update retry-exhaust test (#3320) 2026-03-26 19:21:34 -07:00
test_anthropic_oauth_flow.py
…
test_anthropic_provider_persistence.py
…
test_api_key_providers.py feat: curate HF model picker with OpenRouter analogues (#3440) 2026-03-27 13:54:46 -07:00
test_async_httpx_del_neuter.py fix: eliminate 'Event loop is closed' / 'Press ENTER to continue' during idle (#3398) 2026-03-27 09:45:25 -07:00
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
…
test_cli_init.py feat(cli): configurable busy input mode + fix /queue always working (#3298) 2026-03-26 17:58:40 -07:00
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_compressor_fallback_update.py fix(agent): update context compressor limits after fallback activation (#3305) 2026-03-26 18:10:50 -07:00
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: cap context pressure percentage at 100% in display (#3480) 2026-03-27 21:42:09 -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
…
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: prevent reasoning box from rendering 3x during tool-calling loops (#3405) 2026-03-27 09:57:50 -07:00
test_redirect_stdout_issue.py
…
test_resume_display.py
…
test_run_agent.py fix(agent): detect thinking-budget exhaustion on truncation, skip useless retries (#3444) 2026-03-27 15:29:30 -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
…
test_toolset_distributions.py
…
test_toolsets.py
…
test_trajectory_compressor.py
…
test_worktree.py
…
test_worktree_security.py
…