feat(core): make system prompt immutable after session creation#33246
feat(core): make system prompt immutable after session creation#332460byte-coding wants to merge 3 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found several related PRs that involve system prompt and caching optimizations: Potentially Related PRs:
These PRs address similar domains of system prompt caching and session initialization, though none appear to be exact duplicates of PR #33246's specific implementation (in-memory HashMap caching per session ID). However, PRs #31867, #14743, and #29949 are closest in addressing cache efficiency and system prompt immutability concepts. |
Issue for this PR
Closes #29672
Type of change
What does this PR do?
Caches the system prompt in-memory per session ID so it becomes immutable after the session is created. This prevents unnecessary cache misses when the same session makes multiple requests.
The implementation stores system prompts in a HashMap keyed by session ID. This is very minimal and focused - just enough to lock the prompt after initialization.
How did you verify your code works?
I tested locally that:
Screenshots / recordings
N/A - This is not a UI change
Checklist