v2.0.2: loopback-only bind + waste-detection correctness fixes - #1
Merged
Conversation
The advisor's premium-model rule matched only `fable-5`, so an equally-wasteful short `mythos-5` session (same top-tier price) went unflagged. Match against the top input rate in the PRICING table instead of a hard-coded model name, so the rule covers every top-tier model and stays correct as models change. Plan-ROI divided monthly value by a default $200 whenever config.json was unset, so an unconfigured Pro ($20) user saw a multiple ~10x off presented as authoritative. The payload now exposes roi.configured, and the Overview labels the plan price "(default)" with a hint to set it in config.json. Bump to 2.0.1.
…cision guard
- advisorFor reasons are now {text, action} objects, each with one concrete fix
- rule 1 (low cache ratio) only fires when denom >= 200k tokens to skip noise on tiny sessions
- AdvisorTable renders the action as a hint line; "Est. saving" header -> "Est. capacity" with tooltip
- updated advisor tests to the new shape + a precision-guard non-firing case
Adds `rule` to each advisor reason (low-cache-hit, premium-model-short-session, subagent-heavy) and surfaces it as a badge in AdvisorTable, so it's visible which rule triggered a given piece of advice. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ads) Parse tool_use/tool_result blocks in parseSession's single pass to surface recurring token waste across sessions: tool calls that errored (attributed by tool name via a tool_use_id map) and files read redundantly (a re-read after an Edit/Write is treated as legitimate). Streaming re-writes of the same tool_use/result are deduped by id so counts stay honest. waste rides on existing exports: parseSession returns a per-session waste object with raw maps; mergeSessionAggregates sums it across main+subagent files; buildResponse aggregates payload.waste (erroredByTool, byProject, topDuplicateFiles). EXACT COUNTS only — no per-tool dollar estimate, since token usage is logged per message, not per tool block. Adds a "Waste" tab (WasteTable) rendering the summary and three tables.
Explain what the tab shows and why it matters before any numbers, in both the empty and populated states, so a first-time viewer understands 'waste' = quota paid for but not needed. Trim the now-duplicated counts-only caveat from the summary line.
Add a brief method line to the intro so the counts are interpretable: errored = tool result the log marks as an error; redundant read = same file read again with no edit between.
…end chart - Classify errored tool_result content into known reasons (user-rejected, edit-before-read, stale-read, file-not-found, auto-mode-denied, model-unavailable, cwd-deleted, other) via literal substring match. - Count an error as waste only when it's actually retried (pendingErrors queue), since an error the agent never retries didn't cost extra quota. - Track redundant-read/errored-call counts per local day and render a 30-day stacked trend (WasteTrend.jsx) so waste direction is visible, not just the running total. - Ranged reads (offset/limit) no longer count toward duplicate-read detection; a Bash call clears the clean-read set since it may mutate any file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- server.js: bind 127.0.0.1 instead of all interfaces — with no auth, wider binding exposed project paths, prompts, and error samples to anyone on the LAN. - toolTarget: capture notebook_path/url/query too, and require a non-empty target before matching a retry — tools it can't identify (WebFetch, WebSearch, Task, TodoWrite) previously all collided on '' and could falsely "confirm" an unrelated call's error. - cleanReads: MultiEdit and NotebookEdit now invalidate a prior clean read of the same file, matching Edit/Write — a re-read after either is legitimate, not redundant. - redactSecrets: mask glued single-dash password flags (mysql/psql -pSECRET) that the keyword/long-flag patterns missed. - WasteTable copy: soften the redaction claim to "recognizable credentials... review before sharing" rather than an unqualified guarantee. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Security/correctness fixes: loopback-only bind, retry-match and redundant-read fixes, redaction gap fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34900034 | Triggered | Generic CLI Secret | b2d7c80 | test/core.test.js | View secret |
| 34900034 | Triggered | Generic CLI Secret | b2d7c80 | test/core.test.js | View secret |
| 34900033 | Triggered | Generic Password | b2d7c80 | test/core.test.js | View secret |
| 34900034 | Triggered | Generic CLI Secret | b2d7c80 | test/core.test.js | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
127.0.0.1only — with no auth, binding all interfaces exposed project paths/prompts/error samples to the LAN.MultiEdit/NotebookEditas legitimate file mutations (previously onlyEdit/Writecleared the flag).mysql -phunter2); softened the "credentials are redacted" UI copy since keyword-less secrets can still slip through.2.0.1→2.0.2(root + VS Code extension).Test plan
npm test— 48/48 passing, including new regression tests for each fix (loopback bind, WebFetch target collision, MultiEdit/NotebookEdit clean-read reset, glued-predaction)npm run build(web) + extensionbuild/packagesucceed, new.vsixproduced locallynpm publishand VS Code Marketplace publish are separate manual steps, not done by this PR🤖 Generated with Claude Code