Repository navigation
fix(dash): Count fallback requests and keep them out of the saving share - #1173
Conversation
A request the accountant library cannot price books its cost and no saving. The Overview share counted that cost, so each fallback lowered the share although no saving changed (#1004, B8 of the #768 review). - Store the fallback reason in requests.acc_fallback. The proxy sets it on the requests it logs as acc_fallback. A bypassed request stores none: its $0 is a measured $0. - Back-fill older rows once from their priced_by 'none' components. - Add fallback_requests, fallback and fallback_cost_usd to Overview. - The hero share leaves the fallback cost out, and says how many requests and dollars it leaves out. Fixes #1004 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
boazdavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @boazdavid) | Claude Code 2.1.241, opus | offload-review skill, @boazdavid's session | fresh | 2 of 2 | 1 of 2 | 983fe23ec724 |
blocking |
Verdict: blocking
Findings
-
dash/ui/savings.js:480-482 — The share takes the fallback rows' cost out of "without", but keeps their savings in "saved".
- What fails: A fallback row does not always book "no saving". Three savings stay on it. The share then rises, and it can reach 100%.
- The declaration filter credit (
decl_filter_usd) counts a fallback row on purpose.declFilterInBaseline(dash/toolsuggest.go:204) is 0 for a row withpriced_by = 'none'. So the measured credit adds the USD of that row. - Tool deferral (
defer_net_usd) keeps the ledger's net on a fallback row.accOverridereturns before line 430 of dash/accountant_price.go. So the net from proxy/dashcapture.go:696 stays. - Compaction (
net_saved_usd = baseline - cost - cg_llm, dash/savings.go:87) is-cg_llm_cost_usdon a fallback row. Butfallback_cost_usdalso takescg_llm_cost_usdout of the spend. So our own model cost leaves the denominator and stays in the numerator.
- The declaration filter credit (
- Proof:
overviewTotalswith 10 fallback requests at $1.00 each and a $0.20 filter credit each. The input is{cost_usd: 10, decl_filter_usd: 2, fallback_requests: 10, fallback_cost_usd: 10}.- Old: saved 2, spent 10, without 12, 16.7%.
- New: saved 2,
pricedSpent0, without 2, 100%. The hero says "You spent $0.00 instead." - Add 10 priced rows at $1.00 with no saving. Priced alone gives 0%. With the fallback rows the share is 2 / 12 = 16.7%, so the fallback rows now raise the share.
- This hits the wires that #899 names as the main source of fallbacks (
unsupported_wire), when the filter or deferral acts there. - #1004 proposed to leave fallback rows out of "both the numerator and the denominator". The PR does only the denominator.
TestFallbackRequestsLeaveTheSavingShareAloneuses rows with no filter credit, no deferral and nocg_llmcost. So it does not see this.
- Fix: Choose one of these:
- Let the server also return the savings of the fallback rows: their
defer_net_usd, their filter credit, and-cg_llm_cost_usd. Take that sum out of the share's numerator too. - Or put only
cost_usdinfallback_cost_usd, and keep the share unchanged for a row that carries any other saving. - Add a Go test with a fallback row that has
filtered_decl_tokens > 0,defer_net_usd > 0andcg_llm_cost_usd > 0.
- Let the server also return the savings of the fallback rows: their
- What fails: A fallback row does not always book "no saving". Three savings stay on it. The share then rises, and it can reach 100%.
-
dash/ui/app.js:1576 — The Overview hero paints first from the lean read. The lean read has no fallback fields.
- What fails:
loadOverviewcallsrenderSavedLedger(lean, …, true)before the full read lands.overviewLean(dash/overview_lean.go) does not setfallback_requestsorfallback_cost_usd. So the first paint shows the old share and the whole bill in "You spent …". The full read then changes "without", the percent and "You spent". A user who reads the first paint gets a different share. - Proof: app.js:1566-1576 renders the lean body.
overviewTotalsreadso.fallback_cost_usd || 0, which is 0 on lean. The PR's open question says that only the status line reads lean. That is not correct: the Overview hero reads it too. - Fix: Add
SUM(CASE WHEN r.acc_fallback <> '' …)for the count and the cost toleanWindowMainQuery. It is the same scan. Or do not draw the share and "You spent" whilepartialis true. Correct the open question and the line in docs/dashboard.md.
- What fails:
Non-blocking
- dash/schema.go:381 — The backfill marks old rows
unrecordedwhen any component haspriced_by = 'none'.PriceModealso marks ano_resultrow so whenaccReqis nil (for example the record panicked, proxy/accountant_wire.go:93). A new row of that kind stores''. So old and new rows of one kind count differently. This is small, but the docs could say it. - docs/dashboard.md:507-509 — The backfill also cannot find a row that fell back in the first
priceCostbranch (no price, or usage not complete). That branch returns before it marks the components. The doc names only the case "no component row". - dash/schema.go:381 — The one-time backfill scans
request_componentsin full, with no index onpriced_by, at open. On a large database this may slow the first start. It runs one time only. RecordAccountantFallbackkeeps the record of a request that had no price at write time and that the reprice pass (dash/reprice.go) prices later. That is consistent, because the reprice books no saving.
What I checked
- I read the full diff (16 files) and the PR body.
- I read
PriceMode,accOverride,priceCost,Priceand the deferral part of the override in dash/accountant_price.go and dash/event.go. - I read the call site in proxy/dashcapture.go:860-880,
noResultWhy,accDropandaccRun. - I read the main Overview aggregate,
savingsArithmetic,savedParts,overviewTotals,declFilterInBaseline,DeclFilterSavingsandOverviewLean. - I read the Overview's two-step load in dash/ui/app.js:1555-1600 and the hero at 1704-1800.
- Insert and scan: one new column, one new placeholder and one new argument in
insertBatch.requestColsandscanRequestmatch. Only dash/query.go, dash/store.go and dash/acctokens.go write or readrequestsrows. Only the proxy callsPriceMode. - Migration:
addColumnsruns before the backfill on both paths ofmigrate. A fresh database creates the column inddl. Themetakey stops a second run. - The new Overview query uses the same
condandargsas the main aggregate, so the ping rows stay out on both. - Data dependence: the row file and the generated page have the same new text. There is no change of Kind or of a level.
- Fail open: the change adds no new error path on the request path.
RecordAccountantFallbackonly copies a string. - The PR names the behavior change at the top, as CLAUDE.md requires.
- I did not run Go or node tests. Live tests are not approved, and Go is not installed.
boazdavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @boazdavid) | Claude Code 2.1.241, opus | offload-review skill, @boazdavid's session | fresh | 1 of 2 | 1 of 2 | 983fe23ec724 |
blocking |
Verdict: blocking
Findings
- dash/ui/savings.js:480 — the share takes the fallback rows out of the denominator only. Their savings stay in the numerator.
- What fails: the PR says the decision is "exclude both sides", and the test says the result is "the priced requests' share". That holds only when a fallback row books exactly $0 of saving and has
cg_llm_cost_usd = 0. A fallback row can book three things inp.total:- Tool deferral's ledger net.
proxy/dashcapture.go:696setsDeferNetUSD = d.netbeforePriceMode. On a fallback,accOverridereturns beforedash/accountant_price.go:433, which is the only line that replaces the ledger net.deferNetSum(dash/overview.go:702) then sums it for every row incond, fallback rows included. - The tool filter's measured credit.
declFilterInBaseline(dash/toolsuggest.go:204) is true only when thetoolfiltercomponent haspriced_by = 'accountant'. A fallback row haspriced_by = 'none', so itsfiltered_decl_tokensgo intodecl_filter_usd, thefilterpart. - Minus its own model-call cost.
savingsArithmetic(dash/savings.go:87) givesnet = baseline - cost - cgllm. A fallback row hasbaseline = cost, so it adds-cg_llm_cost_usdtonet_saved_usd. Butfallback_cost_usd(dash/overview.go:270) also takes thatcg_llm_cost_usdout of the spend. So that cost leaves the denominator and stays in the numerator.
- Tool deferral's ledger net.
- Proof (arithmetic, same formula as
overviewTotals):- Priced rows: cost $9, baseline $10, no model calls. Priced-only share = 1 / 10 = 10%.
- Add 1 fallback row with cost $1 and
cg_llm_cost_usd$0.50. Overview:cost_usd10,cg_llm_cost_usd0.5,net_saved_usd= 11 − 10 − 0.5 = 0.5,fallback_cost_usd1.5. New share = 0.5 / (10.5 − 1.5 + 0.5) = 5.3%. The old share was 4.5%. The fallback row still lowers the share. - Add instead 1 fallback row with cost $1 and a ledger defer net of $0.40. New share = 1.4 / (9 + 1.4) = 13.5%. The fallback row now raises the share above the priced share.
- The same holds for the filter credit. A common source: every request in the first seconds after start, before the price map loads.
priceCostfails,PriceModereturnsFallbackUnpricedatdash/accountant_price.go:293, and the row keeps its ledger defer net and its filter tokens.
- The test does not see it:
fbEvent(dash/fallback_share_test.go:67) has onemaskcomponent, no deferral, no filtered declarations andCGLLMCostUSD = 0. - Fix: take the fallback rows out of both sides. Option: the fallback query also sums the fallback rows' booked saving (
baseline_cost_usd - cost_usd - cg_llm_cost_usdplus the defer net column), and the filter credit scan reports the fallback rows' part. The UI then takes that saving offp.totalfor the share. Simpler option: take onlycost_usd(notcg_llm_cost_usd) out of the spend, and leave out of the share the defer net and filter credit of fallback rows. Add a test with a fallback row that hasCGLLMCostUSD > 0, a deferral ledger net andFilteredDeclTokens > 0, and check that the share equals the priced-only share.
- What fails: the PR says the decision is "exclude both sides", and the test says the result is "the priced requests' share". That holds only when a fallback row books exactly $0 of saving and has
Non-blocking
dash/schema.go:381— the backfill rule is wider than the live rule.PriceModemarks componentspriced_by = 'none'on every fallback, also whenc.accReq == nil. Live code stores no reason then (proxy/dashcapture.go:873). Example: a panic before forward callscp.accDrop()(proxy/proxy.go:1465) after some components ran. The backfill marks such an old rowunrecorded; a new row of the same kind stays''. The case is rare. The doc text indocs/dashboard.mdcould say so.dash/schema.go:381-386— theUPDATEand themetainsert are two statements, not one transaction. If the process stops between them, the next open runs theUPDATEagain over rows the new code wrote with''. Same class of rows as the point above. A transaction removes it.proxy/dashcapture.go:844— a rejected request (rejected_status) getsno_resultand is now counted under "could not be priced". The text under the hero then counts 4xx/5xx requests as unpriced. Its cost is probably $0, so the share does not move, but the count can confuse a reader.dash/ui/app.js:1714-1716— the token figure ("Input tokens removed … of …") still includes the fallback rows. The dollar share and the token share now use different row sets. Consider a word about it in the info text.dash/overview.go:238— the comment says "the agent-only rows the main aggregate reads".condexcludes pings; it has no agent filter. "the non-ping rows" is more exact.
What I checked
- Read the full diff (16 files, 1 commit) and the commit message. Read the PR body and issue #1004.
PriceMode,accOverrideandpriceCost: which fallback paths mark componentspriced_by = 'none', and which leaveDeferNetUSD,KeepAliveSavedUSDandCachesplitSavedUSDset. Keep-alive and split are 0 on a fallback; the defer ledger net is not.proxy/dashcapture.gofinish:RecordAccountantFallbackis called only whenaccReq != nil || accUnsupportedWire, the same gate aslogFallback. The bypass case stores''.cg_llm_cost_usdis set after it, but the SQL reads it from the row, so that is fine.Filter.where: the fallback query and the main aggregate use the samecond, sofallback_cost_usdis a subset ofcost_usd + cg_llm_cost_usd.pricedSpentcannot go below 0.reprice.go: a row priced late keepsacc_fallback = 'unpriced'and books no saving. Its later cost is infallback_cost_usd. Consistent.- Store and read: the new column is in
insertBatch(placeholder count +1),requestColsandscanRequest, in the same order.additiveColumnsadds it before the backfill runs on bothmigratepaths. declFilterInBaselineanddeferNetSum, to trace finding 1.- Data dependence:
docs/data-dependence/features/dashboard-database.mdand the generated row indocs/data-dependence.mdhave the same new text. The level cells and the Kind did not change. Metadata only (a fixed code). - Behavior change: the PR names it at the top (who, old, new, how to turn off, decided by). Finding 1 means the code does not yet do the decided option ("exclude both sides").
- Fail open: the change is read-side and dashboard-only. No request path changes. A failed fallback query fails the Overview read, like the other errgroup queries.
- I did not run Go or Node tests. Live tests are not approved for this review.
Review of #1173 (both reviewers): a fallback row is not always a $0 saving. It keeps the deferral ledger's net and the measured filter credit, and its own model calls make its compaction net negative. The share took the fallback cost out of the denominator only, so these moved it either way, up to 100%. - The reads return fallback_saved, the fallback rows' saving by part. The filter part comes from DeclFilterSavings. - overviewTotals takes each part's fallback share off that part, and the fallback cost off the spend. The hero and the cards describe the priced requests only. The fallback line names the spend and the saving left out. - The lean read, which paints the hero first, carries the same fields. - The backfill and its meta mark are one transaction. - Update the stats goldens for the new fields. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
Replies to round 1 (both reviewers)Fixed in 6122e43. Reviewer 1, finding 1, and reviewer 2, finding 1: the fallback saving stayed in the numerator. Fixed.
Reviewer 2, finding 2: the lean first paint has no fallback fields. Fixed. Non-blocking
Also: the |
boazdavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @boazdavid) | Claude Code 2.1.241, opus | offload-review skill, @boazdavid's session | resumed | 1 of 2 | 2 of 2 | 6122e43349ca |
approve |
Verdict: approve
Findings
None.
Status of the round-1 findings
- Reviewer 1, finding 1 (the fallback saving stayed in the numerator): fixed.
fallbackTerms(dash/fallback.go:49) sums the cost and 4 saving parts of the fallback rows. The formulas are the same as the main aggregate:baseline - cost - cg_llm,deferNetCol,kaSavedSince("r.", since)andcachesplit_saved_usd.DeclFilterSavingsgives the filter part from the same row loop asUSD, so it is always a subset ofdecl_filter_usd.SetDeclCreditsets it, and/api/stats(dash/api.go:1484,1539) calls both.overviewTotalstakes each fallback part off its own part andfallback_cost_usdoff the bill. I checked the newsavings.test.mjscase by hand: compaction 28 + 2 = 30, defer 3 − 3 = 0, filter 1 − 1 = 0, spend 92 − 22 = 70, without 100, share 30%. All are correct.- My round-1 examples now give the priced-only share. The $0.50 model-call example: compaction 0.5 − (−0.5) = 1, spend 9, share 10%. The $0.40 deferral example: defer 0.4 − 0.4 = 0, share 10%.
- The ledgers that run after
Overviewdo not add fallback saving back. The replay cap joins only components withsaved_usd <> 0(dash/replaycap.go:455-457), andrePriceRowskipsStoredUSD == 0. A fallback component hassaved_usd = 0. TestFallbackSavingIsLeftOutToocovers model-call cost, a deferral ledger net and filtered declarations, as I asked.
- Reviewer 2, finding 1 (same defect): fixed, for the same reasons. Reviewer 2's case now gives
without0 and 0%. It is insavings.test.mjs. - Reviewer 2, finding 2 (the lean first paint had no fallback fields): fixed.
leanWindowMainQueryaddsfallbackTerms(agent + " AND r.acc_fallback <> ''", f.Since)in the same scan. Theagentguard keeps the ping rows out, like the full read'scond. The lean read sets nodecl_filter_usd, so the filter part is 0 on both sides of the lean hero. The new test compares lean with full. - Round-1 non-blocking points:
- Backfill not in one transaction: fixed (
dash/schema.go:982-994). - Backfill wider or narrower than the live rule: the author kept it and documented it in the code comment and
docs/dashboard.md. I accept this. The cases are rare. - Full scan at open,
rejected_statuscounted, the token figure: kept with reasons. I accept them. The info text now says the token figures count every request. - "agent-only" comment: fixed.
- Backfill not in one transaction: fixed (
Non-blocking
dash/ui/app.js:1760-1762—t.unpriced.savedcan be negative. A fallback row with model calls and no other saving gives compaction-cg_llm. The line then reads "… spent, -$0.02 saved." A word such as "net" or a cost label would read better.dash/ui/savings.js:512-513— when every request in the window falls back (for example, a user on the Responses wire only), the hero reads "$0.00 saved, out of $0.00", "0% saved" and "You spent $0.00 instead." The fallback line under it explains this, but the hero could say "nothing priced" instead of three zeros.dash/ui/savings.js:22—savedPartsstill addscachesplit_historical.usdtoreorder, and the fallback split does not cover it. That credit is for rows from before the split's instrumentation, so it probably does not meet theacc_fallbackrows. I note it only for completeness.
What I checked
- Last review: round 1,
983fe23ec72491cccad34dace55ad27f61c86021, 2026-11-16T16:26:09Z - New commits read: 1 (
6122e433fix(dash): Leave fallback requests out on both sides of the share) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Comment by boazdavid at 2026-11-16T16:39:19Z (replies to round 1): I checked each reply against the code. See "Status of the round-1 findings".
- Reviewer 2's round-1 review (16:25:54Z, before mine): I read it for the first time in this round. Its 2 findings and 4 non-blocking points are in the status list above.
- The PR body: the behavior-change note now describes both sides and the new "Turn off" step. The lean open question is corrected.
- Read the full diff
983fe23e..6122e433(14 files), including the 3 golden files, and the code around each change:OverviewLean,leanWindowMainQuery,Overview's main aggregate (kaSavedSinceat line 689),SetDeclCredit,DeclFilterSavingsandDeclFilterSavingsByTenant(unchanged query, return value ignored, no scan mismatch),accumulateDeclFilterRow(the dollars it returns equal what it adds toUSD),ApplyReplayLedger,ApplySummarizeLedger, and the hero cards inrenderSavedLedger(they readt.parts). - Scan order:
fallbackAgg.dest()has 6 targets for the 6fallbackTermscolumns. The full read addsacc_fallbackin front. The lean read appends them last, aftertok.dest(), which matches the SQL order. fallbackis nowomitempty. The UI does not read it. The goldens carry the new fields.- Data dependence: no new column in this commit. The new fields are sums of existing columns. The row file and the generated page are unchanged and still match.
- Fail open: the change is read-side and dashboard-only. It has no request-path code.
- I did not run Go or Node tests. Live tests are not approved for this review.
boazdavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @boazdavid) | Claude Code 2.1.241, opus | offload-review skill, @boazdavid's session | resumed | 2 of 2 | 2 of 2 | 6122e43349ca |
approve |
Verdict: approve
Findings
None.
Status of the round-1 findings
- Reviewer 2, finding 1 (the fallback saving stayed in the numerator): fixed.
fallbackTerms(dash/fallback.go:49) sums 6 terms over the fallback rows: the count,cost_usd + cg_llm_cost_usd,baseline - cost - cg_llm,defer_net_usd,kaSavedSinceandcachesplit_saved_usd. These are the same expressions thatsavingsArithmeticand the main aggregate use. So each part comes off with its own formula.DeclFilterSavingsnow splits the filter credit byacc_fallback <> ''.SetDeclCreditputs that part infallback_saved.filter_usd.overviewTotalstakes each part's fallback share off that part, and takes the fallback cost off the spend. My round-1 case (cost_usd 10, decl_filter_usd 2, 10 fallback rows) now giveswithout0 and 0%. That case is in dash/savings.test.mjs.TestFallbackSavingIsLeftOutToouses fallback rows withCGLLMCostUSD, a deferral ledger net andFilteredDeclTokens. It checks that the share is equal to the priced-only share.- The hero cards (cache, preset, filter, deferral) read
t.parts, so they also show the priced requests only. I checked dash/ui/app.js:1795-1900.
- Reviewer 2, finding 2 (the lean first paint has no fallback fields): fixed.
leanWindowMainQueryaddsfallbackTerms(agent+" AND r.acc_fallback <> ''", f.Since)in the same scan. TheScanorder matches the SQL order:accTokenLeanTerms, then the 6 fallback terms. The lean read leaves out the filter part. That is correct for the hero, because the lean read does not setdecl_filter_usd, sosavedPartsalready shows a filter part of 0 there. The PR's open question is corrected. - Reviewer 1, finding 1: this is the same defect as my finding 1. It is fixed by the same change.
- Non-blocking points from both reviewers:
- Backfill wider than the live rule, and blind to the
priceCostbranch: kept. Both are now described in thebackfillAccFallbackcomment and in docs/dashboard.md. I accept this, because the cases are rare and the old rows age out. - Backfill not in one transaction (reviewer 1): fixed (dash/schema.go:982-994).
- The full scan at open: kept. I accept this, because it runs one time only.
- Rejected 4xx/5xx counted as
no_result(reviewer 1): kept. I accept the reason: their cost is normally $0, andfallbackgives the count by reason. - The token figure counts every request (reviewer 1): kept, and now said in the info text and the docs.
- The "agent-only" comment: fixed to "non-ping rows".
- Backfill wider than the live rule, and blind to the
Non-blocking
- dash/cachehistory.go — The historical reorder credit (
cachesplit_historical.usd, which is inparts.reorder) is not split byacc_fallback. A session's first request can be a fallback row and still get this credit. Then that saving stays in the numerator while its cost leaves the denominator. The case is small: it needs a session-first row withsplit_stable_tokens = 0, a model with one constant stable half, and a large cache read. This is old code, not a defect of this PR. - OverviewLean — With a price function,
total_saved_usdon the lean read includes the fallback rows' filter credit, butfallback_saved.filter_usdis 0. The hero does not usetotal_saved_usd, so nothing on the page is wrong. A different API client that computes the share fromtotal_saved_usdminusfallback_savedwould get a small error. - docs/data-dependence/features/dashboard-database.md — The row says that the Overview "leaves their cost out of the saving share". It now leaves out their saving too. The data level does not change, so this is only a text update.
- The behavior-change block at the top of the PR now names the wider change (the hero total and the part cards drop the fallback saving). It still needs the human "yes" before merge, as CLAUDE.md requires.
What I checked
- Last review: round 1, 983fe23, 2026-11-16T16:25:54Z
- New commits read: 1 (
6122e433fix(dash): Leave fallback requests out on both sides of the share) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-1 review (16:26:09Z): I checked its finding 1 (the same as my finding 1) and its 5 non-blocking points against the new commit. See the status list above.
- The author's reply comment (16:39:19Z): I checked each reply against the code. All fixes are in the diff. I accept the "kept" reasons.
- The updated PR body: the behavior-change block, item 3 and item 4, and the open question.
- I read the whole diff
983fe23e..6122e433(14 files), and the code around it:fallbackTerms,fallbackAgg.dest/add/applyagainst the SQL column order, in both the full read and the lean read.kaSavedSince,deferNetColandsavingsArithmetic, to check that each fallback part uses the same expression as its part.DeclFilterSavings,declFilterSavingsQueryand both callers ofaccumulateDeclFilterRow.DeclFilterSavingsByTenantignores the new return value and keeps its own SELECT, so it is not changed.SetDeclCredit: it runs afterfallback.apply, andapplykeeps the filter part.ApplyReplayLedgerand the replay cap: its join needsc.saved_usd <> 0, and a fallback row's components havesaved_usd = 0, so the cap does not touch fallback rows.- The API lean branch (dash/api.go:1411-1434) and
renderSavedLedger, including the hero, the fallback line, and the cards. - The golden files: the
fallbackmap hasomitempty, so an empty map is left out, as the goldens show. - The backfill transaction, and its call on both
migratepaths.
- Data dependence: the new commit does not change the row file or the generated page. The new fields are numbers only.
- Fail open: the change is on the read side and in the dashboard only. No request path changes.
- I did not run Go or node tests. Live tests are not approved, and Go is not installed.
|
Behavior change approved by @boazdavid (human developer), 2026-11-16, as Approved change: the Overview hero and its part cards leave out the requests the accountant library could not price, both their spend and the saving they still book. A line under the total names the requests, spend and saving left out. Cost totals on other pages, and the token figures, are unchanged. |
…dropped (#1139) When the pipeline's operations are dropped (the accountant's ops_dropped path), apply still reports the tail mark's operation, so the accountant can price it. Behavior change: readers of the central llm.savings.* metrics, for requests with dropped operations and a tail mark. Old: 0 operations, llm.savings.requests{result="skipped"} and a +1 on llm.savings.check_failures{check="sum"}. New: the mark's operation is booked under component="tailbreakpoint" in llm.savings.saved.tokens and llm.savings.added.tokens (and the .usd counters on api billing), with result="priced"; the sum failure is not counted when the mark was the only operation. The thread state that computeSafe keeps also gets the mark's ChangeID, which can change the next request's figure on the thread. Owner's yes, 2026-11-16, in the integrator session: "yes" (to the behavior changes of #1150, #1173, #1165, #1139, #1172 and #1140). Data dependence: none (sizes and a hash of the message, as before). Reviews: 2 offload review rounds (Claude backend). Round 2: both approve at da52ebd, which is the PR head. Signed-off-by: DAVID BOAZ <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
The accountant library now prices the OpenAI Responses wire (/openai/v1/responses). The proxy builds the accountant's view of a Responses body the same way as for the other two wires: a hash and a size per part, no text kept. Behavior change: accounts on /openai/v1/responses. Old: every request on that wire booked $0 saving, with fallback unsupported_wire. New: a request that sends its full history is priced as on the other two wires. A request that leaves part of its prompt on the provider's side (previous_response_id) still books $0, now with fallback server_held_history. Owner's yes, 2026-11-16, in the integrator session: "yes" (to the behavior changes of #1150, #1173, #1165, #1139, #1172 and #1140). Data dependence: unchanged (metadata only). The accountant-savings row says so. Reviews: 2 offload review rounds (Claude backend). Round 2: both approve at ea37791, which is the PR head. After it, main changed only docs/dashboard.md among its files (#1151); the merge is clean. Signed-off-by: DAVID BOAZ <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
The proxy reports the first request after a client compaction, from the thread tracker (#947), and the replay cap uses that mark to close an epoch. Behavior change: dashboard users, through the replay-cap savings figures. Old: the replay cap guessed a client compaction from a drop in tokens_before after the agent's compaction request. New: on rows written from now on, an epoch closes only where the thread tracker marked the first request after a compaction; a header subagent or a tool-less helper thread can no longer close an epoch (#585). Rows written before keep the old rule. Turn off: no switch. Owner's yes, 2026-11-16, in the integrator session: "yes" (to the behavior changes of #1150, #1173, #1165, #1139, #1172 and #1140). Data dependence: metadata only, unchanged in kind: one short label per request (unknown or empty), no text. The Thread tracker row is updated. Reviews: 2 offload review rounds (Claude backend). Round 2: both approve at be71e02, which is the PR head. CI passed on a fresh merge with main after #1150 (the eval box was down; owner: merge on CI and reviews until it is back). Signed-off-by: DAVID BOAZ <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
On a local proxy, the Overview's Preset card names the preset the proxy runs now, with a note while the window's history says something else. After a switch from off to ultrahigh, the card still said "Preset (off)", because 96% of the window's requests (2,898 of 3,016) ran under off. Behavior change (asked for by a developer): local proxy users of the Overview. Old: the card named the preset most requests in the window ran under. New: it names the running preset (from /api/whoami). A hosted account keeps the old card. Owner's yes, 2026-11-16, in the integrator session: "yes" (to the behavior changes of #1150, #1173, #1165, #1139, #1172 and #1140). Data dependence: none changed. Reviews: 3 offload review rounds (Claude backend). Round 3: both approve at 0fbbe2c, which is the PR head and the integrator's merge of main that moved the change into the split dashboard files (#1151): presetName() and loadOverviewIdentity() into dash/ui/tabs/overview.js, the account.preset lines in dash/ui/app.js, and presetLabel in dash/ui/savings.js with a forTests entry. CI ran the Go checks (the eval box was down; owner: merge on CI and reviews until it is back). Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
…tartup (#1172) The reprice pass (#1002) also prices a row's compaction call. A row written in the first seconds after a start, before the price map loads, for a request that also made compaction calls, stayed partial at $0 for good: neither cost_usd nor cg_llm_cost_usd was priced. Behavior change: those dashboard rows. Old: partial at $0 for good. New: once the map loads, the reprice pass prices both halves, marks the row complete, and adds both halves to tenant_spend. Turn it off: no separate switch; Options.Prices = nil turns off the whole reprice pass, as before. Owner's yes, 2026-11-16, in the integrator session: "yes" (to the behavior changes of #1150, #1173, #1165, #1139, #1172 and #1140). Data dependence: unchanged (metadata only). Row: docs/data-dependence/features/dashboard-database.md. Reviews: 2 offload review rounds (Claude backend). Round 2: both approve at df9c251, which is the PR head. CI passed on a fresh merge with main after #1150 and #1165 (the eval box was down; owner: merge on CI and reviews until it is back). Signed-off-by: DAVID BOAZ <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Port the share UI to the split dashboard files and keep both sides of the event, query, schema and store changes. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 3 of 3 | 9c13135ffaea |
blocking |
Verdict: blocking
Findings
-
dash/store.go:603 — the merge lost the PR's extra
?. Therequestsinsert has 3 trailing columns and only 2 placeholders.- What fails: every
insertBatchcall. SQLite rejects the statement attx.Prepare("N values for N+1 columns"). The dashboard then stores no request rows at all. Every page and every test that writes an event fails. - Proof:
- Line 599 ends with
..., backend, client_compaction, acc_fallback: 3 columns after the token columns. - Line 603 ends with
placeholders(len(requestStoredTokenColumns())) +,?,?)``: 2 placeholders. - The args (line ~629) pass 3 values:
backendOf(e.Backend), clientCompactionArg(e), e.AccFallback. - Before the trailing part, the counts match: 107 named columns (with the 7 of
limitCols) and 107 literal?. - Cause: main (
43ce370c, #1165) changed this line from,?)to,?,?)forclient_compaction. The PR at6122e433changed it from,?)to,?,?)foracc_fallback. The merge kept main's line, so one?is missing. Comparegit diff a4d43d94 6122e433 -- dash/store.go(changes the placeholder line) withgit diff 43ce370c HEAD -- dash/store.go(does not). - CI did not catch it: on
9c13135fonly the DCO check ran. No Go build or test ran on this head.
- Line 599 ends with
- Fix:
,?,?,?)on line 603. Then run the Go CI (orgo test ./dash/...on the box) on the new head before merge.
- What fails: every
-
dash/schema.go:973-974 — the merge left two blank lines after
additiveColumns.gofmt -llists the file, somake lintfails.- What fails: the lint step (
Makefile:89,test -z "$(gofmt -l .)"). gofmt reduces a run of blank lines to one. - Proof: lines 972-975 are
}, empty, empty,// backfillAccFallback .... At6122e433there was one blank line. - Fix: delete one blank line.
- What fails: the lint step (
Non-blocking
- proxy/accountant_wire_test.go — #1150 deleted
TestResponsesWireBooksNoSavingAndSaysWhy, and with it this PR's check that a Responses fallback is also stored inAccFallback. The newTestResponsesServerHeldHistoryBooksNoSavingAndSaysWhy(proxy/accountant_responses_test.go:249) checks onlyAccountantFallback(). One lineif e.AccFallback != dash.FallbackServerHeldHistorythere keeps the coverage of thec.accServerHeldHistorygate inproxy/dashcapture.go. - The round-2 non-blocking points of both reviewers (negative
t.unpriced.saved, three zeros when every request falls back, the historical reorder credit, leantotal_saved_usd, the data-dependence row text) are unchanged by the merge. I keep them as non-blocking.
Status of earlier findings
- Reviewer 1, round 1, finding 1 (fallback saving in the numerator): fixed in
6122e433, and the merge kept the fix.fallbackTerms,overviewTotalsand the tests are the same as at6122e433. - Reviewer 2, round 1, finding 1: same, fixed and kept.
- Reviewer 2, round 1, finding 2 (lean first paint): fixed and kept.
dash/overview_lean.gohas the same diff as before. - Round 2: both reviewers approved with no findings.
What I checked
- Last review: round 2, 6122e43, 2026-11-16T16:41:56Z
- New commits read: 1 PR commit,
9c13135fMerge origin/main into fix/1004-fallback-share. It brings in from main:43ce370c(#1140),c5e1323a(#1165),a5a52d04(#1150),269b6676(#1151),41e3de8e(#1139),a7b975e0(#1143). I read their logs and stats; I reviewed only how the merge combined them with this PR. - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-2 review (16:42:31Z): approve, 4 non-blocking points. Still valid; see above.
- Comment by boazdavid (16:46:27Z): the human approval of the behavior change. It matches the behavior the head implements (hero and part cards leave out fallback spend and saving; a line names them). Also #1140's commit message records the owner's yes for #1173.
- The merge commit: see the findings.
- Method: I compared the PR's net diff before the merge (
a4d43d94..6122e433, 23 files) with the net diff after it (43ce370c..HEAD, 23 files), hunk by hunk. The differences:dash/ui/app.jshero changes moved todash/ui/tabs/overview.js(#1151). The text is the same.num,usdandoverviewTotalsare globals there.forTests.overviewTotalsis indash/ui/savings.js:60, andsavings.test.mjsuses it.dash/query.goselect and scan:r.client_compaction, r.acc_fallbackand&compVerdict, &e.AccFallback, in the same order. Correct.dash/store.gocolumns and args: 3 each. The placeholders: 2. Finding 1.dash/schema.go:acc_fallbackin the DDL and inadditiveColumnsafterclient_compaction. Backfill unchanged. Extra blank line: finding 2.dash/accountant_price.gocomment andproxy/dashcapture.gogate now nameserver_held_history/c.accServerHeldHistoryin place ofunsupported_wire. Correct after #1150:unsupported_wireno longer exists as a reason.docs/dashboard.md: the reason list namesserver_held_history. Correct.proxy/accountant_wire_test.go: the old Responses assertion is gone with its test; a priced-request assertion is kept. Non-blocking point above.
- Check runs on
9c13135f: DCO only. On6122e433all Go checks passed. - Data dependence: no change in the merge. The row file and the generated page still match.
- Fail open: the merge adds no request-path code. Finding 1 breaks the dashboard writes, not the forwarded request.
- I did not run Go or Node tests. Live tests are not approved, and Go is not installed.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 3 of 3 | 9c13135ffaea |
blocking |
Verdict: blocking
Findings
-
dash/store.go:603 — The merge lost the placeholder for
acc_fallback. Every row insert now fails.- What fails:
insertBatchnames 1 more column than it has?placeholders. SQLite rejects the INSERT ("N values for N+1 columns"). So the dashboard stores no request rows at all. Everydashtest that callsinsertBatchfails too. - Proof:
- Merge base
a4d43d94, line 603 ends,?)(1 placeholder after the token columns:backend). - The PR at
6122e433changed it to,?,?)(backend, acc_fallback). mainat43ce370c(#1165) changed it to,?,?)too (backend, client_compaction).- Both sides made the same text change. So git took it one time, with no conflict. HEAD line 603 still ends
,?,?). - HEAD line 599 lists 3 columns after the token columns:
backend, client_compaction, acc_fallback. HEAD line 683 passes 3 args:backendOf(e.Backend), clientCompactionArg(e), e.AccFallback. git diff 43ce370c..HEAD -- dash/store.goshows the column and the arg added, and no placeholder change.- CI did not catch it: the PR checks show only DCO.
- Merge base
- Fix: change line 603 to end
,?,?,?). Then rungo test ./dash/...on the box before the next push.
- What fails:
-
proxy/accountant_responses_test.go:249 — The merge dropped the only proxy test that a fallback request stores its reason.
- What fails: at
6122e433,TestResponsesWireBooksNoSavingAndSaysWhycheckede.AccFallback == unsupported_wire. #1150 replaced that test withTestResponsesServerHeldHistoryBooksNoSavingAndSaysWhy. The merge kept the new test and did not carry theAccFallbackcheck into it. Now no proxy test checks thatRecordAccountantFallback(proxy/dashcapture.go:882-883) stores a non-empty reason. The two proxy checks left (accountant_wire_test.go:194,accountant_fallbacks_test.go:238) check only that the column stays empty. If someone removes line 883, no test fails. - Proof:
grep -n AccFallback proxy/*_test.goat HEAD gives only lines 194 and 238, both!= ""checks. At6122e433,accountant_wire_test.go:294had the positive check. - Fix: add
if e.AccFallback != dash.FallbackServerHeldHistory { t.Errorf(...) }in the loop ofTestResponsesServerHeldHistoryBooksNoSavingAndSaysWhy.
- What fails: at
Non-blocking
- The other merge results are correct.
requestColsandscanRequestin dash/query.go putclient_compactionbeforeacc_fallbackin both lists. The schema DDL,additiveColumnsand bothmigratecalls of the backfill are in place. The comments and docs/dashboard.md now nameserver_held_historyin place ofunsupported_wire. The hero line moved from dash/ui/app.js to dash/ui/tabs/overview.js with no change.overviewTotalsis exported throughforTests, as #1151 needs.
Status of the earlier findings
- Reviewer 2, round 1, finding 1 (fallback saving in the numerator): fixed in
6122e433. The merge did not changedash/fallback.go's terms oroverviewTotals. - Reviewer 2, round 1, finding 2 (lean first paint): fixed in
6122e433. The merge did not changeleanWindowMainQuery's fallback terms. - Reviewer 1, round 1, finding 1: same defect as my finding 1, fixed.
- Round-2 non-blocking points (both reviewers): no new change. They stay non-blocking.
What I checked
- Last review: round 2,
6122e43349ca6e9198837985da0f1aaaf5f513e3, 2026-11-16T16:42:31Z - New commits read: 1 PR commit,
9c13135fMerge origin/main into fix/1004-fallback-share. It brings 6 main commits:43ce370c(#1140),c5e1323a(#1165),a5a52d04(#1150),269b6676(#1151),41e3de8e(#1139),a7b975e0(#1143). I did not review those main commits as PR code. - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Comment by boazdavid at 2026-11-16T16:46:27Z: human approval of the behavior change. I checked that it names the same change as the PR body: hero and part cards leave out the fallback requests, a line names them, other pages and token figures unchanged. The merge does not widen that change.
- Reviewer 1's round-2 review (16:41:56Z): read. Its 3 non-blocking points do not need action from this merge.
- The merge commit: see below.
- How I read the merge: I compared the PR's own diff before the merge (
a4d43d94..6122e433) with its diff after (43ce370c..HEAD), line by line. Every hunk that differs is in this review: dash/accountant_price.go and dash/fallback.go comments, dash/event.go context, dash/query.go, dash/schema.go, dash/store.go, the move to dash/ui/tabs/overview.js, dash/ui/savings.js, docs/dashboard.md, proxy/accountant_wire_test.go, proxy/dashcapture.go. I read the code around store.go:585-690, dashcapture.go:870-890 and accountant_responses_test.go:240-280. - I did not run Go or Node tests. Live tests are not approved, and Go is not installed.
…on test The merge of main into #1173 dropped one "?" from the requests insert (acc_fallback had a column and an arg but no placeholder), left two blank lines after additiveColumns, and lost the only proxy test that a fallback request stores its reason. This adds the "?", removes the blank line, and adds TestResponsesFallbackStoresItsReason (previous_response_id -> server_held_history). Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Round 3 findings fixed in cc633ec.
CI has not run these changes yet. No Go on the laptop. |
Keep both sides' sentences in the Dashboard database row: the acc_fallback sentence (#1004) and the compaction reprice sentence (#1033). Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 4 of 4 | dbb8f8007c5a |
approve |
Verdict: approve
Findings
None.
Status of the round-3 findings
- Reviewer 1, finding 1 (missing placeholder in
dash/store.go): fixed incc633eca. Line 603 now ends,?,?,?). That gives 3 placeholders for the 3 trailing columns (backend, client_compaction, acc_fallback) and the 3 trailing args. CIbuild-testpassed ondbb8f800, so the dash tests that write events ran. - Reviewer 2, finding 1: the same defect, fixed by the same change.
- Reviewer 1, finding 2 (gofmt blank line in
dash/schema.go): fixed. One blank line is left afteradditiveColumns. - Reviewer 2, finding 2 (the lost proxy test that a fallback stores its reason): fixed.
TestResponsesFallbackStoresItsReason(proxy/accountant_responses_test.go:282) sends 2 Responses requests withprevious_response_idand checkse.AccFallback == server_held_historyon every event. It fails ifRecordAccountantFallbackis removed fromproxy/dashcapture.go:883. It also fails on 0 events, so it cannot pass empty. This was my round-3 non-blocking point too.
Non-blocking
- docs/data-dependence/features/dashboard-database.md (and the generated row) — the example codes are "
unpriced,unsupported_wireand the like". #1150 removedunsupported_wireas a reason.server_held_historyis a correct example now. This is a text fix only. The data level does not change. - The round-2 non-blocking points of both reviewers stay as they were (negative
t.unpriced.saved, three zeros when every request falls back, the historical reorder credit, leantotal_saved_usd).
What I checked
- Last review: round 3, 9c13135, 2026-11-16T18:49:13Z
- New commits read: 2 PR commits
cc633ecafix(dash): restore the lost placeholder, gofmt, and the fallback-reason test (3 files)dbb8f800Merge origin/main into fix/1004-fallback-share. It brings in12fc5538(#1172) from main. I read its log and stat, and reviewed how the merge combined it with this PR.
- Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-3 review (18:49:14Z): 2 findings. Both fixed; see the status list.
- Comment by amiddavid (18:52:24Z): replies to round 3. I checked each one against
cc633eca. All 3 claims are true.
- The merge
dbb8f800(git show --cc):proxy/dashcapture.go:RecordAccountantFallback()stays in the fallback gate. Main's cost block moved intoe.PriceCG(...), after the gate. The order does not matter: the Overview readscg_llm_cost_usdfrom the stored row, not from the call.docs/data-dependence/features/dashboard-database.mdanddocs/data-dependence.md: both sentences kept (acc_fallbackfrom this PR, compaction reprice from #1033). The row file and the generated row have the same text.- #1172 and fallback rows: the reprice pass can now price
cg_llm_cost_usdon a row written before the price map loaded. That row keepsacc_fallback = 'unpriced'.fallbackTermsreads cost andcg_llmfrom the row, so the repriced amounts leave the spend and the saving together. The share stays the priced-only share.
- Net PR diff
12fc5538..HEAD: 24 files. It is the round-3 diff plus the 3 files ofcc633eca. No other change. - Check runs on
dbb8f800: build, build-test, purego, CodeQL, analyze, trivy, record and DCO all passed. - Data dependence: unchanged in kind. The text point is above.
- Fail open: no new request-path code. The new code is a placeholder, a blank line and a test.
- I did not run Go or Node tests. Live tests are not approved, and Go is not installed.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 4 of 4 | dbb8f8007c5a |
approve |
Verdict: approve
Findings
None.
Status of the earlier findings
- Reviewer 2, round 3, finding 1 (lost placeholder in
insertBatch): fixed incc633eca.dash/store.go:603now ends,?,?,?). Line 599 has 3 trailing columns (backend, client_compaction, acc_fallback), and line 683 passes 3 args. Reviewer 1's round-3 finding 1 is the same defect, also fixed. - Reviewer 2, round 3, finding 2 (lost stored-reason test): fixed in
cc633eca.TestResponsesFallbackStoresItsReason(proxy/accountant_responses_test.go:282) sends 2 Responses requests withprevious_response_id. It checkse.AccFallback == server_held_historyon each event.postNwaits for both rows (waitForRows, line 146), and the test fails if there are no events. So the test cannot pass with no check. Reviewer 1 had this as non-blocking; same fix. - Reviewer 1, round 3, finding 2 (two blank lines in dash/schema.go): fixed in
cc633eca. I checked: one blank line is left afteradditiveColumns. - Round 1 findings of both reviewers: still fixed. The new merge does not change
dash/fallback.go,overviewTotalsorleanWindowMainQuery.
Non-blocking
docs/data-dependence/features/dashboard-database.md:10(and the generated page) still usesunsupported_wireas an example code foracc_fallback. #1150 removed that code. A better example isserver_held_history. The row also says the Overview "leaves their cost out of the saving share". It now leaves out their saving too. These are text points only. The data level does not change.
What I checked
- Last review: round 3, 9c13135, 2026-11-16T18:49:14Z
- New commits read: 2 PR commits:
cc633ecafix(dash): restore the lost placeholder, gofmt, and the fallback-reason testdbb8f800Merge origin/main into fix/1004-fallback-share. It brings 1 main commit:12fc5538(#1172, reprice the compaction call). I reviewed only how the merge combined it with this PR.
- Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-3 review (18:49:13Z): 2 findings and 1 non-blocking point. I checked each one against
cc633eca. All are fixed (see above). - Comment by amiddavid at 18:52:24Z (replies to round 3): I checked each claim against the diff. The placeholder, the blank line and the new test are as the comment says.
- The
12fc5538commit message records the owner's yes for the behavior change of #1173, too. This matches boazdavid's approval comment at 16:46:27Z.
- Reviewer 1's round-3 review (18:49:13Z): 2 findings and 1 non-blocking point. I checked each one against
- How I read the second merge: I compared the PR's net diff before it (
43ce370c..cc633eca) with its net diff after it (12fc5538..HEAD). The only differences are:- The data-dependence row: the merge keeps both sentences, the
acc_fallbacksentence (#1004) and the compaction reprice sentence (#1033). The row file and the generated page have the same reason text. - One context line in
proxy/dashcapture.go(e.CGModel = cgModel, from #1172). TheRecordAccountantFallbackgate is not changed.
- The data-dependence row: the merge keeps both sentences, the
- #1172 and this PR: a repriced row keeps its
acc_fallbackcode. Its repricedcost_usdandcg_llm_cost_usdthen go intofallback_cost_usd, and its saving stays $0. So the share stays consistent. - CI on
dbb8f800(run 43933998335, head_sha checked): build-test, purego, record, trivy, build, analyze, CodeQL and DCO all pass. So the Go tests ran on this head. - Data dependence: no change in level or Kind. Fail open: no new request-path code.
- I did not run Go or Node tests. Live tests are not approved, and Go is not installed.
#1178) RELEASING.md, section 3 (Merge): merge each PR on its own green CI, then watch main. A PR merges when it has its 2 approvals and green CI at its head and git can merge it cleanly; its CI is not re-run only because another PR merged first. After each merge, watch main's CI and fix forward if it turns red. Exceptions: a merge of main that the integrator resolved by hand in code gets its CI first (#1173 lost a SQL placeholder that way), and main must be green at the tagged commit. A note names GitHub's merge queue as the automatic form. The "merge of main" item no longer says to wait for CI after every merge of main. Owner rule, 2026-11-16, in the integrator session: "what is the benefit of waiting for each to be green, and wasting wallclock instead of just merging one and then waiting to see if the other one remains green. if it isn't we fix it?" Behavior change: none (docs). Data dependence: none. Reviews: 1 offload review round (Bob backend, GLM did not answer): both approve at 3be6f72, which is the PR head. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Summary
Fixes #1004 (B8 of the #768 review). A fallback request no longer lowers the saving share, and Overview says how many requests fell back.
What changed
requests.acc_fallback. It holds the fallback reason (unpriced,unsupported_wire, and so on), or''.acc_fallback.no_record) stores none: it had nothing to price.size_unknown, because bypass leaves the size at 0. But the client asked for no context-guru, so its $0 is a measured $0. Counting it would raise the share for users who bypass often.priced_by = 'none'component are markedunrecorded. Ametakey stops a second run.fallback_requests,fallback(count by reason),fallback_cost_usd(cost_usd + cg_llm_cost_usdof those rows), andfallback_saved(their booked saving by part:compaction_usd,defer_usd,keepalive_usd,reorder_usd,filter_usd). The lean read carries all butfallbackandfilter_usd.Item 3 of #1004 (a regression test for the unpriced count) already exists on main:
TestAComponentWhoseRequestsAllFellBackIsUnpricedNotZero.Data dependence
Metadata only.
acc_fallbackis a fixed code, no text. It works the same at every storage level.docs/data-dependence/features/dashboard-database.mdis updated anddocs/data-dependence.mdregenerated. No change of data dependence for any feature.How it was tested
TestFallbackRequestsLeaveTheSavingShareAlone: the feat(accountant): Price proxy savings with the accountant library #768 repro. 10 priced plus 10 fallback requests now give the same share as the 10 priced alone. It was 93.75% against 88.24%.TestUnrecordedFallbackIsNotCounted,TestBypassedRequestIsNotAFallback,TestAccFallbackRoundTrips,TestBackfillAccFallbackMarksOldFallbackRows.TestBypassedRequestStoresNoFallback(through the real handler); the Responses wire test checks the storedunsupported_wire; a priced request stores none.node --test dash/*.test.mjs: 42 of 42 pass, with a newoverviewTotalscase.go test ./dash/ ./proxy/pass. Failing on unchanged main too, not from this PR:TestBobPluginPythonSuite(local Python 3.8), and 2proxyapppreflight tests.Open questions
Assisted-By: Claude (Anthropic AI) [email protected]