# NousResearch/hermes-agent · Prompt cache affinity key and session ID fixes

## Open now

- Nothing open on GitHub.

These issues and pull requests address bugs in how conversation affinity keys, prompt cache scopes, and per-response session IDs are generated or rotated, including host-declared key handling, scope isolation, and epoch mixing on new conversation rotation.

## TL;DR

- 5 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 3 PR(s) closed without merging.
- A fix was merged to main in PR #97704. Verify it addresses your case.
- **Recommended:** read PR #97704 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.40`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #96811: Per-response session ids churn every conversation-affinity key (prompt_cache_key, sticky session_id, x-grok-conv-id)

## Prior & competing PRs

- **#97704: fix: P0 batch — five prompt-cache fixes + two desktop persistence fixes (salvage of #97618 #96755 #97327 #96768 #96608 #95886)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/bedrock_adapter.py`, `agent/chat_completion_helpers.py`, `agent/prompt_cache_boundary.py`, `agent/prompt_caching.py`, `agent/transcript_repair.py`, `agent/transports/chat_completions.py`, `agent/turn_finalizer.py`, `apps/desktop/electron/gateway-file-download-transport.test.ts`, `apps/desktop/electron/gateway-file-download.fs.test.ts`, `apps/desktop/electron/gateway-file-download.test.ts`, `apps/desktop/electron/gateway-file-download.ts`, `apps/desktop/electron/main.ts`, `apps/desktop/src/app/session/hooks/use-message-stream/index.ts`, `apps/desktop/src/app/session/hooks/use-message-stream/session-info-side-effects.test.tsx`, `apps/desktop/src/lib/chat-messages.test.ts`, `apps/desktop/src/lib/chat-messages/parts.ts`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `hermes_state.py`, `run_agent.py` (+7 more)
- **#96768: test(cache): pin the prompt-cache scope isolation invariant for per-response session ids**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#97704`
- **#97158: fix(cache): honor the host-declared conversation key on the affinity-key path**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#96811`, `#79017`, `#86733`, `#97709`, `#98170`
- **#98795: fix(cache): mix conversation epoch into declared scope for /new rotation (#96811)**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#98811`, `#96811`

## Fix status

- Merged to main in PR #97704 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-08-29`.
