hermes-agent/tests
teknium1 aedb773f0d fix: stabilize system prompt across gateway turns for cache hits
Two changes to prevent unnecessary Anthropic prompt cache misses in the
gateway, where a fresh AIAgent is created per user message:

1. Reuse stored system prompt for continuing sessions:
   When conversation_history is non-empty, load the system prompt from
   the session DB instead of rebuilding from disk. The model already has
   updated memory in its conversation history (it wrote it!), so
   re-reading memory from disk produces a different system prompt that
   breaks the cache prefix.

2. Stabilize Honcho context per session:
   - Only prefetch Honcho context on the first turn (empty history)
   - Bake Honcho context into the cached system prompt and store to DB
   - Remove the per-turn Honcho injection from the API call loop

   This ensures the system message is identical across all turns in a
   session. Previously, re-fetching Honcho could return different context
   on each turn, changing the system message and invalidating the cache.

Both changes preserve the existing behavior for compression (which
invalidates the prompt and rebuilds from scratch) and for the CLI
(where the same AIAgent persists and the cached prompt is already
stable across turns).

Tests: 2556 passed (6 new)
2026-03-09 01:50:58 -07:00
..
agent fix: use correct role for summary message in context compressor 2026-03-08 23:09:04 -07:00
cron Merge PR #309: fix(timezone): timezone-aware now() for prompt, cron, and execute_code 2026-03-07 00:04:41 -08:00
fakes
gateway fix: unify gateway session hygiene with agent compression config 2026-03-08 21:30:48 -07:00
hermes_cli Merge pull request #732 from NousResearch/hermes/hermes-2cb83eed 2026-03-08 20:10:32 -07:00
honcho_integration
integration chore: remove all NOUS_API_KEY references 2026-03-08 17:45:38 -07:00
tools fix: apply secret redaction to file tool outputs 2026-03-09 00:49:46 -07:00
__init__.py
conftest.py
test_413_compression.py
test_api_key_providers.py fix: add Kimi Code API support (api.kimi.com/coding/v1) 2026-03-07 21:00:12 -05:00
test_atomic_json_write.py refactor: extract atomic_json_write helper, add 24 checkpoint tests 2026-03-06 05:50:12 -08:00
test_auth_codex_provider.py
test_auth_nous_provider.py
test_auxiliary_config_bridge.py fix: harden auxiliary model config — gateway bridge, vision safety, tests 2026-03-08 18:06:47 -07:00
test_batch_runner_checkpoint.py refactor: extract atomic_json_write helper, add 24 checkpoint tests 2026-03-06 05:50:12 -08:00
test_cli_init.py chore: remove dead module stubs from test_cli_init.py 2026-03-08 05:35:02 -07:00
test_cli_model_command.py fix: improve /model user feedback + update docs 2026-03-08 06:13:12 -07:00
test_cli_provider_resolution.py fix: trust user-selected models with OpenAI Codex provider 2026-03-08 18:29:09 -07:00
test_codex_execution_paths.py feat: simple fallback model for provider resilience 2026-03-08 20:22:33 -07:00
test_codex_models.py Merge pull request #735 from NousResearch/hermes/hermes-f8d56335 2026-03-08 18:30:27 -07:00
test_external_credential_detection.py
test_fallback_model.py refactor: unified OAuth/API-key credential resolution for fallback 2026-03-08 21:44:48 -07:00
test_flush_memories_codex.py
test_hermes_state.py fix: add title validation — sanitize, length limit, control char stripping 2026-03-08 15:54:51 -07:00
test_honcho_client_config.py
test_insights.py fix: deep review — prefix matching, tool_calls extraction, query perf, serialization 2026-03-06 14:50:57 -08:00
test_model_tools.py
test_provider_parity.py feat: default reasoning effort from xhigh to medium 2026-03-07 10:14:19 -08:00
test_resume_display.py feat: display previous messages when resuming a session in CLI 2026-03-08 17:45:45 -07:00
test_run_agent_codex_responses.py
test_run_agent.py fix: stabilize system prompt across gateway turns for cache hits 2026-03-09 01:50:58 -07:00
test_runtime_provider_resolution.py fix: custom endpoint no longer leaks OPENROUTER_API_KEY (#560) 2026-03-06 17:16:14 -08:00
test_timezone.py
test_toolset_distributions.py
test_toolsets.py
test_trajectory_compressor.py
test_worktree.py fix: wire worktree flag into hermes CLI entry point + docs + tests 2026-03-07 21:05:40 -08:00