Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion actions/setup/js/assign_agent_helpers.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ async function getPullRequestDetails(owner, repo, pullNumber) {
function logGraphQLErrorDetails(error, header, logFn) {
try {
if (!error || typeof error !== "object") return;
const err = /** @type {any} */ (error);
const err = /** @type {any} */ error;
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the parentheses from a JSDoc type cast breaks the cast entirely. In JSDoc, the correct syntax for a type cast/assertion is /** @type {T} */ (expr) — the parentheses are required for the cast to take effect. Without them, /** @type {any} */ error is just an inline comment and err retains its original type (unknown). As a result, accessing err.errors, err.response, and err.data further down will be flagged as errors by type checkers (TypeScript/Flow) in strict mode, since those properties don't exist on unknown.

Notice that line 422 uses the same pattern and has a // prettier-ignore comment specifically to prevent Prettier from removing these parentheses. The correct fix for line 250 is to add // prettier-ignore on the line before it, preserving the parenthesized cast, rather than letting Prettier strip the parentheses and silently break the type cast.

See below for a potential fix:

    // prettier-ignore
    const err = /** @type {any} */ (error);
    const details = {
      ...(err.errors && { errors: err.errors }),
      ...(err.response && { response: err.response }),
      ...(err.data && { data: err.data }),

Copilot uses AI. Check for mistakes.
const details = {
...(err.errors && { errors: err.errors }),
...(err.response && { response: err.response }),
Expand Down