mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #456] [CLOSED] Monitor: the conversation cache card (parked conversations from the engine's CACHE lines) #2650
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2650
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/456
Author: @sebastianrcnt
Created: 10/2/2026
Status: ❌ Closed
Base:
main← Head:monitor-conversation-cache📝 Commits (1)
81265e2Monitor: the conversation cache card (parked conversations from the engine's CACHE lines)📊 Changes
6 files changed (+99 additions, -1 deletions)
View changed files
📝
include/strata/core/conversation_cache.hpp(+1 -0)📝
serve/server.py(+23 -1)📝
serve/test_server.py(+22 -0)📝
serve/web/app.js(+26 -0)📝
serve/web/index.html(+12 -0)📝
src/program/generate.cpp(+15 -0)📄 Description
With
--conversation-cache-mibthe engine parks up to N conversations in RAM (#189), but the web app showed nothing about them. Only the per-request "Reused" column hints that a parked conversation was mounted.What this adds
CACHE <live tokens> <parked bytes> <evictions> <superseded> [<tokens>:<bytes> ...](parked conversations least recently active first), printed afterREADYand after everyDONE, only when the conversation cache is on.ConversationCachegets a read-onlyentries()accessor; nothing else in the engine changes.StrataEngine._pumptakesCACHElines off the stdout stream (so a request's reader never sees them) and keeps the last one;GET /metricsreturns it asconversations(budget and slots from the engine arguments, plus the reported state).--conversation-cache-mib.Compatibility: an older server skips the unknown line (the request loop ignores lines it does not know); with an older engine the card says it is waiting for the first report.
Tested
python -m unittest serve.test_server: 89 tests OK, including a newtest_conversation_cache_lines(the pump keeps CACHE lines out of the request queue, the last one wins, a malformed one changes nothing,/metricsreturns it).--conversation-cache-mib 8192 --conversation-cache-slots 4: three alternating conversations plus a follow-up turn; the card showed the live conversation (1,919 tokens) and three parked ones (1,753 / 1,106 / 570 tokens, 0.7 of 8.0 GB), matching the engine log.printfin the serve loop, nothing platform-specific.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.