Skip to content

v2.0.2: loopback-only bind + waste-detection correctness fixes - #1

Merged
simantaturja merged 10 commits into
masterfrom
release/v2.0.2-trust-fixes
Jul 17, 2026
Merged

v2.0.2: loopback-only bind + waste-detection correctness fixes#1
simantaturja merged 10 commits into
masterfrom
release/v2.0.2-trust-fixes

Conversation

@simantaturja

Copy link
Copy Markdown
Owner

Summary

  • Security: server now binds 127.0.0.1 only — with no auth, binding all interfaces exposed project paths/prompts/error samples to the LAN.
  • Correctness: retry-match no longer false-positives on tools with no identifiable target (WebFetch/WebSearch/Task/TodoWrite all collided on an empty target string).
  • Correctness: redundant-read detection now recognizes MultiEdit/NotebookEdit as legitimate file mutations (previously only Edit/Write cleared the flag).
  • Redaction: mask glued single-dash password flags (mysql -phunter2); softened the "credentials are redacted" UI copy since keyword-less secrets can still slip through.
  • Also bundles the prior waste-detection feature series (error reason classification, retry-only counting, daily trend chart) already sitting on master ahead of origin.
  • Version bump: 2.0.12.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 -p redaction)
  • npm run build (web) + extension build/package succeed, new .vsix produced locally
  • Manual: npm publish and VS Code Marketplace publish are separate manual steps, not done by this PR

🤖 Generated with Claude Code

simantaturja and others added 10 commits July 15, 2026 02:42
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

gitguardian Bot commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


🦉 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.

@simantaturja
simantaturja merged commit d370bd0 into master Jul 17, 2026
3 checks passed
@simantaturja
simantaturja deleted the release/v2.0.2-trust-fixes branch July 17, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant