Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
c0f2509 to
3f03997
Compare
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Code Review Summary
This incremental review covers the new PR head, which retains the duplicate assistant tool-call ID normalization and regression test and additionally raises the fast-test CI job timeout from 20 to 30 minutes. The core fix still deduplicates assistant tool calls after all streamed/error content is merged and before both tool execution and assistant-history replay.
The approach remains sound for this standard-risk shared-core change. Two independent balanced reviews found no confirmed bugs, compatibility regressions, security issues, or performance/reliability concerns. The regression test verifies that duplicate IDs execute once and that only one call is present in the next model request; the bounded CI timeout increase is reasonable and does not alter product behavior.
Risk assessment: Standard. The previous review had no inline findings, so there were no addressed threads to resolve or duplicate comments to suppress.
🧪 Browser testing: Skipped — PR changes core agent-loop logic, tests, changeset metadata, and CI configuration; it has no user-facing UI impact.
|
awesome, thanks @CheckPickerUpper! |
* Fix duplicate assistant tool-call replay * Give fast tests enough CI time
Summary
Fixes a replay-history failure where a normalized assistant turn can contain the same tool-call id more than once. The shared agent loop now collapses duplicate assistant tool-call ids before executing tools or persisting the assistant turn for the next model request.
Why
I hit this through PR Visual Recap on a DeepSeek-backed repo. The agent got as far as preparing to write
recap-source.json, then DeepSeek rejected the next request with:The visible recap error was just
recap-source.json was not created, but the source artifact showed the actual provider 400. The bad state is not DeepSeek-specific: any engine path that hands the loop duplicate assistant tool-call ids could execute/replay an invalid assistant turn. Keeping the invariant inrunAgentLoopcloses that class instead of patching one provider translator.Testing
pnpm --filter @agent-native/core exec vitest --run src/agent/production-agent.spec.ts --testNamePattern "collapses duplicate assistant tool-call ids|executes a streamed tool call|does not carry streamed tool calls"pnpm --filter @agent-native/core exec vitest --run src/agent/engine/translate-ai-sdk.spec.tspnpm --filter @agent-native/core typecheckgit diff --check