contextguru plugin: set keepalive.Record.PrefixRewritten, so a client compaction does not switch the 1-hour route off
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start with core/plugins/contextguru/keepalive.go and recordFor, then trace how the request's thread.Result reaches apply.Opts.ThreadOf. Compare the prefix rewrite rule in proxy/dashcapture.go with keepalive/onehour.go and check existing tests around those paths. Done means a rewritten prefix releases the 1-hour probe without switching the route off, with prefix_rewritten included in the relevant keeper logs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The contextguru plugin never sets keepalive.Record.PrefixRewritten. The keeper then counts a cold return after a client compaction or a fork as a failure of the 1-hour cache. On 2026-11-27 this switched the Opus route off for the life of the process. The context-guru proxy proved the same route on the same litellm gateway.
Found on Cortex main plus fix/2134-gate-untrusted-savings (499c6ddc), with context-guru v0.7.9 and cache.strategy: 1-hour-on-wait.
What we found
- The log shows:
- 01:18:54: a 1-hour probe starts on the main thread of one session. The 1-hour ping reads 267,251 tokens.
- 01:35:16: the main thread returns, 16 m 21 s later. It reads 24,073 of 267,251 tokens.
- 01:35:27:
WARN context-guru: no more 1-hour keep-alive pings on this route ... (a silent downgrade). - 01:35:28: in the same second, the session sends a request of 55k tokens. The thread before was 122k tokens. That is the shape of a client compaction or a fork.
resolveOneHourProbe(keepalive/onehour.go) does not count a return withprefixRewrittentrue: "A return on another model, or after the client rewrote the prefix (a compaction, a fork), reads cold whatever the cache tier is: it proves nothing about the grant."- The context-guru proxy sets the flag from the engine's thread result (
proxy/dashcapture.go,prefixRewritten): a compaction verdict, or a thread that inherits from another one. - The plugin does not set it (
core/plugins/contextguru/keepalive.go,recordFor), so the flag is always false. - I cannot prove that the 01:35:16 return was rewritten, because Cortex does not log it. But the proxy proved the same route and model on the same gateway, so a real downgrade is unlikely.
Why it matters
- After the switch-off,
1-hour-on-waitruns asautoon that route until the next restart. - Any client compaction that follows a probe can cause it again.
Proposal
- Set
Record.PrefixRewrittenfrom the request'sthread.Result, the same one #2129 gives toapply.Opts.ThreadOf:- a compaction verdict from the thread tracker;
- a thread that inherits from another one (
Result.InheritsFrom()).
- Move the proxy's rule into a library function that both hosts call, so the two hosts cannot drift. That is a context-guru change. Today the rule is in
proxy/dashcapture.go. - Log
prefix_rewrittenon the keeper's WARN and INFO lines for 1-hour probes, so a false downgrade can be seen.
How to check the fix
- A client compaction right after a 1-hour probe gives
1-hour probe released; it proved nothing, not a switch-off.
Technical notes
- Related: #2154 (open-task counts, false 1-hour probes), rossoctl/context-guru#1514 (keep a proven route across restarts).
- Lingua principale
- Go
- Stelle
- 31
- Fork
- 49
- Merge medio
- 9h 43m
- PR unite (30g)
- 367
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rossoctl/cortex
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug laptop
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rossoctl/cortex
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/dubbo-admin#1659 ·
I maintainer di solito rispondono entro 8 giorni
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behindForse già presa @arshil42 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/go-sdk#1557 ·
I maintainer di solito rispondono entro 1 giorno