Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const url = `${API_BASE_URL}${path}`; | ||
|
|
||
| const headers = { | ||
| Accept: "application/json", |
There was a problem hiding this comment.
CSV request sends incorrect Accept header
Medium Severity
The apiRequestText function sets Accept: "application/json" but is exclusively used for fetching CSV exports via getModelConnectionsCsv. This header tells the server the client wants JSON, not CSV. If the API server respects content negotiation, it may return JSON instead of CSV or return an error.
| landscapeId: string, | ||
| versionId: string, | ||
| connectionId: string | ||
| ): Promise<ModelConnectionResponse> { |
There was a problem hiding this comment.
getConnection has inconsistent signature lacking default versionId
Medium Severity
The getConnection function has an inconsistent API design compared to similar functions. It requires versionId as a mandatory second parameter without a default, while getModelObject, getModelConnections, and getModelConnectionsCsv all have versionId with a "latest" default. Additionally, getConnection places versionId before connectionId, whereas getModelObject places the object ID before versionId.
| } | ||
|
|
||
| throw new Error("Unexpected error in apiRequestText"); | ||
| } |
There was a problem hiding this comment.
Duplicated retry logic in apiRequest and apiRequestText
Low Severity
The apiRequest and apiRequestText functions contain nearly identical implementations (~70 lines each) with duplicated retry logic, timeout handling, abort signal management, and error handling. The only meaningful difference is the response parsing (JSON vs text). This duplication increases maintenance burden and risks inconsistent bug fixes.
I filled the read-side gap for connections and added the CSV export while I was there.
What I changed
Why I did it
Notes
Test plan
Note
Medium Risk
Adds new API client surface area and new MCP tools that can create/update/delete connections, so incorrect IDs/filters or API behavior could lead to unintended changes or noisy retries/timeouts.
Overview
Adds a new
icepanel-clientservice with a fetch wrapper (timeout, retry/backoff, base URL validation) plus typed helpers for querying/filtering IcePanel resources, including model connection list/get and CSV export endpoints.Introduces new MCP tools in
tools/connections.tsto list/get connections, optionally fuzzy-search and paginate results, export connections as CSV, and perform connection CRUD with consistent markdown/JSON formatting and API error messaging.Written by Cursor Bugbot for commit aaff924. This will update automatically on new commits. Configure here.
Recommended merge order