oven-sh/bun · error

args must yield an array of {file,count,diagPath}

Error message

args must yield an array of {file,count,diagPath}

What it means

Error "args must yield an array of {file,count,diagPath}" thrown in oven-sh/bun.

Source

Thrown at scripts/clippy-loop/edit-round.workflow.ts:13

export const meta = {
  name: "dead-code-edit-round",
  description: "Per-file direct-edit dead-code fixer + 1-reviewer gate",
  phases: [
    { title: "Edit", detail: "agent edits one file directly (no cargo/git/cross-file)" },
    { title: "Review", detail: "1 adversarial reviewer reads the diff" },
  ],
};

// args: Array<{file,count,diagPath}> or {files:[...]} or JSON string of either
const parsed = typeof args === "string" ? JSON.parse(args) : args;
const files = Array.isArray(parsed) ? parsed : parsed.files;
if (!Array.isArray(files)) throw new Error("args must yield an array of {file,count,diagPath}");

const RESULT_SCHEMA = {
  type: "object",
  required: ["status", "summary"],
  properties: {
    status: { type: "string", enum: ["fixed", "skipped", "partial"] },
    summary: { type: "string" },
  },
  additionalProperties: false,
};

const REVIEW_SCHEMA = {
  type: "object",
  required: ["verdict", "notes"],
  properties: {
    verdict: { type: "string", enum: ["ok", "revert", "fix-needed"] },
    notes: { type: "string" },
  },

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at scripts/clippy-loop/edit-round.workflow.ts:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/f6b4b16236f4ac5a. Report an issue: GitHub.