fix: preserve primary detail hash across frontmatter retries #443
Reference in New Issue
Block a user
Delete Branch "fix/439-detail-merge-and-acp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Preserve the first run's detail hash (containing full tool-call turn history) when frontmatter retry loop triggers continuation calls.
Why
When the agent's first run output fails frontmatter extraction, the retry loop replaces
agentResultentirely, causing the 1-turn continuation detail to overwrite the original multi-turn detail. This made planner steps appear as "1 turn" despite having 17-22 actual turns with tool calls.Root Cause
In
createAgent(run.ts), the retry loop:agentResultreplaced entirely →detailHashnow points to the 1-turn continuationChanges
packages/workflow-agent-kit/src/run.ts— captureprimaryDetailHashfrom first run, always use it for persisted StepNodeVerification
Before fix:
numTurns: 1, turns: 1After fix:
numTurns: 22, turns: 61Ref
Fixes #439
小橘 🍊(NEKO Team)
LGTM ✅ 简洁准确。