hermes-agent/tests/agent/transports
Teknium 7a65800fed
fix(cache): content-address prompt_cache_key so recurring cron jobs reuse the warm prefix (#52295)
Recurring cron jobs were prompt-cache-cold on every fire. session_id is
built as cron_<job_id>_<timestamp>, and the Codex/Responses transport used
session_id directly as prompt_cache_key — so the timestamp changed the cache
key on every run and the static prefix (agent identity + tool schemas) was
re-paid each tick.

Derive prompt_cache_key from a SHA-256 of the static prefix (instructions +
sorted tool schemas) instead. Repeated fires of the same job share one
content-addressed key (pck_<hash>) and reuse the warm prefix within the
provider's cache TTL. The key changes exactly when the prefix changes —
edit the job's prompt or toolset and it re-keys; leave it alone and it stays
stable.

session_id is left untouched for transcript isolation, log correlation, and
the Codex/xAI session-scope routing headers (session_id, x-client-request-id,
x-grok-conv-id) — those are the per-fire identity, not the cache key. Only the
prompt_cache_key body field (standard OpenAI/Codex path and the xAI extra_body
field) is content-addressed.

Closes #51395.

Co-authored-by: spiky02plateau <spiky02plateau@users.noreply.github.com>
Co-authored-by: JoaoMarcos44 <JoaoMarcos44@users.noreply.github.com>
2026-06-24 21:46:30 -07:00
..
__init__.py feat: add transport types + migrate Anthropic normalize path 2026-04-20 23:06:00 -07:00
test_bedrock_transport.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_chat_completions.py feat(providers): remove google-gemini-cli + google-antigravity OAuth providers (#50492) 2026-06-21 19:53:27 -07:00
test_codex_app_server_runtime.py feat(providers): remove google-gemini-cli + google-antigravity OAuth providers (#50492) 2026-06-21 19:53:27 -07:00
test_codex_app_server_session.py fix(codex): record app-server token usage in session accounting 2026-06-09 02:46:04 -07:00
test_codex_event_projector.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_codex_transport.py fix(cache): content-address prompt_cache_key so recurring cron jobs reuse the warm prefix (#52295) 2026-06-24 21:46:30 -07:00
test_hermes_tools_mcp_server.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_transport.py fix(agent): surface model refusals instead of retrying them as errors 2026-06-14 12:10:08 +05:30
test_types.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00