Conversation
Coverage Report for CI Build 25250232678Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Warning No base build found for commit Coverage: 98.211%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a2ac8f5. Configure here.
| copiedValue = body | ||
| } | ||
| clipboardy.writeSync(JSON.stringify(copiedValue, null, 2)) | ||
| toClipboard(JSON.parse(bodyText), flags) |
There was a problem hiding this comment.
Copy with non-JSON body crashes without try-catch
Medium Severity
toClipboard(JSON.parse(bodyText), flags) will throw when bodyText isn't valid JSON (e.g., data URIs, image buffers, or text/plain responses) and --copy is used. The previous implementation wrapped JSON.parse(body) in a try-catch, falling back to the raw body on parse failure. That safety net was removed in this rewrite.
Reviewed by Cursor Bugbot for commit a2ac8f5. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 3e95b41. Configure here.
| copiedValue = body | ||
| } | ||
| clipboardy.writeSync(JSON.stringify(copiedValue, null, 2)) | ||
| toClipboard(JSON.parse(bodyText), flags) |
There was a problem hiding this comment.
Missing try-catch crashes copy for non-JSON responses
High Severity
JSON.parse(bodyText) in the flags.copy path will throw a SyntaxError when the response body is not valid JSON. This applies to base64 data URIs, images, text/plain, and text/html responses — all of which reach this line in the pretty-mode flow. The old code had a try-catch that gracefully fell back to the raw body when parsing failed; that guard was removed in this refactor.
Reviewed by Cursor Bugbot for commit 3e95b41. Configure here.


Note
Medium Risk
Changes the CLI’s primary request/response and rendering flow (spinner, output formatting, clipboard behavior), which may affect existing scripts and terminal output expectations. Adds optional JSON serialization that includes request metadata and can expose full API keys when
--json-fullis used.Overview
Adds
--jsonand--json-fullflags to emit a serialized request + response JSON payload (with API key masked by default) and updateshelp/examples accordingly.Refactors
src/api.jsoutput flow to choose between buffered rendering vs JSON mode, measures duration explicitly, normalizes header handling, and centralizes clipboard/header/pretty-print helpers in newsrc/util.jsandsrc/print-json.js.Updates defaults to auto-detect colorized output (removing the explicit
--colorsflag), switches error printing toprint-text, pinsavato v7, and adds comprehensive AVA test coverage for the new flags and refactors.Reviewed by Cursor Bugbot for commit 3e95b41. Bugbot is set up for automated code reviews on this repo. Configure here.