Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(thread.activityGroup): add Part type alias and explicit return type for map callback

Steven Enamakel4f8549b57da7
diff --git a/app/src/components/assistant-ui/thread.activityGroup.test.tsx b/app/src/components/assistant-ui/thread.activityGroup.test.tsx
index 88daab2f4a..ccc80c98fa 100644
--- a/app/src/components/assistant-ui/thread.activityGroup.test.tsx
+++ b/app/src/components/assistant-ui/thread.activityGroup.test.tsx
@@ -15,7 +15,9 @@ import { Thread } from './thread';
* they happened, with the answer outside it. The previous grouping split the
* same run into alternating reasoning and tool sub-groups.
*/
-const tool = (id: string, name: string): ThreadMessageLike['content'][number] =>
+type Part = Exclude<ThreadMessageLike['content'], string>[number];
+
+const tool = (id: string, name: string): Part =>
({
type: 'tool-call',
toolCallId: id,
@@ -78,13 +80,14 @@ describe('activity group', () => {
it('is open while the turn is still running', () => {
render(
<Harness
- messages={interleaved({ type: 'running' }).map((m, i) =>
- i === 1
- ? {
- ...m,
- content: [{ type: 'reasoning', text: 'live thought' }, tool('t1', 'search_one')],
- }
- : m
+ messages={interleaved({ type: 'running' }).map(
+ (m, i): ThreadMessageLike =>
+ i === 1
+ ? {
+ ...m,
+ content: [{ type: 'reasoning', text: 'live thought' }, tool('t1', 'search_one')],
+ }
+ : m
)}
isRunning
/>