Skip to content

fix(sight): drop hardcoded minus on savings - #2754

Merged
chengshuyi merged 1 commit into
mainfrom
fix/sight/atif-savings-sign
Aug 22, 2026
Merged

fix(sight): drop hardcoded minus on savings#2754
chengshuyi merged 1 commit into
mainfrom
fix/sight/atif-savings-sign

Conversation

@jfeng18

@jfeng18 jfeng18 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Why

The ATIF viewer "Token Savings Comparison" card renders total_compounded_saved with a hardcoded - prefix in JSX. The value is already positive (total_original_tokens - total_actual_tokens), so the UI read as negative savings — the same data shows 11 on the Token Savings page and -11 here. Reported in #2749.

What changed

  • src/agentsight/dashboard/src/pages/AtifViewerPage.tsx: dropped the hardcoded - before fmtTokens(savingsDetail.total_compounded_saved). Styling (green, size, rate suffix) untouched; the leftover sat next to the fix(sight): return savings rates as fractions #2732 rate rescale on the same line.

Related issue

closes #2749

User / Agent impact

The "Saved" value on the ATIF viewer savings card now displays as a positive number, matching the Token Savings page and the API contract.

Risk and compatibility

  • Public CLI, API, configuration, or documented behavior changed
  • Privileged or security-sensitive behavior changed
  • Cross-component contract changed
  • Migration or rollback guidance is needed

Low risk: one-line display-only change; no API, data, or i18n changes.

Validation

Mirrors #2732's dashboard validation (no component-render test harness exists in dashboard/; display changes there are covered by typecheck + regression scripts, per that precedent):

  • npm run typecheck — pass
  • npm run test:api-client — 24/24 pass
  • npm run test:i18n — 5/5 pass
  • npm run build — webpack compiled successfully

Environment: node v22.22.0 / npm 10.9.4 on the ECS test machine; source synced via rsync (md5-verified).

Documentation and rollback

No docs describe this display detail. Rollback: revert the single commit.

The ATIF viewer savings card prefixes a hardcoded minus to
total_compounded_saved, which is already positive (original
minus actual), so the UI showed negative savings and clashed
with TokenSavingsPage. Drop the prefix; styling untouched.
Residue next to the #2732 rate rescale on the same line.
Closes #2749

Assisted-by: Qoder
Signed-off-by: Jiangtian Feng <jiangtianf97@163.com>
@jfeng18
jfeng18 requested a review from chengshuyi as a code owner August 21, 2026 11:51
@github-actions github-actions Bot added the component:sight src/agentsight/ label Aug 21, 2026

@qoderai qoderai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次审查范围内未发现需要修改的问题。


🤖 Generated by QoderView workflow run

@chengshuyi chengshuyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified: total_compounded_saved is positive by construction (Σ(before−after)×turns), TokenSavingsPage displays it without prefix, and the render guard > 0 already ensures the card only appears for positive savings. One-char display fix, no risk.

@chengshuyi
chengshuyi merged commit feacc85 into main Aug 22, 2026
25 checks passed
@chengshuyi
chengshuyi deleted the fix/sight/atif-savings-sign branch August 22, 2026 10:49
@Daydreamer-Li Daydreamer-Li mentioned this pull request Aug 22, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:sight src/agentsight/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sight] bug: ATIF 轨迹页「节省」值硬编码负号前缀,与 Token 节省页正数口径相反

2 participants