Repository navigation
feat(dash): tool deferral's dashboard, net-saving panel and save-more tools (#869) - #877
Conversation
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.317 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | a335fdda053e |
blocking |
Verdict: blocking
Findings
- context-guru-plugin/scripts/cg.py:1211 (same line in codex-marketplace/plugins/context-guru/scripts/cg.py) — the deferral report's headline cost sums rows the report itself calls unpriced
- What fails: an account whose window has a row with
carry_priced: falsegets a headline "Carrying all of them cost $X" that includes that row's partialcarry_usd, while the table printsn/afor the same row (line 1222). The total cannot be reconciled with the rows, and it presents a lower bound as an exact figure. - Proof: the golden pair ships the inconsistency.
save-more-tools.goldenprints the headline$16.93andn/afor thedatavizrow.save_more_tools.jsongivesdatavizcarry_usd: 0.31withcarry_priced: false, and 9.12 + 6.40 + 1.10 + 0 + 0.31 = 16.93. Dash documentsCarryPricedas "false when some request had no known rates", so the 0.31 covers only the priced part. The plugin's own rule is "missing is not zero" (money(), line 983), and the removal report printsn/aper item (line 1265) for the same state. - Fix: sum only rows with
carry_pricedtrue, and say so when rows were left out ("at least $X; n items had no price"), or printn/afor the headline when any row is unpriced.
- What fails: an account whose window has a row with
Non-blocking
dash/ui/tools.js(renderDeferNet): the tiles show dollars when only some requests are priced (priced = t.requests > t.unpriced_requests). A day with 9 priced and 1 unpriced request shows a net that covers 9 requests, with no note. The panel tracksunpriced_requestsfor exactly this; only the all-unpriced case is labeled. Same family as finding 1.dash/toolinventory.go(usedFrom): the last tool-using turn is found by a substring test on the raw message. A user message whose text contains the quoted string"tool_search_tool_result"(a tool that printed a transcript, say) is now taken for the turn, so that request records no uses. Under-count only, the next request with a real tool turn recovers, and the same looseness already existed for"tool_use". Acontent-block scan would close it.dash/savemoretools.go: rows past the 200-row limit lose their keep/unkeep options, and a keep-list entry whose tool no longer appears in the inventory gets no row and so nounkeepoption. A user cannot clean a stale keep entry from this report.dash/savemoretools.go: the report ignoresrep.DeferredState("unknown"). When a session's deferred list could not be read, a server Claude Code defers shows asloaded.dash/tooldeferpanel.go: thedefer_tokens > 0gate drops a request whose deferral changed only the names list (every deferred tool already loaded earlier in the thread), while the/statsledger books its list cost. The two figures the PR says match can diverge in that edge.codex-marketplace/.../skills/save-more/SKILL.md: the Codex copy got thetoolsargument line but not the "noApply it?line, ask nothing, run the printed line on a yes" guidance the Claude plugin copy got. A Codex agent that meets a keep request has no instruction for it.
What I checked
- Read the full diff (39 files) and the code around each change:
dash/savemoretools.go,tooldeferpanel.go,toolinventory.go,query.go,store.go,schema.go,toolapi.go,event.go,ui/tools.js;proxy/savemoretools.go,tooldefer.go,dashcapture.go,proxy.go;tooldefer/explain.go; bothcg.pycopies and all four skills; the docs and both data-dependence rows. - Traced the keep/unkeep/search/revert write path end to end:
adaptPrincipal→AdaptOffer(basis and option id must come from the caller's own fresh report) →adaptWrite→editDefer(mirrorseditRemoved,PipelineKnownpinned, own names refused twice) →adaptRevert(undoes only the last change of this kind). The local and hosted paths both work; the test covers the round trip. - Verified the store insert: 88 columns, 88 placeholders, the 7 new scan targets in the same order as
requestCols. - Verified
Filter.where()never returns an empty condition, so the panel'sWHERE ... AND r.defer_tokens > 0is well formed; pings stay excluded, as on every other panel. - Traced the
usedFromchange (search loads count as uses) against the writer's fingerprint skip: a ToolSearch result always arrives in the same resent transcript as its turn, so a load is counted exactly once; call-plus-load in one turn counts once; an older load is not recounted; a pastedtool_referencein user text is not counted. - Verified
wrongGuesses(distinct loads, deferred-only, first-time-only) and thatnoteDeferruns beforecp.finishon the same goroutine, with a nil-captureguard. - Verified the CLI routing:
save-more tools→ deferral,insights tools applyandcg.py tools→ the removal report,apply deferral/revert deferralreach the new routes, a stale basis re-renders the report. - Checked the two
cg.pycopies are identical, and thesave-more toolsbehavior change is named at the top of the PR with its data-dependence statement. - Fail open: no new code runs on the request path before the response; the report and apply paths return errors without touching the pipeline; deferral itself is unchanged.
- Live tests were not run (not approved). Test claims are taken from the PR description.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.317 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | a335fdda053e |
approve |
Verdict: approve
Findings
None blocking. I read every changed line and the code around each change. I could not
run tests (live tests are not approved), so all proofs below are line-level traces.
Non-blocking
-
tooldefer/explain.go:11-40 / dash/savemoretools.go:105 — a row can read
deferred_cgfor a toolDecidekeeps loaded.
Explainskips the 200-token floor (MinTokens, tooldefer/tooldefer.go:172) and the project
veto (ProjectUsed, tooldefer/tooldefer.go:174). So an MCP server whose tools sum under
200 tokens, or a tool the project used, shows "Context Guru defers it" while the proxy sends
it in full. The code comment says this is deliberate ("a 'yes' means 'the user rule holds'"),
but docs/plugin/save-more.md'sstatecolumn promises "its state under tool deferral" with
no caveat, and the reason string shown ("declared and not used in your last 3 sessions") is
true while the state label is not. Display only; no wrong action follows from it (keep and
search switches stay valid). Suggest one caveat sentence in the docs, or reuse the loaded
state with the history reason. -
dash/savemoretools.go:152-155 — one client-deferred MCP tool marks the whole server row
deferred_client.
deferredServer[t.Server]is set when ANY tool of the server is deferred. Claude Code defers
tools one by one, so a server with 1 of 5 tools deferred reads "Claude Code defers it" for
all of it. Direction is right, magnitude is overstated. -
dash/savemoretools.go:160-163 — the removed override for server rows is dead code.
state()already checksremoved[name]first (line 109), so the secondif removed[name]
after the call can never change anything. Harmless. -
dash/savemoretools.go:108-110 — a client-deferred tool also on the removal list reads "the proxy does not send it", which is false for it.
The removal filter removes onlytoolselements; a client-deferred tool lives in the
deferred listing, so the proxy keeps sending its name. Reachable only when a name was put on
the removal list before Claude Code started deferring it. Wrong reason text, no wrong action. -
context-guru-plugin/scripts/cg.py:1219-1221 — the card's "Carrying all of them cost $X" sums
carry_usdof rows the table itself printsn/a.
A row withcarry_priced: false(some request had no rates) shows "n/a" in the cost column,
but its partialcarry_usdstill lands in the card total. The headline can then quote
dollars the table calls unknown. The Go report flags this (CarryPriced); the card ignores it. -
dash/toolinventory.go:495-502 — the
deferredDeclsFromdoc comment is tangled by the insertion.
The new sentences about built-ins split the old "The shares are APPROXIMATE" sentence, and
the real doc line ("deferredDeclsFrom parses the lists in texts...") now reads as a
continuation of the shares paragraph. Comment only. -
Coverage gaps. The hosted (registry) apply path for
/api/save-more/tools/applyand the
200-row truncation inbuildSaveMoreToolshave no test; the local-proxy test covers keep,
search_on, refusal of an unoffered option, and revert.unkeepis built in tests but never
applied. All fail-safe paths (bad name, broken config) return errors rather than writing.
What I checked
- Every changed file, in full, plus the code around each change:
proxy/savemoretools.go,
proxy/tooldefer.go,proxy/dashcapture.go,proxy/proxy.go,dash/savemoretools.go,
dash/tooldeferpanel.go,dash/toolinventory.go,dash/event.go,dash/query.go,
dash/schema.go,dash/store.go,dash/toolapi.go,dash/ui/tools.js,
tooldefer/explain.go, both plugin copies ofcg.py, both SKILL.md sets, the docs, and
every new test and golden. - The two plugin copies of
cg.pyare byte-identical; the SKILL.md differences are the two
formats' own styles, and both carry the newtoolsguidance. ExplainagainstDecide(tooldefer/tooldefer.go:117-181): same history, same thresholds,
same server-unit keying (mcp__<server>__), same keep-list veto shapes. The name rewrite
(TrimSuffix(name,"__")+"__") resolves bothmcp__pwandmcp__pw__clickto the unit key.editDeferagainsteditRemoved(proxy/toolfilterctl.go:182): same parse/edit/write shape,
samewithComponent/PipelineKnownclaims, so a save never reorders or drops a stored
pipeline.docDefersand the running pipeline'sDefers()agree ondefer: auto.- The apply path: options come only from
OfferAdapt/AdaptOffer(basis-checked, TTL'd,
per-account),ownDeclis re-checked server-side, andRegistry.Updatevalidates the config
before storing (tenant/tenant.go:703), so a name toolfilter rejects fails with a 400 and no
write. Audit kindsave-more-toolsmatchesadaptRevert's prefix rule. usedFrom's newnextwindow: traced message orders for both search forms (server-side
result inside the turn; Claude Code'stool_referenceblocks in the following tool_result).
ThelastIdx/nextlogic picks the message right after the last matching turn and resets on
each new match; string content and pastedtool_referencetext are ignored (covered by
tests). The marker hijack (a user message quoting"tool_use"or
"tool_search_tool_result") is pre-existing behavior, only widened by one string.wrongGuesses: distinct-count and first-load logic traced against
tooldefer.Loaded(di.original);deferredis per-request, matching the documented meaning.deferLedgerordering inserve: it runs at proxy.go:1833, beforecp.finishat :1899, so
the defer facts reach the dashboard row.noteDeferhandles a nil capture (dashboard off).- The store round-trip: the INSERT's 88 columns match its 88 placeholders and the 88
Exec
args;requestColsandscanRequestappend the 7 new columns in the same order; the
additive-column migrations mirror the CREATE TABLE columns. - The panel SQL:
Filter.whereprefixes withr.,GROUP BYday bucket is UTC-aligned
(DayMsdivides the epoch),SUMcannot be NULL inside a group, anddefer_tokens > 0
excludes requests deferral did not change. Thedays: []empty case is golden-tested. - The golden endpoint fixture seeds inventories directly, so the new built-in deferred rows and
search-load uses cannot change the existingtools/insightsgoldens; the new
tool_defergolden is added. - Data dependence: all new stored fields are counts and prices; tool names only;
docs/data-dependence.md's dashboard row is updated in the same (metadata) direction. - The plugin routing:
save-more tools→ deferral,cg.py tools/insights tools→ the
removal report,apply tools X→ the removal apply;save-more tools apply Xis refused
with the exactapply deferralcommand. All four new goldens match the stubbed routes.
a335fdd to
b43100a
Compare
Claude Code sends the built-in tools it defers (Monitor, WebFetch, the Cron tools, ...) only as names in its "deferred tools" text block. The parser kept the mcp__ names and dropped the rest, so tool_declarations never held them and the history that seeds tool deferral missed the very tools deferral targets (#866 N9). Each deferred built-in is now a kind 'tool' row with deferred = 1 and 0 tokens. The token shares of the MCP tools do not change, built-ins stay out of every total (they are "aside"), and nothing new is offered for removal (the reports skip built-ins and 0-token rows). Refs #869, #866. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Tool deferral's rule says "a load counts as a use", and its history is seeded from tool_uses. But tool_uses held only tool_use calls, so a tool the model loaded through search and then did not call read as unused (#866 N9). usedFrom now also reads, next to the last tool-using turn: - tool_search_tool_result blocks in that turn (the server-side search); - tool_reference blocks in the tool results of the message right after it (Claude Code's own ToolSearch). Each loaded tool counts as one call, unless the same turn called it. A turn with only a search load is a tool-using turn, so its fingerprint dedupes it like any other. Refs #869, #866. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
The proxy's deferral ledger lived only in /stats: one process total, no account, no day, gone at a restart (#869 item 3). - deferLedger now also puts the request's facts on its dashboard row: tokens deferred, the names list's tokens, searches, tools loaded, wrong guesses, and the ledger's gross and net dollars. Seven new request columns, additive, 0 on every earlier row. - A wrong guess is a tool this request deferred that a search in its response loaded and no earlier search in the transcript had loaded. This matches the name #866 N8 uses (wrong_guesses). - GET /api/tool-defer sums them per account and UTC day, with a total. Net is gross minus the names list and the search costs, the same figure /stats shows. - The Tools tab shows the panel when deferral changed a request in the window, and nothing otherwise. Metadata only: counts and prices. Refs #869, #866, #485. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
#485 decision D3: one row per tool, MCP server and skill, with its state, its use, what carrying it cost, and why (#869 item 4). - GET /api/save-more/tools: the rows come from the same inventory as /api/tools. The state is loaded, deferred_cg (Context Guru's history rule defers it), deferred_client (Claude Code defers it) or removed. tooldefer.Explain gives the rule's answer and reason for one tool, from the same history and thresholds as Decide. - POST /api/save-more/tools/apply: keep or unkeep a name on toolfilter's keep list, search_on or search_off (toolfilter defer: auto or off), or revert. It writes only an option the caller's own report offered, through the shared adapt path, so a hosted account and a local proxy both work. A change reaches new threads only. - "Always defer" is not built: toolfilter has no such list. That needs a new field and a change to the rule (open question in the PR). Refs #869, #485. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
`/context-guru:save-more tools` prints the per-tool report: state, use and cost of each tool, MCP server and skill, and the reason with `details`. It recommends nothing. The changes are printed as commands to run after a yes: - `apply deferral keep:<name>@<basis>` (and unkeep); - `apply deferral search_on|search_off@<basis>`; - `revert deferral`. The removal report keeps the `tools` kind, so `apply tools` and `revert tools` from remove-mcp-and-skills work as before. remove-mcp-and-skills stays (#869 item 5 needs the owner's yes); its skill and doc now point to save-more tools. The Codex copy of cg.py and of both skills is updated too. Refs #869, #485. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Metadata only: tool names, counts and prices. Refs #869. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
save-more tools lists the D3 action it does not offer yet, with its issue, so the reader sees it as missing rather than absent. Refs #869, #878. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
…e ledger The lead decided one wrong-guess rule, in tooldefer.WrongGuesses (#874): a tool this request deferred, that a search in its response loaded, and that no earlier message had loaded. deferLedger already computes it on the tooldefer.Request it books, so the dashboard row now takes r.WrongGuesses from there. The second copy (proxy's wrongGuesses) is gone, so /stats and the panel cannot disagree. The row and the panel also carry r.DroppedSearches (#866 N8): searches with no result, because the client drops a search sent beside another tool call. One more additive column, defer_dropped_searches. Rebased on #874 (feat/tooldefer-866), which merges first. Refs #869, #866. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Review round 1 on #877: the headline "Carrying all of them cost $X" added carry_usd of rows with carry_priced false, while the table prints n/a for the same rows. The golden showed $16.93, with dataviz's partial $0.31 inside it. The headline now sums priced rows only. When any row is unpriced it says "at least $X; N items had no price" (missing is not zero). Golden now reads $16.62. Codex copy updated. Refs #869, #877. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
b43100a to
b8dc2df
Compare
…tes) - deferred_cg says what it checks: the user rule, in new threads. A thread still sends the tool in full when the project used it or it is under 200 tokens; the reason now says so, and so does the doc. - An MCP server reads deferred_client only when every tool of it is client-deferred. Claude Code defers tools one by one. - A client-deferred tool on the removal list reads deferred_client: the filter removes only `tools` elements, so its name is still sent. - The dead removed override on server rows is gone. - The deferredDeclsFrom doc comment is untangled. - Tests: unkeep through the local apply path, server and removed edges, and the 200-row cut. Refs #869, #877. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
|
Replies to review round 1 (head Reviewer 2, blocking: the save-more tools headline adds unpriced rows. Fixed in
Reviewer 1, non-blocking notes. Taken in
Also on this head: the dashboard row takes Tests at
|
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.317 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 22dd975d4b4a |
approve |
Verdict: approve
Findings
None blocking. My round-1 finding is fixed. The four fix commits introduce no new defect
I could prove, and the rebase changed no reviewed line.
Earlier findings
Mine, blocking (cg.py:1211 — the headline summed unpriced rows). Fixed in b8dc2dfa.
- The headline now sums only rows with
carry_priced: true. When a row is unpriced it says
"cost at least $X; N item(s) had no price". This is the fix I asked for. - The goldens read "at least $16.62; 1 item had no price". That is $16.93 less dataviz's
partial $0.31. The arithmetic checks out. - New test
SaveMoreToolsHeadlinecovers the unpriced and the all-priced case. The two
cg.pycopies are byte-identical at the new head.
Reviewer 1's notes, all checked against 22dd975d:
deferred_cgreason — fixed. The reason now says "in new threads ... unless this
project used it or it is under 200 tokens", anddocs/plugin/save-more.mdsays the same.- Server reads
deferred_clientonly when every tool of it is — fixed.
deferredTools[s] == serverTools[s]gates the state. A server with no tool rows cannot
readdeferred_client. - Dead
removedoverride on server rows — fixed. Gone. - Client-deferred tool on the removal list — fixed.
state()checksclientDeferred
beforeremoved, so it readsdeferred_client. The removal filter cannot remove it, so
the text is now true. - Same finding as mine — fixed, see above.
deferredDeclsFromdoc comment — fixed. The built-in sentences are their own
paragraph now.- Coverage — taken in part, and I agree with the rest.
unkeepnow runs through the
local apply path, and the revert after it undoes the unkeep and leaves search on, which
matches the kind-scoped revert. New tests cover the server edge, the removal edge and
the 200-row cut. The hosted apply path sharesadaptWritewith the tools apply, which
has a hosted test. I checked that sharing in round 1 and accept it.
My round-1 non-blocking notes — status. None was taken, and none blocks:
renderDeferNettiles show dollars when only some requests are priced — still open.usedFromsubstring markers — still open (pre-existing looseness).- The 200-row cut is now tested. A keep-list entry whose tool has no row still offers no
unkeep— still open. - The report ignores
rep.DeferredState— still open. - The
defer_tokens > 0gate can drop a list-only request the ledger books — still
open. The refactor below does not change the gate. - The Codex
save-moreSKILL.md still lacks the keep-request guidance the Claude copy
has — still open.
New commits
I read all five in full, with the code around each change.
af895400+25eb78ff(always-defer as not available yet). The report carries a
not_yetlist with the issue number, andcg.pyprints "Not available yet: ..." inside
the fitted block, before the act lines. The goldens show the line. The test asserts the
report offers nodeferoption. No defect.3819f1a0(wrong guesses and dropped searches from the ledger).deferLedgersets
r.WrongGuessesandr.DroppedSearchesonce, then hands the samertoledger.Add
andcp.noteDefer, so/statsand the panel cannot disagree. The tooldefer logic
(distinct, deferred-only, first-load-only) matches the proxy copy it replaces, and
tooldeferhas its own test for it in the base. I counted the store insert: 89
columns, 89 placeholders, andrequestColsandscanRequestappend the new column in
the same position. The additive migration, the panelSUM,tools.jsand the golden
all carrydefer_dropped_searches. The data-dependence row now says eight columns. No
defect.b8dc2dfa— my fix, checked above.22dd975d— reviewer 1's fixes, checked above.
What I checked
- Last review (round 1,
a335fdda053ea973d7a5a97c91575105cbfc58cd, 2026-11-03T21:36:44Z). - New commits read (5:
af895400always-defer not-yet,25eb78ffits goldens,
3819f1a0ledger refactor,b8dc2dfaheadline fix,22dd975dstate fixes). The range
a335fdda..HEADholds 14 commits: the 5 above, 7 rebased copies of round-1 commits, and
2 base commits (0022f45a#874,75c52f2c#873). - Read in full (2 reviews, 1 comment, 0 inline comments).
- New items since my last review:
- The author's reply (2026-11-03T22:50:44Z): each claim checked against the code. All
claims hold. - The rebase onto
0022f45a: I compared patch-ids of all 7 round-1 commits against
their rebased copies. All 7 are identical patches, so no reviewed line changed in
the rebase. Thetooldefer/*,proxy/proxy.go,proxy/usage.goand
proxy/tooldefer_866_test.gochanges in the tree diff come from #874 in the base and
are out of scope here. - The two
cg.pycopies: diffed at the new head, byte-identical.
- The author's reply (2026-11-03T22:50:44Z): each claim checked against the code. All
- Verified the store round-trip again at the new head: insert 89/89, scan order matches
requestCols, the additive column list carriesdefer_dropped_searches. - Verified the new tests read what they claim: the server/removal edges, the 200-row cut
(cheapest kept,Truncated3), theunkeepround trip and its revert. - Live tests were not run (not approved). Test claims are taken from the author's reply.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.317 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 22dd975d4b4a |
approve |
Verdict: approve
No new findings. Every fix the author claims is in the code, and I traced each one.
I could not run tests (live tests are not approved), so all proofs are line-level traces.
My round-1 findings
- A row could read
deferred_cgfor a toolDecidekeeps loaded — fixed in22dd975d.
dash/savemoretools.go:144-146now says "defers it in new threads (...), unless this
project used it or it is under 200 tokens", anddocs/plugin/save-more.mdstates the same
limits. The state label is stilldeferred_cg, but the reason now carries the caveat, so a
reader is no longer told an unqualified false thing. - One client-deferred MCP tool marked the whole server
deferred_client— fixed.
dash/savemoretools.go:181-200countsdeferredToolsagainstserverToolsper server and
passesdeferredTools == serverTools.TestSaveMoreToolsServerAndRemovedEdgescovers the
half-deferred and all-deferred servers. - The dead
removedoverride on server rows — fixed. It is gone
(dash/savemoretools.go:195-203);state()already checksremoved. - A client-deferred tool on the removal list read "the proxy does not send it" — fixed.
state()now checksclientDeferredbeforeremoved(dash/savemoretools.go:129-136),
with a comment saying why: the removal filter removes onlytoolselements. The new test
putsMonitoron the removal list and wantsdeferred_client. - The card's headline summed unpriced rows — fixed in
b8dc2dfa. This was reviewer 2's
blocking finding; see below. - The tangled
deferredDeclsFromcomment — fixed. The built-in sentences are now their
own paragraph anddeferredDeclsFrom's line stands alone (dash/toolinventory.go:493-506). - Coverage gaps — mostly fixed.
unkeepnow runs through the local apply path
(proxy/adapttoolsctl_test.go:289-295), and the server, removal and 200-row edges have a
test. The hosted apply path still has no test of its own; it goes through the same
adaptWriteas the tools apply, whose hosted test exists, so I accept the author's
reasoning.
Reviewer 2's round-1 findings (I checked each myself)
- Blocking, the headline summing unpriced rows — fixed in
b8dc2dfa, verified in both
cg.pycopies (byte-identical). The headline now sums onlycarry_pricedrows and says
"cost at least $X; N items had no price" when any row is unpriced. The golden reads
$16.62 = 9.12 + 6.40 + 1.10 + 0, with dataviz's partial $0.31 left out and named. The new
Python testSaveMoreToolsHeadlinecovers both cases. - The six non-blocking notes are all still open: the tiles still show dollars when only
some requests are priced (renderDeferNetis unchanged apart from the dropped count);
usedFromstill substring-matches the raw message; rows past the 200 limit still lose their
keep options and a stale keep entry still gets no row;buildSaveMoreToolsstill never reads
rep.DeferredState; the panel SQL still gates ondefer_tokens > 0, so a list-only change
the ledger books stays off the panel; and the CodexSKILL.mdstill lacks the keep-request
guidance the Claude copy has (I diffed both). I agree with reviewer 2 on each, and none
blocks this PR.
The new work
I reviewed the five new commits as a first review. No findings.
af895400+25eb78ff(always-defer shown as not available yet).SaveMoreToolsNotYet
is a fixed list holding one entry,deferwith issue 878. I checked that 878 is an open
issue ("an always-defer list for save-more tools"), not a merged PR, so the pointer is
right. The option list never offersdefer, the test asserts that, and the goldens and
docs/plugin/save-more.mdcarry the same sentence.cg.pyrendersnot_yetafter the
window line, and treats a missingissuesafely.3819f1a0(wrong guesses and dropped searches from the ledger).deferLedger
(proxy/tooldefer.go:534-553) setsr.WrongGuessesandr.DroppedSearchesfrom the same
sources the ledger books, then passes that onertonoteDefer, so/statsand the panel
cannot disagree.tooldefer.WrongGuesses(from #874) has the same semantics the proxy's
deleted local function had: deferred by this request, loaded by this response's search, not
loaded earlier in the transcript, once per tool — and #874's own tests cover it
(tooldefer/support_test.go:828,TestReadSearchesCountsDropped), so the deleted proxy test
is redundant, not lost.distinctLoadscounts non-empty distinct names, as the old
distinctdid.- The new
defer_dropped_searchescolumn. I counted the round-trip: 89 INSERT columns,
89 placeholders, 89Execargs (the last line carries a trailing comma);
requestColsandscanRequestappend the column in the same, last place; the panel's
SELECT, itsScanorder, and the totals fold match;additiveColumnsmirrors the CREATE
TABLE column. The golden anddocs/data-dependence.md(seven → eight columns) are updated. b8dc2dfaand22dd975d— covered above.
What I checked
- Last review: round 1, sha
a335fdda053ea973d7a5a97c91575105cbfc58cd, 2026-11-03T21:39:48Z. - The PR was rebased onto
mainafter #874 merged, so my round-1 SHA is no longer in the
history. I found the rebased equivalent by tree-diffing:git diff --stat a335fdda cca39a28
holds only #874/#873 content, socca39a28is where my last review stands, and
git diff cca39a28..HEADis the new work. New base:0022f45a. - New commits read: 5 —
af89540feat(dash,plugin): show always-defer as not available yet;
25eb78ftest(plugin): goldens show always-defer as not available yet;3819f1a
refactor(proxy,dash): take wrong guesses and dropped searches from the ledger;b8dc2df
fix(plugin): save-more tools totals only priced rows;22dd975fix(dash): save-more tools
states, from review round 1. - Read in full: 2 reviews, 1 comment, 0 inline comments (the author's reply of
2026-11-03T22:50:44Z; no inline comments exist on this PR). - The whole new diff (24 files, +326/−114) and the code around each change: both
cg.py
copies,test_costly.py, the four deferral goldens andsave_more_tools.json,
dash/event.go,query.go,savemoretools.go,savemoretools_test.go,schema.go,
store.go,tool_defer.json,tooldeferpanel.go,tooldeferpanel_test.go,
toolinventory.go,ui/tools.js,docs/data-dependence.md,docs/plugin/save-more.md,
proxy/adapttoolsctl_test.go,dashcapture.go,tooldefer.go,
tooldefer_ledger_test.go, plustooldefer/ledger.gofrom #874 for the semantics the
refactor leans on. - The unkeep-then-revert sequence in the local apply test: revert restores the document before
the unkeep, so the keep list comes back and search stays on — the new expectations match. - The
save_more_tools.jsonrewrite is a reformat plusnot_yet; every other value is
unchanged. The basis stays9d4e2a7cbecauseOfferAdapthashes the options, andnot_yet
adds no option. - Fail open: unchanged. The new code is report-side only; the request path gains one field
copied from the ledger's ownRequest.
…0.2.11) (#921) Claude Code plugin 0.6.6 -> 0.6.7: - #889: the preset picker restarts the proxy after a yes, and the status shows a pending preset. - #891: insights and the status show tool deferral as its own saving lever. - #877, #885: save-more tools (keep, unkeep, defer, undefer, search on/off, revert). - #882: ultrahigh is marked experimental in the picker. Codex plugin 0.2.10 -> 0.2.11: - #889, #891: the same cg.py changes (vendored copy). - #882: ultrahigh is marked experimental in the picker. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Behavior change (the owner approved it)
ultrahighpreset.tool_declarationsheld only deferredmcp__tools.tool_usesheld onlytool_usecalls.remove-mcp-and-skills,save-moreand the Tools tab can drop: a tool that was only loaded is now "used". Token and dollar totals do not change, because built-ins stay out of every total.save-moregets atoolspart. The Tools tab gets a net-saving panel. It shows only when deferral changed a request.save-more toolsshow nothing new on an account without deferral.remove-mcp-and-skillsis not removed (dash: tool deferral's dashboard, net-saving panel and save-more tools (#485 follow-up) #869 item 5). That waits for the owner's yes. Its skill and doc now point tosave-more tools.Data dependence
Metadata only. No change of level. It uses tool names, counts, token weights and prices. At each storage level:
docs/data-dependence.md(Dashboard database row) names the 8 new request columns and the 2 inventory changes.Summary
The dashboard and save-more part of tool deferral (#869, items 1 to 4, and #866 N9).
What changed
dash/toolinventory.go). Each name in Claude Code's "deferred tools" block that is notmcp__becomes atoolrow withdeferred = 1and 0 tokens. MCP token shares do not change.usedFrom). Two forms count:tool_search_tool_resultin the last tool-using turn;tool_referenceblocks in the tool result right after it (Claude Code's ToolSearch).A load counts as 1 call, or 0 more if the turn also called the tool. A turn with only a search load is a tool-using turn, so the fingerprint dedupes it.
tooldefer.Requestthat the/statsledger books, so the two cannot disagree.tooldefer.WrongGuesses: a tool this request deferred, that a search in its response loaded, and that no earlier message loaded. A dropped search is fix(tooldefer): the follow-ups to tool deferral from #866 #874'sSearchRead.Dropped(): a search with no result.GET /api/tool-defersums the numbers per account and UTC day.save-more tools(toolfilter: defer unused tool declarations at session start, by history (was: remove at cold moments) #485 D3):GET /api/save-more/toolsreturns one row per tool, MCP server and skill: state (loaded,deferred_cg,deferred_client,removed), use, carry cost and reason.tooldefer.Explaingives the rule's answer for one tool.not_yet, with tooldefer: an always-defer list (toolfilter.always_defer) for save-more tools #878). toolfilter has no list for it, andtooldefer.Decideis not touched here.POST /api/save-more/tools/applytakeskeep:<name>,unkeep:<name>,search_on,search_offorrevert. It writes toolfilter'skeepanddeferthrough the shared adapt path (adaptWriteandadaptRevert), so hosted and local both work. It writes only options that the caller's own report offered./context-guru:save-more toolsprints the rows. The change commands areapply deferral …andrevert deferral. The removal report keeps thetoolskind, soapply toolsandrevert toolswork as before. The Codex copy ofcg.pyand both skills are updated.docs/plugin/save-more.md(a new Tools section) anddocs/plugin/remove-mcp-and-skills.md(a pointer).How it was tested
On the eval box (
~/cgssh2),CGO_ENABLED=1 go test -race -count=1:./dash/..../proxy/..../tooldefer/..../context-guru-plugin/...These are the results at the final head, rebased on
mainafter #874 merged.| plugin Python (
unittest, both plugins) | 83 and 43 tests OK |New tests: the parser on the
dash/testdata/deferredfixtures (21 built-ins, 0 tokens, one row when loaded), the use recording (server search, ToolSearch, call and load in one turn, an older load, a pasted reference), the panel query (per account and day, scope, unpriced rows), the proxy row facts against the ledger,wrongGuesses,Explain, the save-more rows and options, a local keep, search_on and revert round trip, and 6 plugin goldens.Mutations (each one made a test fail, then the code was restored):
No paid live runs.
Open questions
remove-mcp-and-skillsnow thatsave-more toolsexists? Owner's call."Always defer" moved to #878: a new field
toolfilter.always_defer, which changestooldefer.Decide, so it needs the owner's yes.Technical notes
additiveColumns) with a 0 default, so no version bump. A row deferral did not change keeps 0. The panel reads onlydefer_tokens > 0.deferLedgernow takes the capture and callscp.noteDefer(r, price, distinct loads)with the samerit books in the ledger.Explainchecks only the user rule (3 sessions, keep list, never-defer list). The project veto, thread uses,tool_choiceand the 200-token floor depend on the request, so the reason text says "Context Guru defers it" only when the user rule holds.Refs #869, #866 (N9), #485, #874, #878.
🤖 Generated with Claude Code