Skip to content

fix(modelinfo): keep the 1-hour cache-write rate; set it per model - #937

Merged
amiddavid merged 2 commits into
mainfrom
fix/cache-write-1h-frac
Nov 8, 2026
Merged

amiddavid merged 2 commits into
mainfrom
fix/cache-write-1h-frac

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Behavior change. It affects only an operator who sets the new cache_write_1h_frac key in the price list. Nobody else sees a change.

  • Old: every 1-hour cache write is priced at 2.0x the input rate.
  • New: an entry with cache_write_1h_frac uses that multiple instead, on every page that prices a 1-hour write (the dashboard row, the keep-alive costs, the live keep-alive row, the KV-cache simulator). A multiple below the entry's 5-minute rate gives the 5-minute rate.
  • To turn it off: leave the key unset. Unset keeps 2.0x (Anthropic's rate), so every existing entry prices exactly as before.

Summary

A price-list entry can now set its 1-hour cache-write rate. This also fixes a bug that threw away a 1-hour rate on every price lookup.

What we found

  • Price.Resolved cleared Write1hFrac.
  • Table.Price calls Resolved on every lookup.
  • So a 1-hour rate was always lost, and the dashboard row and the keep-alive costs fell back to 2.0x.
  • The price list had no key to set a 1-hour rate at all. Every model was priced at Anthropic's 2.0x, also for a gateway that bills the 1-hour write at another rate.

What changed

  • internal/modelinfo/modelinfo.go: Resolved keeps Write1hFrac. It still clears ReadFrac and WriteFrac, because their values move into stated fields.
  • internal/modelinfo/table.go: a new optional per-entry key cache_write_1h_frac, the 1-hour cache-write rate as a multiple of in. A negative value is a load error.
  • kvcache/pricing.go: FromPrice keeps the entry's 1-hour multiple when the caller sets none (review round 1).
  • dash/keepalive.go: the live row's 1-hour break-even uses Price.CacheWrite1h, not a 2.0x constant (review round 1).
  • CacheWrite1hFor raises an operator rate below the 5-minute rate to the 5-minute rate (review round 1).
  • Docs: the key is described in docs/reference/reference.md and at the top of deploy/service/prices.example.yaml.
  • The shipped price list sets the key on no row.

Data dependence

Metadata only: the change reads a price rate from the operator's price file. It stores nothing new. It is the same at every storage level (off, metadata only, everything). No component is added or changed, so docs/data-dependence.md has no row to update.

How it was tested

  • ParseTable reads the key, rejects a negative value, and leaves it 0 when unset.
  • Resolved and Table.Price keep the multiple. These tests fail with the old Resolved line.
  • An entry with 1.0 adds no 1-hour extra cost through Event.Price, pingCost and sweepAnswerUSD.
  • A Claude entry without the key keeps its exact 2.0x rate (the value is pinned).
  • No row of the shipped list sets the key; TestShippedPriceListLoads and TestEveryGatewayModelIsPriced pass.
  • go test -race on internal/modelinfo, dash, keepalive and proxy; go vet ./... and gofmt are clean.

Two tests fail on this branch and on plain main alike, so they are not caused by this change:

Not tested end to end with a running proxy and a price file that sets the key.

BEHAVIOR CHANGE. It affects only an operator who sets the new
cache_write_1h_frac key in the price list. Nobody else sees a change.
- Old: every 1-hour cache write was priced at 2.0x the input rate.
- New: an entry with cache_write_1h_frac uses that multiple instead.
- To turn it off, leave the key unset. Unset keeps 2.0x (Anthropic's
  rate), so every existing entry prices exactly as before.

Bug fix: Price.Resolved cleared Write1hFrac. Table.Price calls
Resolved on every lookup, so a 1-hour rate was always lost. The
dashboard row and the keep-alive costs then fell back to 2.0x.
Resolved now keeps Write1hFrac.

Feature: a price-list entry may set cache_write_1h_frac, the 1-hour
cache-write rate as a multiple of in. A negative value is a load error.
The shipped price list sets the key on no row. The key is documented
in docs/reference/reference.md and at the top of prices.example.yaml.

Tests:
- ParseTable reads the key, rejects a negative value, and leaves it 0
  when unset.
- Resolved and Table.Price keep the multiple.
- An entry with 1.0 adds no 1-hour extra cost through Event.Price,
  pingCost and sweepAnswerUSD. A Claude entry without the key keeps
  its exact 2.0x rate.
- No row of the shipped list sets the key.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 1 of 2 1 of 2 88257769f05d blocking

Verdict: blocking

Findings

  1. kvcache/pricing.go:122 — the KV-cache simulator and every NewPriceList caller ignore cache_write_1h_frac

    • What fails: an operator sets {match: acme/flat-1, in: 3, out: 15, cache_write_1h_frac: 1.0}. Table.Price now returns Write1hFrac = 1.0. Then FromPrice overwrites it with the deployment default. The simulator row shows Write1h = 6e-6 (2.0x), not 3e-6. The dashboard request row prices the same model at 1.0x. Two pages now give two prices for one model.
    • Proof:
      • kvcache/pricing.go:120-122: m = m.WithDefaults() sets m.Write1h = 2.0 when the caller left it 0 (pricing.go:98-100). Then p.Write1hFrac = m.Write1h replaces the entry's value without a check.
      • pricing.go:142: out.Write1h = p.CacheWrite1hFor(model) then reads 2.0.
      • Callers that get the wrong rate: dash/kvcachesim.go:251,562, dash/kvcache.go:813, dash/kvcachesuggest.go:253,397, dash/summarizeattr.go:133 (passes Multipliers{}, so always 2.0), dash/compactepisode.go:1280. pricing.go:338 uses p.Write1h for the simulated 1-hour cost.
      • The PR text says "an entry with cache_write_1h_frac uses that multiple instead". This is not true on these paths. No test covers them.
    • Fix: treat Write1h like the read multiple. Keep p.Write1hFrac when the caller did not set Multipliers.Write1h (userMult.Write1h == 0); override only when the caller set it. Also check the pricing.go:144 fallback, which uses m.Write1h. Add a FromPrice/NewPriceList test with a Table entry at 1.0.
  2. dash/keepalive.go:1145 — the live keep-alive 1-hour breakeven still uses the 2.0x constant

    • What fails: for the same acme/flat-1 entry, Breakeven1hPings and Breakeven1hMinutes use p.Input*write1hMultiple (2.0x). The 1-hour lapse cost is too high, so the page shows too many breakeven pings for a 1-hour entry.
    • Proof: dash/keepalive.go:980 const write1hMultiple = modelinfo.AnthropicCacheWrite1hFrac; line 1145 miss1h := float64(r.Prefix) * (p.Input*write1hMultiple - p.CacheRead). p comes from the same price function, so p.CacheWrite1h() is now available and correct. The comment at 973-979 ("the list carries one cache_write rate per model") is also out of date after this PR.
    • Fix: use p.CacheWrite1h() at line 1145, remove or update the constant and its comment, and add a test row with the key set.

Non-blocking

  • cache_write_1h_frac: 0 means "default 2.0x", not "free". This matches the other multiples, but the docs could say it in one line.
  • A value below the 5-minute rate (for example 1.0 on a Claude entry) gives no premium in CostWithCacheWrite1h and gets clamped in FromPrice:148. Both paths end at the 5-minute rate, so they agree. The docs could say that a value below the 5-minute rate has no effect.
  • The PR names the behavior change at the top. A human developer must still confirm it before merge (CLAUDE.md, "No behavior change ... without a human developer's permission").

What I checked

  • Read the full diff (7 files) and the commit message.
  • Read Price, CacheWrite1hFor, Resolved, CostWithCacheWrite1h in internal/modelinfo/modelinfo.go, and ParseTable/Table.Price in table.go.
  • Checked the other Resolved caller (internal/modelinfo/litellm/litellm.go:219): LiteLLM sets no Write1hFrac, so there is no change there.
  • Found every reader of CacheWrite1h(), CacheWrite1hFor, Write1hFrac and AnthropicCacheWrite1hFrac. dash/event.go, keepalive (pingCost, sweepAnswerUSD), tooldefer/ledger.go, dash/spendexplain.go, dash/adapttools.go, dash/toolsuggest.go, dash/cachestate.go, dash/adaptcompaction.go all read p.CacheWrite1h() and get the new rate. The two sites above do not.
  • Checked proxy/proxy.go:906 selfRates: TokenRates has no 1-hour field, so it is not affected.
  • Checked the new tests: the arithmetic in the dash, keepalive and modelinfo tests is correct (20319 = 4 + 20315 at 1.0x; the Claude premium is 0.75 x $3/MTok). TestShippedPriceListSetsNoCacheWrite1hFrac pins the shipped file.
  • Fail open: no new error path at request time. A negative value is a startup error, which matches the other rate keys.
  • Data dependence: metadata only (a price rate). No component row changes.
  • I did not run Go builds or tests (not approved, Go is not installed).

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 2 of 2 1 of 2 88257769f05d blocking

Verdict: blocking

The Resolved fix is correct. It changes nothing for an entry without the new key: no source other than Table sets Write1hFrac before Resolved, and LiteLLM leaves it 0. But the new key reaches only some of the places that price a 1-hour write. Other pages still use 2.0x, or use a different floor. The docs say the key sets "the 1-hour cache-write rate", so an operator expects one rate everywhere.

Findings

  1. kvcache/pricing.go:122 — the KV-cache simulator overwrites the entry's cache_write_1h_frac with 2.0x

    • What fails: an entry has cache_write_1h_frac: 1.0. Table.Price now returns Write1hFrac = 1.0. FromPrice then runs p.ReadFrac, p.WriteFrac, p.Write1hFrac = userRead, m.Write5m, m.Write1h. m = m.WithDefaults(), so m.Write1h is always 2.0 unless the mult_w1h query parameter is set. CacheWrite1hFor (line 142) then returns 2.0x input. The dashboard row (Event.Price) prices the 1-hour write at 1.0x. The simulator, the keep-alive suggestions, and the compaction episode pages price the same write at 2.0x. That is every NewPriceList caller: dash/kvcachesim.go:251,562, dash/kvcache.go:813, dash/kvcachesuggest.go:253,397, dash/summarizeattr.go:133, dash/compactepisode.go:1280.
    • Proof: kvcache/pricing.go:119-122 and :141-142. Before this PR, Write1hFrac was always 0 when it got to this point, so the overwrite lost nothing. This PR makes the overwrite drop a real value. No test covers FromPrice or NewPriceList with the new key.
    • Fix: in FromPrice, keep p.Write1hFrac when it is > 0 and the caller did not set Multipliers.Write1h. This is the same rule that CacheRead uses with userRead. Use the same effective multiple in the out.Input == 0 branch (line 144). Add a NewPriceList test with a Table entry that sets the key.
  2. dash/keepalive.go:1145 — the live keep-alive row's 1-hour break-even uses the constant 2.0x

    • What fails: miss1h := float64(r.Prefix) * (p.Input*write1hMultiple - p.CacheRead). write1hMultiple is AnthropicCacheWrite1hFrac (line 980). An entry with cache_write_1h_frac: 1.0 still gets Breakeven1hPings and Breakeven1hMinutes from 2.0x. That number is about 2x too high, so the page tells the user that the 1-hour tier tolerates more pings than it does.
    • Proof: dash/keepalive.go:973-980 and :1145. p comes from the same Pricer (line 1133), so p.CacheWrite1h() would give the entry's rate.
    • Fix: use p.CacheWrite1h() in place of p.Input*write1hMultiple. Remove the constant if it has no other user. Update its comment, which says the list "carries one cache_write rate per model".
  3. internal/modelinfo/table.go:117 — a multiple below the 5-minute rate prices differently on different paths; the documented 1.0 example fails on a Claude entry

    • What fails: a Claude entry (5-minute write = 1.25x) sets cache_write_1h_frac: 1.0, the example in docs/reference/reference.md. Then:
      • CostWithCacheWrite1h (modelinfo.go:142) adds a premium only when it is > 0. The dashboard row and the keep-alive costs bill the 1-hour tokens at 1.25x, not 1.0x.
      • NextRequestUSD (dash/cachestate.go:378), adaptRates (dash/adaptcompaction.go:1024,1036), tooldefer/ledger.go:57, dash/toolsuggest.go:236 and dash/adapttools.go:481 read CacheWrite1h() directly. They use 1.0x.
      • kvcache.FromPrice (pricing.go:150) clamps up to the 5-minute rate: 1.25x (after finding 1 is fixed).
    • Proof: the new tests use acme/flat-1, a non-Claude id, where the 5-minute rate is also 1.0x. The comment on TestEntryWithOneHourFracOfOneAddsNoExtraCost says this. No test covers a Claude entry with a multiple below 1.25.
    • Fix: choose one rule and enforce it at load. For example, reject cache_write_1h_frac below the entry's effective 5-minute multiple, or clamp it in CacheWrite1hFor. Then fix the doc example so that it is true for a Claude entry, or so that it names a non-Claude gateway.

Non-blocking

  • cache_write_1h_frac: 0, when set explicitly, means "unset" (2.0x). A gateway that does not bill a 1-hour write cannot say so. That is fine, but the docs could state that 0 means the default, as they do for other keys.
  • The PR says the change affects only an operator who sets the key. That is true. Findings 1-3 are about that same operator. They are not about the default path.

What I checked

  • The full diff (7 files, 1 commit) and the commit message.
  • Price.Resolved, CacheWrite1hFor, CostWithCacheWrite1h and Table.Price. With no key, Write1hFrac stays 0, so every existing price is the same as before.
  • Every non-test reader of Write1hFrac, CacheWrite1h() and CacheWrite1hFor in the repo (the grep is in the findings).
  • litellm.go:219: Resolved runs there with Write1hFrac = 0, so nothing changes.
  • The keep-alive path: Keeper.price → Dispatcher.Price → the proxy's price function. pingCost and sweepAnswerUSD use CostWithCacheWrite1h, and the new test covers them.
  • ParseTable uses KnownFields(true), so a mistyped key fails at load. The negative-value check and its test are correct.
  • The data-dependence statement: metadata only, with no component row. That is correct.
  • I did not run tests. Go is not installed, and live tests are not approved.

The review of #937 found 3 paths that did not use the entry's
cache_write_1h_frac:

- kvcache.FromPrice replaced it with the 2.0x default. It now keeps
  the entry's multiple when the caller sets none.
- The live keep-alive row used a 2.0x constant for the 1-hour
  break-even. It now uses Price.CacheWrite1h.
- A multiple below the 5-minute rate gave 1.0x on some paths and the
  5-minute rate on others. CacheWrite1hFor now raises the operator's
  rate to the 5-minute rate, so all paths agree.

The docs say that 0 means the default, and that a value below the
5-minute rate gives the 5-minute rate.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

Round 1: replies

All findings are fixed in ee881521. Each fix has a test that failed first.

R1-1 and R2-1: kvcache.FromPrice replaced the entry's 1-hour multiple with 2.0x. Fixed.

  • FromPrice now keeps p.Write1hFrac when the caller did not set Multipliers.Write1h. A multiple the caller sets still wins.
  • The out.Input == 0 branch uses the same effective multiple, because m.Write1h now holds it.
  • Test: TestFromPriceKeepsTheEntryOneHourFrac. Before the fix: Write1h = 6e-06, want 3e-6.

R1-2 and R2-2: the live keep-alive row used the 2.0x constant. Fixed.

  • dash/keepalive.go now uses p.CacheWrite1h(). The constant write1hMultiple and its old comment are removed. It had no other user.
  • Test: TestTheLivePanelUsesThePriceListOneHourRate (an entry at 1.5x). Before the fix: breakeven_1h_pings = 18, want 13.
  • The existing TestTheLivePanelPricesOneSessionsOwnBreakeven still gives 18 for the default 2.0x.

R2-3: a multiple below the 5-minute rate gave different prices on different paths. Fixed.

  • CacheWrite1hFor now returns max(Input × Write1hFrac, CacheWrite5mFor(model)) for an operator multiple. Every path then gets the 5-minute rate, as CostWithCacheWrite1h and FromPrice already did.
  • I did not reject the value at load. A family entry such as claude-* has a 5-minute rate that depends on the model, so a load check cannot know it.
  • The default path (no key) is unchanged: 2.0x is always above the 5-minute rate.
  • Test: TestOneHourFracBelowTheFiveMinuteRateGivesTheFiveMinuteRate (a Claude entry at 1.0x). Before the fix: 3e-06, want 3.75e-06.

Non-blocking: 0 means the default. The docs now say "Unset or 0", and that a value below the 5-minute rate gives the 5-minute rate (reference.md, prices.example.yaml).

Non-blocking: a human's yes. Yes. The PR body names the behavior change at the top. It now also names the pages it reaches.

Checks

  • make lint: exit 0.
  • go test ./...: all packages pass except 12 tests that fail the same way on the unchanged base f43d9fa5:
    • internal/modelinfo TestRateFillTableAndPrice and proxy TestALateFirstByteOnTheRealTransportNeverReachesTheClient (both known on main).
    • 10 tests in context-guru-plugin (goldens and /var against /private/var paths on this Mac). I ran them on a clean checkout of f43d9fa5: the same 10 fail.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 1 of 2 2 of 2 ee8815211202 approve

Verdict: approve

Findings

None.

Earlier findings

  • R1-1 / R2-1 (kvcache.FromPrice replaced the entry's multiple): fixed. pricing.go:121-125 keeps p.Write1hFrac when the caller set no Multipliers.Write1h. m.Write1h then holds the effective multiple, so the Input == 0 branch (pricing.go:147) uses it too. TestFromPriceKeepsTheEntryOneHourFrac covers both the entry value and a caller value that wins.
  • R1-2 / R2-2 (live keep-alive row used 2.0x): fixed. dash/keepalive.go:1136 uses p.CacheWrite1h(). The constant and its old comment are gone. I found no other user of write1hMultiple.
  • R2-3 (a multiple below the 5-minute rate gave different prices): fixed. CacheWrite1hFor returns max(Input*Write1hFrac, CacheWrite5mFor(model)). Every reader of CacheWrite1h() now gets the 5-minute rate in that case. This agrees with CostWithCacheWrite1h (no premium) and with the FromPrice clamp. The default path (no key) does not change: it still returns Input * 2.0 with no clamp.
  • The author's reason not to reject the value at load is correct. A family entry such as claude-* has a 5-minute rate that depends on the queried model, so ParseTable cannot know it.

Non-blocking

  • NewPriceList (pricing.go:232-233) still reports Multipliers.Write1h = 2.0 for the whole list when the caller set none. A row for an entry with cache_write_1h_frac: 1.0 uses 1.0x. The code already avoids this mismatch for the read multiple ("so one payload never states 0.1 beside a row priced at 0.05"). The row rates are correct. Only the reported multiple can be wrong. Consider storing the caller's value (0) here, as the read multiple does.
  • CacheWrite1h() passes "" as the model to CacheWrite5mFor. This is safe on every current path: Table.Price resolves first, so CacheWrite is a stated rate. An unresolved price with Write1hFrac > 0 and no CacheWrite would use the default 5-minute rate for "". No caller does this today.
  • dash/write1hfrac_test.go:56 comment says the prefix is 100k. kaAgent sets CacheRead = 50_000, so the prefix is 150k. The result is the same (0.63 / 0.045015 = 13.99, so 13; at 2.0x 0.855 / 0.045015 = 18.99, so 18). Only the comment is wrong.
  • The behavior change still needs a human developer's yes before merge. The PR body names it.

What I checked

  • Last review: round 1, 88257769f05da2d761cd9883ff394fc775364ffe, 2026-11-08T09:17:40Z
  • New commits read: 1 (ee881521 fix(modelinfo): use the 1-hour rate on every pricing path)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 2 round-1 review (09:18:01Z): read all 3 findings. Findings 1 and 2 match mine. Finding 3 is new; I checked its fix above.
    • Author's reply comment (09:33:17Z): checked each claimed fix against the diff. All match. Accepted the reason for not rejecting at load.
  • Read the full diff 88257769..ee881521 (8 files) and the code around each change: FromPrice in full, CacheWrite1hFor, CacheWrite5mFor, KeepAliveLive around line 1136.
  • Checked the arithmetic of the 3 new tests (3e-6, 6e-6, 3.75e-6, 13 vs 18 pings).
  • Checked the doc text in reference.md and prices.example.yaml against the new code. It matches.
  • Fail open: no new error path. Data dependence: still metadata only.
  • I did not run Go builds or tests (not approved, Go is not installed). The author reports make lint exit 0 and go test ./... with only failures that also happen on the base.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 2 of 2 2 of 2 ee8815211202 approve

Verdict: approve

ee881521 fixes all round-1 findings from both reviewers. Every path that prices a 1-hour write now gets the same rate from Price.CacheWrite1hFor. The default path (no key) is unchanged.

Findings

None.

Status of round-1 findings

  • R2-1 (same as R1-1), kvcache.FromPrice overwrote the entry's multiple: fixed.
    • kvcache/pricing.go:121-126: when Multipliers.Write1h is unset and p.Write1hFrac > 0, m.Write1h takes the entry's value. A caller's mult_w1h still wins. The out.Input == 0 branch (m.Write1h / m.Write5m) uses the same effective value.
    • NewPriceList passes the Table price straight to FromPrice, so all 7 NewPriceList callers get the fix.
    • TestFromPriceKeepsTheEntryOneHourFrac covers the unset case and the caller-wins case. Arithmetic checked: 1.0 × 3e-6 and 2.0 × 3e-6.
    • The reported PriceList.Multipliers.Write1h (pricing.go:233) still shows the deployment default 2.0, not each entry's own multiple. That is a page-wide label, and each row's Write1h rate is correct. I do not count it as a defect.
  • R2-2 (same as R1-2), live keep-alive break-even used 2.0x: fixed.
    • dash/keepalive.go:1136 uses p.CacheWrite1h(). The constant and its old comment are removed. A grep finds no other user.
    • Default path: Write1hFrac = 0 gives Input × 2.0, the same as before. The existing TestTheLivePanelPricesOneSessionsOwnBreakeven still pins 18.
  • R2-3, a multiple below the 5-minute rate gave different rates on different paths: fixed (another fix than the one I proposed, and I accept it).
    • modelinfo.go:107-108: max(Input × Write1hFrac, CacheWrite5mFor(model)). The direct readers (NextRequestUSD, adaptRates, tooldefer, toolsuggest, adapttools) now agree with CostWithCacheWrite1h (no negative premium) and with the FromPrice clamp (pricing.go:150).
    • The author's reason not to reject at load is correct. A family entry such as claude-* can serve models with different 5-minute rates (Table.Price resolves with the queried model, table.go:214), so a load check cannot know the floor.
    • CacheWrite1h() passes "" as the model. That is safe here: after Resolved the 5-minute rate is a stated field, so CacheWrite5mFor does not read the model.
    • TestOneHourFracBelowTheFiveMinuteRateGivesTheFiveMinuteRate covers a Claude entry at 1.0 → 3.75e-6.
    • The docs now say that a value below the 5-minute rate gives the 5-minute rate. So the 1.0 example is correct for every entry.
  • Non-blocking "0 means the default": fixed in reference.md and prices.example.yaml.
  • R1 non-blocking "a human's yes": the author answered "Yes" and named the pages in the PR body. A human developer must still confirm before merge. I do not decide that.

Non-blocking

  • dash/write1hfrac_test.go:56: the comment says a 100k prefix. kaAgent sets CacheRead = 50_000 and the test does not clear it, so the prefix is 150k. The result is the same: 150k × 4.2e-6 / (150k × 3e-7 + 15e-6) = 13.99 → 13, and at 2.0x it is 18.99 → 18. The assertion is correct and still fails without the fix. Only the comment is wrong.

What I checked

  • Last review: round 1, 88257769f05da2d761cd9883ff394fc775364ffe, 2026-11-08T09:18:01Z
  • New commits read: 1 (ee881521 fix(modelinfo): use the 1-hour rate on every pricing path)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt)
  • New items since my last review:
    • Commit ee881521: read the full diff (8 files, 177 lines) and the code around each change (FromPrice, NewPriceList, KeepAliveLive, CacheWrite1hFor, Table.Price).
    • Comment by vz-ibm at 2026-11-08T09:33:17Z (round-1 replies): checked each reply against the code. See "Status of round-1 findings".
    • Reviewer 1's round-1 review (09:17:40Z, posted before mine, read now for the first time): R1-1 and R1-2 match my R2-1 and R2-2, and both are fixed. Its non-blocking points are handled.
  • Grep of every non-test Write1hFrac user after the commit: only modelinfo.go, table.go and kvcache/pricing.go.
  • Default path: with no key, CacheWrite1hFor returns Input × 2.0 with no clamp, the same as before. No new error path at request time, so fail-open is not affected.
  • Data dependence: metadata only (a price rate). No component row changes.
  • I did not run tests. Go is not installed, and live tests are not approved. The author reports make lint exit 0 and go test ./... failures that also occur on the base.

@vz-ibm
vz-ibm requested a review from amiddavid November 8, 2026 09:57
@amiddavid
amiddavid merged commit e24503c into main Nov 8, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 8, 2026
amiddavid added a commit that referenced this pull request Nov 8, 2026
check-ready.sh now fails a PR whose head has no passing CodeQL check
run from GitHub's code-scanning app. RELEASING.md gets new rules:
a PR opened before #945 needs a new push before it merges; after an
--admin merge, read the merge's rule results and tell the owner of
any failed rule other than the review rule; a PR's scan covers only
its changed lines, so read main for all open alerts; a false
positive is dismissed only with the owner's yes.

Why: on 2026-11-08 #943, #937 and #944 merged past the code-scanning
rule because they were opened before the CodeQL workflow (#945).
CodeQL scans of main afterwards found no new alert. --admin does not
say which rules it bypasses, and the script did not check code
scanning.

New integrator rule: an integrator talks with many sessions and with
the owner, so its main session must stay free. Implementation work
goes to subagents, and the main session only coordinates. The owner
asked for this.

Behavior change: none. Release scripts and docs only.
Data dependence: none. The script reads GitHub check runs only.

Reviews: 2 offload reviews (GLM), round 3 (owner granted round 3), both approve at df9d719.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid pushed a commit that referenced this pull request Nov 9, 2026
…te (#970)

Bob bills a 1-hour cache write at the input rate. On a real Bob
account (2026-11-04), Bob's own credits matched that rate on 20
calls. The example price list now says so, with the per-entry
key from #937.

Behavior change: operators who install
deploy/service/prices.example.yaml and see Bob traffic. Old: a Bob
1-hour write cost 2.0x the input rate. New: the 6 Bob tier rows
set cache_write_1h_frac: 1.0, so a 1-hour write costs the input
rate. The KV-cache simulator now picks write_1h for long holds,
and the sticky break-even is 0. The harbor cost model
(deploy/harbor) reads the key too, so its Bob rate matches Go. To
turn it off, remove cache_write_1h_frac: 1.0 from those rows in
your copy of the file.
Owner's yes, 2026-11-09, in the integrator session: "all bob changes are approved, since this is effectively our first release we will start to have bob users".

Data dependence: none. A price list holds rates, not data.

Reviews: 2 offload reviews (claude backend), round 2, both approve at 5f68125.

Signed-off-by: Vitaly Zabershinsky <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants