Repository navigation
fix(save-more): the session recap check says what it saves, not "not measured yet" (#615) - #683
Conversation
…measured yet" (#615) The recap fix stops one small side call each time the user comes back after a few minutes away. That saving needs no price and no attribution, so the check has no price shape on purpose. The card now says "Saves: one small model call each time you come back after a few minutes away." in place of "Cost: not measured yet", and the TODO that asked for a shape is gone. Assisted-By: Claude Opus 5.5 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 2 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | 7cd38f55ae31 |
approve |
Verdict: approve
Findings
No blocking issues found.
Non-blocking
None.
What I checked
- All changed files: Read the full diff covering 11 files across the plugin, Go backend, tests, and documentation.
- Logic consistency: The new
avoided_callmechanism is implemented consistently across both plugin copies (context-guru-pluginandcodex-marketplace). - Python implementation (
costly.py): Thelines_forfunction correctly checksprice.get("kind") == "avoided_call"and displays the savings message instead of callingcost_words. The logic is sound. - JSON schema (
costly_settings.json): Thesession-recapcheck now has"kind": "avoided_call"with a clear savings message. The emptyshapesarray is intentional and correct. - Go backend (
dash/costlysettings.go): The comment explains whysession-recaphas no shape. TheCostlySettingsfunction correctly handles checks with empty shapes by settingMeasured: falseand leavingCostUSDas nil. - Test coverage (
test_costly.py): Tests verify that "Cost: not measured yet" no longer appears for the recap, and "Saves: " appears exactly once. The test for old proxies correctly expects one "Cost: not measured yet" (for betas) and one "Saves: " (for recap). - Go test (
dash/costlysettings_test.go):TestCostlySettingsUnknownShapeIsNullNotZeroverifies thatsession-recapreturnsmeasured=falseandcost_usd: nullin JSON, which is correct behavior. - Sync test:
TestCostlyChecksMatchThePluginListensures the GoCostlyChecksand the plugin's JSON stay synchronized. This test passes with the changes. - Golden files: All three golden test files are updated consistently with the new output format.
- Documentation (
docs/plugin/save-more.md): The table correctly states the recap is "not priced" and explains the card shows savings instead of a dollar figure. - Fail-open behavior: No changes to error handling. The existing fail-open guarantees remain intact.
- Data dependence: No change to what data the feature reads or stores.
- ASD-STE100 style: All new text follows the simple, clear style required by CLAUDE.md.
The change is well-designed: a setting that stops a side call should show what it saves, not a "not measured" placeholder. The implementation is correct, complete, and properly tested.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | 7cd38f55ae31 |
approve |
Verdict: approve
Findings
No blocking issues found.
Non-blocking
- The change is well-structured and consistent across all affected files.
- The new
avoided_callkind properly distinguishes settings that prevent a cost rather than incur one. - Test coverage is complete, including golden file updates.
What I checked
- All changed files: Read the complete diff covering 10 files across plugin, proxy, tests, and docs.
- Logic correctness: The
avoided_callcheck inlines_for()correctly branches before callingcost_words(), preventing "not measured yet" from appearing for the recap setting. - Test consistency: All three test methods in
test_costly.pywere updated correctly:test_cost_in_hindsight_and_not_measured: Now expects "Saves: ..." and counts it oncetest_old_proxy_shows_settings_with_not_measured: Adjusted count from 2 to 1 (only betas remains unmeasured)- Both now verify the "Saves: " string appears exactly once
- Golden files: All three golden test files updated consistently with the new "Saves: ..." line replacing "Cost: not measured yet"
- Documentation:
docs/plugin/save-more.mdtable updated to explain the recap is "not priced" with clear reasoning - Contract preservation: The Go test
TestCostlyChecksMatchThePluginListensuresdash/costlysettings.goandcostly_settings.jsonstay synchronized. The session-recap entry inCostlyCheckshas emptyShapesandAlsoslices, matching the JSON's emptyshapesarray. - Fail-open compliance: The change adds a new branch that displays information differently but does not alter control flow or error handling. If
priceis missing or malformed, it falls through to the existing cost display path. - No data loss: This is a display-only change. No stored data is modified, and no component behavior changes.
- Security: No credentials, secrets, or user data are exposed. The change only affects how a pre-existing setting is described to the user.
- Duplication handled correctly: Both
context-guru-plugin/andcodex-marketplace/plugins/context-guru/copies are updated identically, maintaining consistency. - ASD-STE100 style: The new "Saves: ..." message is clear, direct, and uses simple words.
Resolve the conflicts with #681 by keeping both sides: main's new small-model check (its title, cost note and Note line, its Go shape and its docs row), plus this branch's "Saves:" line for the recap, which replaces only the Cost line for a check with price kind avoided_call. Assisted-By: Claude Opus 5.5 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 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 004a6238f7e8 |
approve |
Verdict: approve
Findings
No blocking issues found.
Non-blocking
- The merge is clean and well-executed.
- The new small-model check is comprehensive and properly tested.
- All integration points between the original change and the new check work correctly.
What I checked
- Last review: round 1, 7cd38f5, 2026-10-23T12:02:49Z
- New commits read: 2 commits
- Read in full: 2 reviews (both round 1, both approve), 0 comments, 0 inline comments
- New items since my last review: The merge commit and the upstream changes from main. No author responses or team comments to address.
Merge correctness
- Conflict resolution: The merge kept both the original
avoided_calllogic forsession-recapAND the newsmall-model-rejects-server-check. No conflicts in logic. - Original change preserved: The
avoided_callcheck inlines_for()at line 231 is intact and unchanged. - Integration verified: The new check's
cost_noteandnote_whenfeatures work alongside the existingavoided_callbranch without interference.
New small-model check (from PR #681)
- Detection logic (
costly.pylines 119-137): Themodel_unsupportedkind correctly parses Haiku versions using two regex patterns (_HAIKU_NEWand_HAIKU_OLD) and fires only for versions below 5.5. Thehaiku_version()function handles edge cases (non-strings, non-Haiku models, version-less ids) by returning None. - Effective value resolution (lines 154-160): Correctly implements Claude Code's precedence: highest-precedence file wins, then process env. This matches the existing logic for other checks.
- Multi-key fix (lines 339-457): The new
set_envfix kind sets bothANTHROPIC_SMALL_FAST_MODELandANTHROPIC_DEFAULT_HAIKU_MODELtoclaude-haiku-5-5. The apply/revert logic groups changes by file and handles multiple keys per file correctly, creating one backup per file and one record per key. - Title interpolation (line 227):
{model}placeholder is replaced with the actual model names found, making the card message specific. - Conditional notes (lines 237-239): The
note_whenfeature shows different messages depending on whether the betas check is also firing. This is correct: the small-model issue matters more when betas is off. - Cost note (lines 235-236): Correctly adds a note that these costs are also counted under the betas check, avoiding double-counting confusion.
Go backend integration
- New shape fields (
dash/costlysettings.golines 28-31): AddedStatusandSessionHastoCostlyShape. TheSessionHasfield enables filtering rows by whether their session also contains another shape. - Session filtering (lines 124-143): The
sessionHasWhere()function correctly builds an EXISTS subquery that checks for another row in the same session, tenant, and time window. The inner shape uses the same column filters as the outer one. - Shape matching (lines 104-121): Updated
shapeWhere()to take an alias parameter, enabling both outer and inner queries. TheStatusfield is now part of the standard column matching. - Check definition (lines 61-69): The new check has one shape with
SessionHaspointing to a Haiku 400 row. The comment correctly notes that check 1 (betas) also counts these rows.
Test coverage
- Python tests (
test_costly.py):HaikuVersionclass (lines 123-134): Tests 15 model id formats, including edge cases (no version, wrong model, non-strings).SmallModelclass (lines 137-294): 18 test methods covering detection, precedence, apply/revert with multiple keys, managed settings, process env, and card rendering.- All tests verify the fix sets both keys, creates one backup per file, and handles revert correctly.
- Go tests (
dash/costlysettings_test.go):TestCostlySmallModelCountsClassifiersOnlyInSessionsWithAHaiku400(lines 246-276): Seeds 13 rows across 7 sessions and 2 tenants, verifying that only classifier rows in sessions with a Haiku 400 are counted. Tests tenant isolation, time window filtering, and that the 400 itself is never counted.TestCostlyChecksMatchThePluginListupdated (lines 179-192): Now handlesStatusandSessionHasfields recursively, ensuring Go and JSON stay synchronized.
Documentation
docs/plugin/save-more.md(line 252): New table row explains when the check fires, what it fixes, and where the cost comes from. Notes that the plugin does not verify gateway support for Haiku 5.5.docs/data-dependence.md(line 226): Updated to note the new check uses upstream status (400) and session-level filtering. Still metadata-only.
Fail-open and security
- No new fail paths: The new detection and fix logic follows the same fail-open pattern as existing checks. A parse failure returns None, which is treated as "check does not fire."
- No credential exposure: The new check reads only
ANTHROPIC_SMALL_FAST_MODELandANTHROPIC_DEFAULT_HAIKU_MODEL, which are model names, not secrets. - No data loss: Apply creates backups before writing. Revert refuses if the file changed since apply.
ASD-STE100 compliance
All new text (card messages, risk warnings, documentation) uses short sentences, simple words, and active voice. The note_when messages are clear and direct.
The merge is correct, the new check is well-designed and thoroughly tested, and the original avoided_call change remains intact and functional.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 004a6238f7e8 |
approve |
Verdict: approve
Findings
No blocking issues found.
Non-blocking
None.
What I checked
- Last review: round 1, 7cd38f5, 2026-10-23T12:00:34Z
- New commits read: 2 commits
- Read in full: 2 reviews, 0 comments, 0 inline comments (from the three files)
- New items since my last review: The merge commit and two upstream commits from main
Round 1 findings status
Both round 1 reviews (mine and reviewer 1) approved with no findings. No changes were requested.
Merge resolution
The merge commit 004a623 correctly resolves the conflict between this branch's avoided_call mechanism and main's new small-model-rejects-server-check. The resolution:
- Keeps the
avoided_callbranch for the recap check (lines 185-187 in costly.py) - Adds the new small-model check with its own pricing logic (lines 188-191)
- The
cost_notefield from the small-model check is handled by the same code path that handles regular cost display
New small-model check (from #681)
Detection logic (detect function, lines 118-136):
- The
model_unsupportedkind correctly parses Haiku versions using two regex patterns (new and old naming) haiku_version()never guesses: returns None for ambiguous cases like "haiku" alone or dated IDs without versionseffective_value()correctly implements Claude Code's precedence: highest-precedence file wins, else process env- The detection loops through all files and marks every editable file that holds an old Haiku, which is correct for the apply logic
Apply/revert logic (lines 397-490):
- The new
set_envkind is handled alongsideremove_envin_get,_put,_target, and_after - Groups edits by file path, then processes each file once with all its keys
- For each file, builds a
todolist of (target key, value before) tuples, deduplicating by target - Creates one backup per file, not per key
- Records one entry per key changed, all pointing to the same backup
- Revert checks each key's current value matches what was written, refuses if any differs
- Revert restores all keys in a file atomically
Go backend SessionHas (dash/costlysettings.go, lines 124-143):
sessionHasWherebuilds an EXISTS subquery on a second aliasxof the requests table- Correctly filters by: same session_id, non-empty session_id, same tenant (unless TenantAll), same time window, keepalive flag
- The inner shape is matched on alias
x, the outer on aliasr shapeWherenow takes an alias parameter and prefixes all column names with it- The Status field is added to the column map and handled like other optional fields
Test coverage:
HaikuVersiontest: 13 cases covering both regex patterns, case insensitivity, edge cases, and non-Haiku modelsSmallModeltest class: 15 test methods covering detection, precedence, apply/revert, multiple keys, file grouping, managed settings, process envTestCostlySmallModelCountsClassifiersOnlyInSessionsWithAHaiku400: 16 test rows covering session matching, tenant isolation, time window, status filtering, and the 400 row itself not being countedTestCostlyChecksMatchThePluginList: Updated to handle the newStatusandSessionHasfields, including recursive comparison of the inner shape
Integration with avoided_call:
- The
lines_forfunction checksprice.get("kind") == "avoided_call"first, before the cost display path - The small-model check uses the regular cost path, so it gets the
cost_noteline when measured - The
note_whenfield is handled for both checks: it displays different text depending on whether the betas check is also firing - The
firingset is built once and passed to alllines_forcalls
Documentation:
docs/plugin/save-more.mdtable row explains the check, its detection, fix, and cost attributiondocs/data-dependence.mdupdated to mention the Status field and SessionHas test- The cost note "(also counted under the betas setting while it is on)" is clear
Correctness checks:
- The
where_wordsdeduplication (dict.fromkeys) prevents duplicate source names when multiple files from the same source fire - The title template
{model}is replaced with the comma-joined list of detected model values - The apply logic never adds a key that is not already set in a file (line 416:
if before != want and t not in [x[0] for x in todo]) - The revert logic checks every key before writing anything (lines 471-473)
- The backup is created before any writes, and the mode is preserved
- The atomic write pattern is used throughout
Fail-open compliance:
- Detection errors return None, not an exception
- Apply and revert return error messages and exit code 1, never raising
- The Go backend's SessionHas query failure returns an error from
costlyPart, whichCostlySettingspropagates, and the route returns 500 (correct fail-open: the request is not blocked)
No conflicts with round 1 changes:
- The
avoided_callmechanism from round 1 is untouched - The new check uses the regular cost path, so it does not interfere
- Both checks coexist in the same findings list and card
All changes are correct, well-tested, and properly integrated with the existing code.
…0.2.5) Both plugins changed in this release, so installed plugins must update. - Claude Code plugin: 0.6.0 was set in #694. No change here. - Codex plugin: 0.2.4 to 0.2.5. The vendored cg.py and costly.py and one skill changed in #512, #681, #683, #691, #694 and #698. Assisted-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
…0.2.5) (#701) chore(plugin): bump the plugins for v0.6.0 (Claude Code 0.6.0, Codex 0.2.5) Both plugins changed in this release, so installed plugins must update. - Claude Code plugin: 0.6.0 was set in #694. No change here. - Codex plugin: 0.2.4 to 0.2.5. The vendored cg.py and costly.py and one skill changed in #512, #681, #683, #691, #694 and #698. Assisted-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
Summary
The session recap check on the save-more card now says what its fix saves, not "Cost: not measured yet". The recap is one side call that the fix stops, so it needs no price and no attribution. This closes the last open part of #615.
What changed
Saves: one small model call each time you come back after a few minutes away.in place ofCost: not measured yet.costly_settings.json: the recap'spricehas"kind": "avoided_call"and asavestext. The TODO that asked for a request shape is gone.costly.py: a check withkind: avoided_callprints theSaves:line. Every other check is unchanged.dash/costlysettings.go: the comment says the recap has no shape on purpose. No code change: the route still returnsmeasured: falsefor it.docs/plugin/save-more.md(table row and the embedded example) and 3 goldens.codex-marketplace/plugins/context-guru/scripts/are byte-identical to the plugin ones.Data dependence
No change. The check still reads only the user's own settings, on the user's machine. It is metadata only at every storage level.
How it was tested
test_costly.py: all pass. The tests now check for theSaves:line, and that the recap never says "not measured yet".-race:./dash/...targeted costly tests pass../context-guru-plugin/...fails only the 2 known box tests (TestInstallRefusesAnUnverifiedDownload,TestInstallReportsPATHFromTheSourceFallbackToo).TestDocsExamplesAreTheGoldenspasses: the docs example matches the new golden.gofmtandgo vetare clean.go.modandgo.sumare unchanged.Closes #615.
Merged main after #681 (merge commit, not a rebase: the branch is protected against force-push). The conflicts were in the same card lines #681 touched. Both sides are kept: #681's small-model check (title, cost note, Note line, Go shape, docs row), and this PR's
Saves:line, which now replaces only the Cost line for a check with price kindavoided_call. After the merge, Python tests and the costly and golden Go tests pass with-race.🤖 Generated with Claude Code