accounting: use the accountant's own size bound (Withhold(res)), stop passing TokensBefore
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Go
- スター
- 31
- フォーク
- 49
- 平均マージ
- 9時間 43分
- マージ済み PR(30日)
- 367
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug laptop
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind対応中かも @arshil42 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
ether/etherpad-go#571 ·
メンテナーはふだん 1 日以内に返信
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)オープンcost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sisaku-security/sisakulint#860 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100