fix(core): stop double-prefixing step names in stats output#177
Open
abhay-codes07 wants to merge 1 commit into
Open
fix(core): stop double-prefixing step names in stats output#177abhay-codes07 wants to merge 1 commit into
abhay-codes07 wants to merge 1 commit into
Conversation
renderTraceStats printed "Slowest steps" as `${stepType}:${stepName}`,
but step.tool/step.llm already store the name with its type prefix
(e.g. "tool:retrieve-policy"), so the type was added twice:
"tool:tool:retrieve-policy". Plain step() names have no prefix, so
those were correct. list/view render the stored name as-is and were
unaffected.
Add the type prefix only when the name does not already start with it,
so tool/llm steps show a single prefix and bare logic steps still get
one, matching what list/view show for the same run.
Fixes rajudandigam#172
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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
Fixes #172:
statsprinted step names with a doubled type prefix (tool:tool:retrieve-policy,llm:llm:generate-answer) whilelist/viewshowed the correct single prefix for the same run.Root cause is in
renderTraceStats(packages/core/src/stats.ts), which formatted the "Slowest steps" rows as${stepType}:${stepName}.step.tool/step.llmalready store the step name with its type prefix (tool:retrieve-policy,llm:generate-answer), so prepending the type again doubled it. Plainstep()names carry no prefix, which is whylogic:planlooked right.list/viewrender the stored name as-is, so they were unaffected.Fix adds the type prefix only when the name does not already start with it. Tool/llm steps now show a single prefix and bare logic steps still get one.
How I verified
Repro from the issue, "Slowest steps" section, before vs after:
Type of change
Product boundaries
Packages touched
@agent-inspect/coreValidation
Checklist