fix(trace): normalize keyed tool names and show credits in trace view#4344
fix(trace): normalize keyed tool names and show credits in trace view#4344waleedlatif1 merged 9 commits intostagingsimstudioai/sim:stagingfrom
Conversation
- Export normalizeToolId from tools/index.ts so trace-view can reuse it - Strip resource-id suffixes (knowledge_search_<uuid>, workflow_executor_<uuid>, table_*_<id>) from tool span names at display time so icons resolve and names are readable - Replace raw dollar formatting with credits in trace header and agent detail panel
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Tool spans are now displayed and matched using normalized tool IDs (e.g. Cost formatting in trace surfaces is changed to credits via Reviewed by Cursor Bugbot for commit 4c07eb9. Configure here. |
Greptile SummaryThis PR consolidates duplicate utility functions from Confidence Score: 5/5Safe to merge — only a P2 style nit on import placement; all logic, normalization, and credit conversion are correct. No P0 or P1 findings. The single finding is a mid-file import statement in apps/sim/tools/index.ts — import statement should be moved to the top of the file. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[TraceSpan with name e.g. knowledge_search_uuid] --> B{span.type === 'tool'?}
B -- Yes --> C[normalizeToolId from tools/normalize.ts]
C --> D[Stripped name e.g. knowledge_search]
B -- No --> E[span.name unchanged]
D --> F[getDisplayName in utils.ts]
E --> F
F --> G[trace-view.tsx: tree row label + tooltip + detail pane]
F --> H[trace-spans.tsx: span node label]
F --> I[spanMatchesQuery: search matches normalized name]
J[span.cost.total in dollars] --> K[formatCostAmount in utils.ts]
K --> L[dollarsToCredits: Math.round x 200]
L -- result gt 0 --> M[N credits]
L -- result eq 0 --> N[less than 1 credit]
M --> O[trace-view.tsx: header summary + detail pane Cost row]
N --> O
M --> P[trace-spans.tsx: span Cost row]
N --> P
Reviews (5): Last reviewed commit: "fix(trace-spans): simplify formatCostSum..." | Re-trigger Greptile |
…e log-details formatting utils
…te-180 on disclosure chevron
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 005464e. Configure here.
|
@greptile |
|
@cursor review |
…tils, normalize tool names in trace-spans
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4c07eb9. Configure here.
…#4344) * fix(trace): normalize keyed tool names and show credits in trace view - Export normalizeToolId from tools/index.ts so trace-view can reuse it - Strip resource-id suffixes (knowledge_search_<uuid>, workflow_executor_<uuid>, table_*_<id>) from tool span names at display time so icons resolve and names are readable - Replace raw dollar formatting with credits in trace header and agent detail panel * fix(trace): fix sub-credit display, locale, and pluralization in formatCostAmount * fix(trace): extract normalizeToolId to client-safe module, consolidate log-details formatting utils * refactor(trace): consolidate shared span utilities into log-details/utils * fix(tools): import normalizeToolId for internal use after extracting to normalize.ts * style(trace-spans): replace inline transform style with Tailwind rotate-180 on disclosure chevron * fix(trace-spans): show credits instead of dollars for cost display * refactor(trace): move formatCostAmount and getDisplayName to shared utils, normalize tool names in trace-spans * fix(trace-spans): simplify formatCostSummary to show total credits only
Summary
Type of Change
Testing
Tested manually against production traces with knowledge search and workflow executor spans.
Checklist