Skip to content

fix(enclave): use conversation messages instead of system prompt - #22

Merged
mgabor3141 merged 1 commit into
mainfrom
fix/enclave-cache-hints
Mar 23, 2026
Merged

fix(enclave): use conversation messages instead of system prompt#22
mgabor3141 merged 1 commit into
mainfrom
fix/enclave-cache-hints

Conversation

@mgabor3141

Copy link
Copy Markdown
Owner

Replace before_agent_start system prompt injection with sendMessage. The enclave hint is now a regular conversation message, sent once per session.

Why: Toggling enclave on/off mid-session changed the system prompt injection, which invalidates the entire prompt cache. With conversation messages, the hint is additive: it sits at a fixed position in history and only affects cache for messages after it.

Behavior:

  • session_start: sends hint if active and not already in session history
  • session_switch: same check for the new session
  • /enclave on: sends full hint (tools are in a VM, use /enclave add for missing packages)
  • /enclave off: sends short note (tools now run on host)
  • Resumed sessions: hint already in history, no duplicate sent

Replace before_agent_start system prompt injection with sendMessage.
The enclave hint is now a regular conversation message, added once
per session. This avoids cache invalidation when toggling enclave
on/off mid-session.

- session_start: sends hint if active and not already in history
- /enclave on: sends full hint
- /enclave off: sends short 'tools on host' note
- session_switch: sends hint if active in new session
- Resumed sessions: hint already in history, no duplicate
@mgabor3141
mgabor3141 force-pushed the fix/enclave-cache-hints branch from 3ee8824 to 69e8df0 Compare March 23, 2026 10:59
@mgabor3141
mgabor3141 merged commit cfdbedb into main Mar 23, 2026
1 check passed
@mgabor3141
mgabor3141 deleted the fix/enclave-cache-hints branch March 23, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant