Skip to content

Fix: M3 lazy tool input review feedback#9245

Merged
ashleeradka merged 1 commit into
mainfrom
swarm/history-pagination/fix-m3
Feb 25, 2026
Merged

Fix: M3 lazy tool input review feedback#9245
ashleeradka merged 1 commit into
mainfrom
swarm/history-pagination/fix-m3

Conversation

@ashleeradka
Copy link
Copy Markdown
Contributor

@ashleeradka ashleeradka commented Feb 25, 2026

Summary

Addresses review feedback on #9229. Three fixes:

  1. Cap inputRawDict at storage point — In populateFromHistory, the raw tool input dictionary is now size-checked before storage. If the JSON-encoded size exceeds 10KB, the input is formatted eagerly (with the existing truncation logic in formatAllToolInput) and stored in inputFull instead of retaining the unbounded raw dictionary in memory.

  2. Cache resolvedInputFull with @State — Both ToolCallChip and UsedToolsRow now cache the formatted input in a @State property that is populated once via .onAppear when the user first expands the tool call. This prevents formatAllToolInput from re-running on every SwiftUI render pass while expanded.

  3. Remove dead ensureInputFullFormatted() — The mutating method on ToolCallData was never called anywhere in the codebase. The @State caching approach is simpler for SwiftUI views, so this dead code was removed.

Files Changed

  • clients/shared/Features/Chat/ChatViewModel.swift — Size-check raw dict before storing
  • clients/shared/Features/Chat/ToolCallChip.swift — Add @State cache + .onAppear
  • clients/macos/vellum-assistant/Features/Chat/UsedToolsList.swift — Add @State cache + .onAppear
  • clients/shared/Features/Chat/ChatMessage.swift — Remove dead ensureInputFullFormatted()

🤖 Generated with Claude Code


Open with Devin

Co-Authored-By: Claude <noreply@anthropic.com>
@ashleeradka ashleeradka self-assigned this Feb 25, 2026
@ashleeradka ashleeradka merged commit 81ba618 into main Feb 25, 2026
1 of 2 checks passed
@ashleeradka ashleeradka deleted the swarm/history-pagination/fix-m3 branch February 25, 2026 23:42
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment thread clients/shared/Features/Chat/ToolCallChip.swift
@ashleeradka
Copy link
Copy Markdown
Contributor Author

Addressed in #9325

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