Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Feb 11, 2026

Summary

  • add shared tool block format helpers for legacy (tool_use/tool_result) and AI SDK (tool-call/tool-result) shapes
  • refactor Task, condense, and validateToolResultIds to use shared helpers instead of duplicated local type guards/mappers
  • preserve mixed-format behavior in resume, condense orphan filtering, synthetic tool result injection, and tool-result ID reconciliation
  • add mixed-format regression tests for condense and tool-result validation

Why

Message history is currently a mix of legacy Anthropic and AI SDK shapes during migration. Prior logic handled these formats inconsistently across code paths, which risked orphan filtering mistakes and resume/protocol mismatches.

Testing

  • pnpm --dir src exec tsc --noEmit --pretty false
  • pnpm --dir src exec vitest run core/condense/__tests__/index.spec.ts core/task/__tests__/validateToolResultIds.spec.ts core/task/__tests__/Task.persistence.spec.ts core/task/__tests__/flushPendingToolResultsToHistory.spec.ts
  • push hook suite (repo check-types + full tests) passed during git push

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Feb 11, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 11, 2026

Rooviewer Clock   See task

Re-reviewed after merge commit c1ab9ad. The merge with main adopted the rooMessage.ts dual-format helper approach from #11409, fully superseding this PR's toolBlockFormat.ts approach. The branch tree is now identical to main -- zero net changes. Previous format mismatch issue is resolved. No new issues.

  • injectSyntheticToolResults always emits legacy tool_result format for AI SDK orphans, unlike validateToolResultIds which matches the format via prefersAiSdkToolResultFormat
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Feb 11, 2026
@daniel-lxs daniel-lxs closed this Feb 11, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant