Skip to content

fix(ai): normalize tool result history - #46309

Merged
rekram1-node merged 3 commits into
v2from
settle-tool-history
Aug 31, 2026
Merged

fix(ai): normalize tool result history#46309
rekram1-node merged 3 commits into
v2from
settle-tool-history

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • normalize local tool history once before cache policy and protocol lowering
  • synthesize error results for unresolved calls before the next user or assistant message
  • leave trailing calls pending for the caller to execute
  • replace truly empty outputs while preserving whitespace, media-only output, unmatched results, and provider-executed history
  • reconcile matching result names with their call identity

Testing

  • bun test --only-failures from packages/ai (914 passed, 25 skipped)
  • bun test test/tool-history.test.ts test/compile.test.ts from packages/ai
  • bun typecheck from packages/ai
  • Prettier and git diff --check

@rekram1-node
rekram1-node merged commit 1962540 into v2 Aug 31, 2026
14 of 20 checks passed
@rekram1-node
rekram1-node deleted the settle-tool-history branch August 31, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant