accounting: use the accountant's own size bound (Withhold(res)), stop passing TokensBefore
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Read core/accounting/host.go around line 654 and core/accounting/metrics.go around line 252, then check the accountant dependency versions and the v0.11.0 API. Update the dependency and make both call-site changes described in the issue; run the accounting tests. Done when Withhold receives only the result and the observation no longer sets TokensBefore.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Cortex passes its own request size to the accountant in two places. accountant v0.11.0 measures the size itself, and the host size is going away (rossoctl/context-guru#1523). Please move Cortex to the library's own size bound.
What we found
Cortex main at 2cb6e041 (accountant pinned at v0.10.0):
core/accounting/host.go:654:accountant.Withhold(p.result, before). This is the legacy form with a host size.core/accounting/metrics.go:252:acmetrics.Observation{..., TokensBefore: tokensBefore}. A positiveTokensBeforemakes the sink use the legacy host bound.
Why
- With a host size, the bound compares host tokens against the accountant's ratio tokens. That is two different measures. Removed text that is denser than the request average (hex, code) can then make an honest request fail as
implausible_size(rossoctl/accountant#126 review). - From v0.11.0,
Withhold(res)with no size measures the client messages itself (Result.MessageTokens,PricedOp.SavedMessages/CausedMessages, design §6.7). Tool declarations are not counted. - context-guru moved to it in rossoctl/context-guru#1529.
Proposal
- Bump to accountant and accountant/metrics v0.11.0.
core/accounting/host.go: callaccountant.Withhold(p.result).core/accounting/metrics.go: stop settingTokensBeforein theObservation.- This is a behavior change for Cortex: the size bound moves from the host measure to the library measure. The Cortex owners decide it.
After this merges, the accountant removes the size argument of Withhold, SizeNotGiven and Observation.TokensBefore in its next minor release (rossoctl/context-guru#1523, #1524).
- 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 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
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
-
Packaging: support mise-en-placeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
ether/etherpad-go#571 ·
Los mantenedores suelen responder en 1 día
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)Abiertocost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sisaku-security/sisakulint#860 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100