hermes-agent/tests
Julien Talbot b577697189 fix(model_metadata): add xAI Grok context length fallbacks
xAI /v1/models does not return context_length metadata, so Hermes
probes down to the 128k default whenever a user configures a custom
provider pointing at https://api.x.ai/v1. This forces every xAI user
to manually override model.context_length in config.yaml (2M for
Grok 4.20 / 4.1-fast / 4-fast) or lose most of the usable context
window.

Add DEFAULT_CONTEXT_LENGTHS entries for the Grok family so the
fallback lookup returns the correct value via substring matching.
Values sourced from models.dev (2026-04) and cross-checked against
the xAI /v1/models listing:

  - grok-4.20-*          2,000,000  (reasoning, non-reasoning, multi-agent)
  - grok-4-1-fast-*      2,000,000
  - grok-4-fast-*        2,000,000
  - grok-4 / grok-4-0709   256,000
  - grok-code-fast-1       256,000
  - grok-3*                131,072
  - grok-2 / latest        131,072
  - grok-2-vision*           8,192
  - grok (catch-all)       131,072

Keys are ordered longest-first so that specific variants match before
the catch-all, consistent with the existing Claude/Gemma/MiniMax entries.

Add TestDefaultContextLengths.test_grok_models_context_lengths and
test_grok_substring_matching to pin the values and verify the full
lookup path. All 77 tests in test_model_metadata.py pass.
2026-04-10 03:04:19 -07:00
..
acp fix(acp): populate usage from top-level result fields 2026-04-10 03:00:12 -07:00
agent fix(model_metadata): add xAI Grok context length fallbacks 2026-04-10 03:04:19 -07:00
cli feat: add Anthropic Fast Mode support to /fast command (#7037) 2026-04-10 02:32:15 -07:00
cron feat(cron): track delivery failures in job status (#6042) 2026-04-07 22:49:01 -07:00
e2e
environments/benchmarks fix(security): consolidated security hardening — SSRF, timing attack, tar traversal, credential leakage (#5944) 2026-04-07 17:28:37 -07:00
fakes
gateway fix(gateway): remove DM thread session seeding to prevent cross-thread contamination (#7084) 2026-04-10 03:01:59 -07:00
hermes_cli Refresh OpenRouter model catalog 2026-04-10 02:57:39 -07:00
honcho_plugin fix(honcho): migration guard for observation mode default change 2026-04-05 12:34:11 -07:00
integration
plugins feat(hindsight): feature parity, setup wizard, and config improvements 2026-04-08 23:54:15 -07:00
run_agent fix: clear conversation_history after mid-loop compression to prevent empty sessions (#7001) 2026-04-10 00:14:59 -07:00
skills fix: update tests for gws migration 2026-04-09 14:28:35 -07:00
tools fix(tests): update mocks for file sync changes 2026-04-10 03:01:46 -07:00
__init__.py
conftest.py fix(tests): fix several failing/flaky tests on main (#6777) 2026-04-09 13:17:06 -07:00
run_interrupt_test.py
test_batch_runner_checkpoint.py
test_cli_skin_integration.py fix: CLI/UX batch — ChatConsole errors, curses scroll, skin-aware banner, git state banner (#5974) 2026-04-07 17:59:42 -07:00
test_ctx_halving_fix.py fix(compaction): don't halve context_length on output-cap-too-large errors 2026-04-09 11:27:41 -07:00
test_evidence_store.py
test_hermes_logging.py feat(nix): shared-state permission model for interactive CLI users (#6796) 2026-04-10 03:48:42 +05:30
test_hermes_state.py fix(state): orphan children instead of cascade-deleting in prune/delete (#6513) 2026-04-09 02:41:56 -07:00
test_honcho_client_config.py
test_mcp_serve.py
test_minisweagent_path.py
test_model_picker_scroll.py fix: CLI/UX batch — ChatConsole errors, curses scroll, skin-aware banner, git state banner (#5974) 2026-04-07 17:59:42 -07:00
test_model_tools_async_bridge.py
test_model_tools.py Add request-scoped plugin lifecycle hooks 2026-04-05 23:31:29 -07:00
test_ollama_num_ctx.py fix: provider/model resolution — salvage 4 PRs + MiniMax aux URL fix (#5983) 2026-04-07 22:23:28 -07:00
test_packaging_metadata.py
test_project_metadata.py
test_retry_utils.py feat(agent): add jittered retry backoff 2026-04-08 00:41:36 -07:00
test_sql_injection.py
test_timezone.py fix: repair 57 failing CI tests across 14 files (#5823) 2026-04-07 09:58:45 -07:00
test_toolset_distributions.py
test_toolsets.py
test_trajectory_compressor_async.py
test_trajectory_compressor.py
test_utils_truthy_values.py