contextguru plugin: set keepalive.Record.PrefixRewritten, so a client compaction does not switch the 1-hour route off
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Go
- Estrellas
- 31
- Forks
- 49
- Merge medio
- 9 h 43 min
- PR fusionados (30 d)
- 367
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rossoctl/cortex
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
contextguru plugin: set keepalive.Record.Identity; context-guru v0.7.11 removes Record.AgentAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
bug laptop
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
apache/dubbo-admin#1659 ·
Los mantenedores suelen responder en 8 días
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behindPosiblemente ocupada @arshil42 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
modelcontextprotocol/go-sdk#1557 ·
Los mantenedores suelen responder en 1 día