Skip to content

Commit 9f22e92

Browse files
bloveclaude
andauthored
fix(ag-ui): detect protocol-standard RUN_FINISHED interrupt outcomes (#888)
The reducer recognized interrupts only via the CUSTOM on_interrupt event — an ag-ui-langgraph bridge convention. AWS Strands and Microsoft Agent Framework never emit it; they signal interrupts through the protocol-standard RUN_FINISHED outcome = { type: 'interrupt', interrupts: [...] }, which the RUN_FINISHED handler ignored. The run finalized 'success' with a dangling approval tool call and the interrupt signal stayed undefined. RUN_FINISHED now inspects the outcome: an interrupt outcome sets the neutral AgentInterrupt (id from the first entry, all entry fields preserved under value.interrupts plus the protocol runId — resume needs them) and finalizes the delivery run as 'paused' (status idle, isLoading false). The CUSTOM on_interrupt path stays fully intact for LangGraph and Mastra; a backend emitting both signals (Mastra does, CUSTOM first) finalizes once and keeps the first interrupt in either arrival order, and a plain RUN_FINISHED after a paused run no longer flips it to success. Tests replay real captured SSE transcripts from the 2026-08-31 runtime spikes (committed under libs/ag-ui/fixtures/runtime-transcripts/): Strands interrupt + plain chat, Microsoft Agent Framework HITL interrupt, and the Mastra double-event capture; order permutations are synthetic and marked. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 3666eb3 commit 9f22e92

6 files changed

Lines changed: 648 additions & 1 deletion

File tree

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
{"__request__": {"threadId": "thread-06-hitl-interrupt", "runId": "83caa76f-b177-4c68-9b2b-ad1be07589e5", "messages": [{"id": "4b79402e-e291-42bb-be55-ccacb46ddb38", "role": "user", "content": "Plan the task: build a birdhouse."}], "tools": [], "context": [], "state": {}, "forwardedProps": {}}}
2+
3+
data: {"type":"RUN_STARTED","threadId":"thread-06-hitl-interrupt","runId":"83caa76f-b177-4c68-9b2b-ad1be07589e5"}
4+
5+
data: {"type":"TEXT_MESSAGE_START","messageId":"1ac8f18f-4d6c-4cc8-8165-5ad820c437b8","role":"assistant"}
6+
7+
data: {"type":"TOOL_CALL_START","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","toolCallName":"generate_task_steps","parentMessageId":"1ac8f18f-4d6c-4cc8-8165-5ad820c437b8"}
8+
9+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"{\""}
10+
11+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"steps"}
12+
13+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":["}
14+
15+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"{\""}
16+
17+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
18+
19+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
20+
21+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Choose"}
22+
23+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" design"}
24+
25+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
26+
27+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
28+
29+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
30+
31+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
32+
33+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
34+
35+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
36+
37+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
38+
39+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Gather"}
40+
41+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" materials"}
42+
43+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
44+
45+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
46+
47+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
48+
49+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
50+
51+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
52+
53+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
54+
55+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
56+
57+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Cut"}
58+
59+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" wood"}
60+
61+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" pieces"}
62+
63+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
64+
65+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
66+
67+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
68+
69+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
70+
71+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
72+
73+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
74+
75+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
76+
77+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"As"}
78+
79+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"semble"}
80+
81+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" walls"}
82+
83+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
84+
85+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
86+
87+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
88+
89+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
90+
91+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
92+
93+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
94+
95+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
96+
97+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Attach"}
98+
99+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" base"}
100+
101+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
102+
103+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
104+
105+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
106+
107+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
108+
109+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
110+
111+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
112+
113+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
114+
115+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Add"}
116+
117+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" roof"}
118+
119+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
120+
121+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
122+
123+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
124+
125+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
126+
127+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
128+
129+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
130+
131+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
132+
133+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Dr"}
134+
135+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"ill"}
136+
137+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" entrance"}
138+
139+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" hole"}
140+
141+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
142+
143+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
144+
145+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
146+
147+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
148+
149+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
150+
151+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
152+
153+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
154+
155+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Sand"}
156+
157+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" surfaces"}
158+
159+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
160+
161+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
162+
163+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
164+
165+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
166+
167+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
168+
169+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
170+
171+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
172+
173+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Paint"}
174+
175+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" or"}
176+
177+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" stain"}
178+
179+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
180+
181+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
182+
183+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
184+
185+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
186+
187+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"},{\""}
188+
189+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"description"}
190+
191+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
192+
193+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"Install"}
194+
195+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" hang"}
196+
197+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"ers"}
198+
199+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" or"}
200+
201+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":" hooks"}
202+
203+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\",\""}
204+
205+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"status"}
206+
207+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\":\""}
208+
209+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"enabled"}
210+
211+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"\"}"}
212+
213+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","delta":"]}"}
214+
215+
data: {"type":"CUSTOM","name":"usage","value":{"input_token_count":390,"output_token_count":113,"total_token_count":503,"completion/reasoning_tokens":0,"reasoning_output_token_count":0,"prompt/cached_tokens":0,"cache_read_input_token_count":0}}
216+
217+
data: {"type":"TOOL_CALL_END","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ"}
218+
219+
data: {"type":"CUSTOM","name":"function_approval_request","value":{"id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","function_call":{"call_id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","name":"generate_task_steps","arguments":{"steps":[{"description":"Choose design","status":"enabled"},{"description":"Gather materials","status":"enabled"},{"description":"Cut wood pieces","status":"enabled"},{"description":"Assemble walls","status":"enabled"},{"description":"Attach base","status":"enabled"},{"description":"Add roof","status":"enabled"},{"description":"Drill entrance hole","status":"enabled"},{"description":"Sand surfaces","status":"enabled"},{"description":"Paint or stain","status":"enabled"},{"description":"Install hangers or hooks","status":"enabled"}]}}}}
220+
221+
data: {"type":"TOOL_CALL_START","toolCallId":"171b2e37-ad9b-4e41-9cfe-d051602195d5","toolCallName":"confirm_changes","parentMessageId":"1ac8f18f-4d6c-4cc8-8165-5ad820c437b8"}
222+
223+
data: {"type":"TOOL_CALL_ARGS","toolCallId":"171b2e37-ad9b-4e41-9cfe-d051602195d5","delta":"{\"function_name\": \"generate_task_steps\", \"function_call_id\": \"call_VlNsrwdW5hhp2G8Ufp6i8ueQ\", \"function_arguments\": {\"steps\": [{\"description\": \"Choose design\", \"status\": \"enabled\"}, {\"description\": \"Gather materials\", \"status\": \"enabled\"}, {\"description\": \"Cut wood pieces\", \"status\": \"enabled\"}, {\"description\": \"Assemble walls\", \"status\": \"enabled\"}, {\"description\": \"Attach base\", \"status\": \"enabled\"}, {\"description\": \"Add roof\", \"status\": \"enabled\"}, {\"description\": \"Drill entrance hole\", \"status\": \"enabled\"}, {\"description\": \"Sand surfaces\", \"status\": \"enabled\"}, {\"description\": \"Paint or stain\", \"status\": \"enabled\"}, {\"description\": \"Install hangers or hooks\", \"status\": \"enabled\"}]}, \"steps\": [{\"description\": \"Execute generate_task_steps\", \"status\": \"enabled\"}]}"}
224+
225+
data: {"type":"TOOL_CALL_END","toolCallId":"171b2e37-ad9b-4e41-9cfe-d051602195d5"}
226+
227+
data: {"type":"TEXT_MESSAGE_END","messageId":"1ac8f18f-4d6c-4cc8-8165-5ad820c437b8"}
228+
229+
data: {"type":"MESSAGES_SNAPSHOT","messages":[{"id":"4b79402e-e291-42bb-be55-ccacb46ddb38","role":"user","content":"Plan the task: build a birdhouse."},{"id":"1ac8f18f-4d6c-4cc8-8165-5ad820c437b8","role":"assistant","toolCalls":[{"id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","type":"function","function":{"name":"generate_task_steps","arguments":"{\"steps\":[{\"description\":\"Choose design\",\"status\":\"enabled\"},{\"description\":\"Gather materials\",\"status\":\"enabled\"},{\"description\":\"Cut wood pieces\",\"status\":\"enabled\"},{\"description\":\"Assemble walls\",\"status\":\"enabled\"},{\"description\":\"Attach base\",\"status\":\"enabled\"},{\"description\":\"Add roof\",\"status\":\"enabled\"},{\"description\":\"Drill entrance hole\",\"status\":\"enabled\"},{\"description\":\"Sand surfaces\",\"status\":\"enabled\"},{\"description\":\"Paint or stain\",\"status\":\"enabled\"},{\"description\":\"Install hangers or hooks\",\"status\":\"enabled\"}]}"}},{"id":"171b2e37-ad9b-4e41-9cfe-d051602195d5","type":"function","function":{"name":"confirm_changes","arguments":"{\"function_name\": \"generate_task_steps\", \"function_call_id\": \"call_VlNsrwdW5hhp2G8Ufp6i8ueQ\", \"function_arguments\": {\"steps\": [{\"description\": \"Choose design\", \"status\": \"enabled\"}, {\"description\": \"Gather materials\", \"status\": \"enabled\"}, {\"description\": \"Cut wood pieces\", \"status\": \"enabled\"}, {\"description\": \"Assemble walls\", \"status\": \"enabled\"}, {\"description\": \"Attach base\", \"status\": \"enabled\"}, {\"description\": \"Add roof\", \"status\": \"enabled\"}, {\"description\": \"Drill entrance hole\", \"status\": \"enabled\"}, {\"description\": \"Sand surfaces\", \"status\": \"enabled\"}, {\"description\": \"Paint or stain\", \"status\": \"enabled\"}, {\"description\": \"Install hangers or hooks\", \"status\": \"enabled\"}]}, \"steps\": [{\"description\": \"Execute generate_task_steps\", \"status\": \"enabled\"}]}"}}]}]}
230+
231+
data: {"type":"RUN_FINISHED","threadId":"thread-06-hitl-interrupt","runId":"83caa76f-b177-4c68-9b2b-ad1be07589e5","outcome":{"type":"interrupt","interrupts":[{"id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","reason":"tool_call","message":"Approve running generate_task_steps?","toolCallId":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","responseSchema":{"type":"object","properties":{"approved":{"type":"boolean","description":"Whether the requested tool call is approved."},"accepted":{"type":"boolean","description":"Legacy alias for approved."},"steps":{"type":"array","description":"Optional edited value for the 'steps' tool argument."},"editedArgs":{"type":"object","description":"Full replacement of the tool arguments. Not merged.","properties":{"steps":{"type":"array"}},"required":["steps"],"additionalProperties":false}},"anyOf":[{"required":["approved"]},{"required":["accepted"]}],"additionalProperties":false},"metadata":{"agent_framework":{"type":"function_approval_request","function_call":{"call_id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","name":"generate_task_steps","arguments":{"steps":[{"description":"Choose design","status":"enabled"},{"description":"Gather materials","status":"enabled"},{"description":"Cut wood pieces","status":"enabled"},{"description":"Assemble walls","status":"enabled"},{"description":"Attach base","status":"enabled"},{"description":"Add roof","status":"enabled"},{"description":"Drill entrance hole","status":"enabled"},{"description":"Sand surfaces","status":"enabled"},{"description":"Paint or stain","status":"enabled"},{"description":"Install hangers or hooks","status":"enabled"}]}},"value":{"type":"function_approval_request","function_call":{"call_id":"call_VlNsrwdW5hhp2G8Ufp6i8ueQ","name":"generate_task_steps","arguments":{"steps":[{"description":"Choose design","status":"enabled"},{"description":"Gather materials","status":"enabled"},{"description":"Cut wood pieces","status":"enabled"},{"description":"Assemble walls","status":"enabled"},{"description":"Attach base","status":"enabled"},{"description":"Add roof","status":"enabled"},{"description":"Drill entrance hole","status":"enabled"},{"description":"Sand surfaces","status":"enabled"},{"description":"Paint or stain","status":"enabled"},{"description":"Install hangers or hooks","status":"enabled"}]}}}}}}]}}
232+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
data: {"type":"RUN_STARTED","threadId":"thread-hitl-1","runId":"run-hitl-1"}
2+
3+
data: {"type":"CUSTOM","name":"on_interrupt","value":"{\"type\":\"mastra_suspend\",\"toolCallId\":\"call_Foj4SpskZ2aqeqPgqsm4FYq1\",\"toolName\":\"schedule_meeting\",\"suspendPayload\":{\"topic\":\"Meeting with Dana about the Q4 roadmap\"},\"args\":{\"topic\":\"Meeting with Dana about the Q4 roadmap\"},\"resumeSchema\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"chosen_time\\\":{\\\"type\\\":\\\"string\\\"},\\\"cancelled\\\":{\\\"type\\\":\\\"boolean\\\"}},\\\"additionalProperties\\\":false,\\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\"}\",\"runId\":\"run-hitl-1\"}"}
4+
5+
data: {"type":"RUN_FINISHED","threadId":"thread-hitl-1","runId":"run-hitl-1","outcome":{"type":"interrupt","interrupts":[{"id":"run-hitl-1::call_Foj4SpskZ2aqeqPgqsm4FYq1","reason":"mastra:tool_suspend","toolCallId":"call_Foj4SpskZ2aqeqPgqsm4FYq1","responseSchema":{"type":"object","properties":{"chosen_time":{"type":"string"},"cancelled":{"type":"boolean"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"},"metadata":{"mastra":{"type":"mastra_suspend","toolName":"schedule_meeting","suspendPayload":{"topic":"Meeting with Dana about the Q4 roadmap"},"args":{"topic":"Meeting with Dana about the Q4 roadmap"},"resumeSchema":"{\"type\":\"object\",\"properties\":{\"chosen_time\":{\"type\":\"string\"},\"cancelled\":{\"type\":\"boolean\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}","runId":"run-hitl-1"}}}]}}
6+

0 commit comments

Comments
 (0)