Skip to content

Commit d98bda6

Browse files
committed
fix(cursor): address PR review feedback
- Remove redundant Array.isArray guards in list_artifacts.ts - Pass through actual HTTP status on presigned URL download failure instead of hardcoded 400
1 parent edb2461 commit d98bda6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

apps/sim/app/api/tools/cursor/download-artifact/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ export async function POST(request: NextRequest) {
103103
statusText: downloadResponse.statusText,
104104
})
105105
return NextResponse.json(
106-
{ success: false, error: 'Failed to download artifact content' },
107-
{ status: 400 }
106+
{
107+
success: false,
108+
error: `Failed to download artifact content (${downloadResponse.status}: ${downloadResponse.statusText})`,
109+
},
110+
{ status: downloadResponse.status }
108111
)
109112
}
110113

apps/sim/tools/cursor/list_artifacts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export const listArtifactsTool: ToolConfig<ListArtifactsParams, ListArtifactsRes
4141
return {
4242
success: true,
4343
output: {
44-
content: `Found ${Array.isArray(artifacts) ? artifacts.length : 0} artifact(s)`,
44+
content: `Found ${artifacts.length} artifact(s)`,
4545
metadata: {
46-
artifacts: Array.isArray(artifacts) ? artifacts : [],
46+
artifacts,
4747
},
4848
},
4949
}

0 commit comments

Comments
 (0)