agent: Reduce allocations (#30220)

Just a tiny patch to reduce allocations during context loading

Calling `.cloned()` on an iterator clones each element one by one, while
`into_iter().collect()` pre-allocates the resulting `Vec`

Release Notes:

- N/A
b34f19a46ftidely committed on 5/11/2025, 4:14:17 PM· committed by GitHubparent09ace08
1 file changedLine totals unavailable