# NousResearch/hermes-agent · Surface switch causes unnecessary system prompt rebuild and cache miss

## Open now

- Nothing open on GitHub.

A bug where switching between desktop and TUI surfaces invalidates the stored system prompt, triggering a full rebuild and losing prompt-cache hits on large contexts. The members include the bug report and related fix attempts addressing this cache inefficiency.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #105844. Verify it addresses your case.
- **Recommended:** read PR #105844 (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: `resolved` · deciding PR(s): `pr-105844`. 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.50`: 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

- #104414: \[Bug\]: Surface switch (desktop↔TUI) makes stored system prompt 'stale' → full rebuild → 100% prompt-cache miss (200K+) across restart/resume

## Prior & competing PRs

- **#105844: Surface switch (desktop↔TUI) no longer rebuilds the system prompt and re-prefills the request (#104414, salvage #104494)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/conversation_loop.py`, `agent/surface_switch.py`, `agent/system_prompt.py`, `agent/turn_context.py`, `tests/agent/test_system_prompt_restore.py`, `tools/mcp_tool_agent.py`, `website/docs/developer-guide/prompt-assembly.md`
- **#104484: fix(agent): ignore surface/cwd drift when reusing stored system prompt**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#104494`, `#104414`
- **#104494: fix(agent): a surface switch must not re-prefill the whole request (#104414)**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `a54945f1b7`, `4e30306386`, `#105844`

## Fix status

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