File tree Expand file tree Collapse file tree
apps/sim/components/assistant-actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,14 +150,14 @@ export function AssistantActionReviewProvider({
150150 messageReceiptIds . set (
151151 message . id ,
152152 new Set (
153- message . contentBlocks ?. flatMap ( ( { toolCall } ) =>
154- toolCall &&
155- getToolMetadata ( toolCall . name ) ?. assistant &&
156- ( getToolMetadata ( toolCall . name ) ?. effect === 'write' ||
157- toolCall . status === ToolCallStatus . awaiting_approval )
153+ message . contentBlocks ?. flatMap ( ( { toolCall } ) => {
154+ const metadata = toolCall && getToolMetadata ( toolCall . name )
155+ return toolCall &&
156+ metadata ?. assistant &&
157+ ( metadata . effect === 'write' || toolCall . status === ToolCallStatus . awaiting_approval )
158158 ? [ toolCall . id ]
159159 : [ ]
160- )
160+ } )
161161 )
162162 )
163163 const messageStreamId =
@@ -175,9 +175,11 @@ export function AssistantActionReviewProvider({
175175 }
176176 turn . messageId = message . id
177177 for ( const { toolCall } of message . contentBlocks ?? [ ] ) {
178- if ( ! toolCall || ! getToolMetadata ( toolCall . name ) ?. assistant ) continue
178+ if ( ! toolCall ) continue
179+ const metadata = getToolMetadata ( toolCall . name )
180+ if ( ! metadata ?. assistant ) continue
179181 turn . representedIds . add ( toolCall . id )
180- if ( getToolMetadata ( toolCall . name ) ? .effect === 'write' ) turn . writeIds . add ( toolCall . id )
182+ if ( metadata . effect === 'write' ) turn . writeIds . add ( toolCall . id )
181183 if ( toolCall . status === ToolCallStatus . awaiting_approval ) turn . hasApprovalRows = true
182184 }
183185 turns . set ( messageStreamId , turn )
Original file line number Diff line number Diff line change 2020 * POST, the rest of function-valued verbs, and in-process operations are not judged here: their
2121 * effect comes from the tool's documented semantics. The `add-tools` skill lists the rules.
2222 *
23- * The tree was classified when this landed , so there is no baseline.
23+ * Every tool is already classified , so there is no baseline.
2424 *
2525 * Usage: bun run check:tool-effects
2626 */
You can’t perform that action at this time.
0 commit comments