Visitar URL original
[aw] Monthly PR Clusters experienced an engine outage · Issue #590 · githubnext/rig · GitHub
Skip to content

[aw] Monthly PR Clusters experienced an engine outage #590

Description

@github-actions

Workflow Failure

Workflow: Monthly PR Clusters
Branch: main
Run: https://github.com/githubnext/rig/actions/runs/37754089824

Warning

Repeated Permission Denied: The agent was denied permission to run 4 command(s) and stopped retrying.

Denied Commands:

  • shell(find /home/runner/work/rig/rig -type f -name "*.md" | head -20)
  • shell(jq '.window, (.prs | length)' /tmp/gh-aw/agent/merged-prs.json)
  • shell(rm /tmp/gh-aw/agent/cluster-rig.ts)
  • shell(printf '%s\n' 'import { agent, s, workflow } from "rig"; | shell(python3 << 'EOF'
How to fix this

The agent ran in non-interactive mode (--no-ask-user) and could not request permission at runtime.

To resolve repeated permission denied errors, update the workflow prompt to avoid these commands or use approved alternatives. Use the following prompt with any coding agent:

The agentic workflow monthly-pr-clusters encountered repeated permission denied errors for these commands:
`shell(find /home/runner/work/rig/rig -type f -name "*.md" | head -20)`, `shell(jq '.window, (.prs | length)' /tmp/gh-aw/agent/merged-prs.json)`, `shell(rm /tmp/gh-aw/agent/cluster-rig.ts)`, `shell(printf '%s\n' 'import { agent, s, workflow } from "rig"; | shell(python3 << 'EOF'`

Please update the workflow prompt so the agent:
1. Uses built-in tools (GitHub API, file read/write) instead of the denied shell commands
2. Or achieves the same goal through alternative approaches that do not require shell permission

Warning

Task Could Not Be Completed: The agent reported that the task could not be performed due to an infrastructure or tool failure.

Error details:
engine_driver_failure
Agent finished without emitting a terminal safe output; task completion could not be confirmed.
skill: {"message":"Skill not found: rig","code":"failure"}
bash: find /home/runner/work/rig/rig -type f -name "*.md" | head -20: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
bash: jq '.window, (.prs | length)' /tmp/gh-aw/agent/merged-prs.json: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
bash: rm /tmp/gh-aw/agent/cluster-rig.ts: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
bash: cd /home/runner/work/rig/rig && node skills/rig/run.ts --typecheck < /tmp/gh-aw/agent/cluster-rig-v2.ts 2>&1: {"content":"Error: Typecheck failed for (stdin).\n.tmp/rig-stdin-Q648CR/program.ts(2,1): error TS6133: 'fs' is declared but its value is never read.\n    at typecheckProgram ((redacted)    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async runProgramCodeFromStdin ((redacted)    at async run ((redacted)    at async runLauncherCli ((redacted)    at async runInstalledSkill ((redacted) 10 completed with exit code 1)"}
bash: cd /home/runner/work/rig/rig && node skills/rig/run.ts --typecheck < /tmp/gh-aw/agent/cluster-workflow.ts 2>&1: {"content":"Error: Typecheck failed for (stdin).\n.tmp/rig-stdin-Mf0b0Y/program.ts(1,17): error TS6133: 'p' is declared but its value is never read.\n.tmp/rig-stdin-Mf0b0Y/program.ts(54,17): error TS2322: Type '(i: any) => string' is not assignable to type 'string | PromptBuilder | undefined'.\n.tmp/rig-stdin-Mf0b0Y/program.ts(54,18): error TS7006: Parameter 'i' implicitly has an 'any' type.\n.tmp/rig-stdin-Mf0b0Y/program.ts(60,14): error TS7006: Parameter 'p' implicitly has an 'any' type.\n    at typecheckProgram ((redacted)    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async runProgramCodeFromStdin ((redacted)    at async run ((redacted)    at async runLauncherCli ((redacted)    at async runInstalledSkill ((redacted) 12 completed with exit code 1)"}
bash: printf '%s\n' 'import { agent, s, workflow } from "rig";

interface PRData {
  number: number;
  title: string;
  body: string;
  labels: string[];
  url: string;
}

interface Window {
  start: string;
  end: string;
}

interface ClusterResult {
  repository: string;
  window: Window;
  strategy: string;
  strategyDescription: string;
  clusters: Array<{
    id: string;
    theme: string;
    size: number;
    prs: number[];
    percentage: number;
  }>;
  unclassified: number;
  unclassifiedPRs: number[];
  allPRs: number[];
}

// Agent role: classify a batch of PRs into themes based on semantic analysis
const classifyBatch = agent({
  name: "classifyBatch",
  model: "small",
  input: s.object({
    prs: s.array(
      s.object({
        number: s.int,
        title: s.string,
        snippet: s.string,
      })
    ),
    existingThemes: s.array(s.string),
  }),
  output: s.array(
    s.object({
      prNumber: s.int,
      theme: s.string,
      confidence: s.number,
    })
  ),
  instructions: `Classify each PR into one of the provided themes or identify a new coherent theme.
Try to reuse existing themes when appropriate. Group related PRs together.
Return an array with prNumber, assigned theme, and confidence (0-1).`,
});

// Workflow role: orchestrate PR clustering using iterative theme discovery
const prClusteringWorkflow = workflow({
  meta: {
    name: "prClusterer",
    description: "Cluster merged PRs using graph-based theme discovery",
    phases: ["Load", "Discover", "Classify", "Finalize"],
  },
  body: async ({ call, phase }) => {
    phase("Load");

    const cwd = process.cwd();
    const dataPath = `${cwd}/tmp/gh-aw/agent/merged-prs.json`;
    let prs: PRData[] = [];
    let window: Window = { start: "", end: "" };
    let repository = "";

    try {
      const fs = await import("node:fs");
      const rawData = JSON.parse(fs.readFileSync(dataPath, "utf-8"));
      prs = rawData.prs || [];
      window = rawData.window || {};
      repository = rawData.repository || "";
    } catch (e) {
      return {
        repository: "githubnext/rig",
        window: { start: "", end: "" },
        strategy: "graph-clustering",
        strategyDescription: "Failed to load PR data",
        clusters: [],
        unclassified: 0,
        unclassifiedPRs: [],
        allPRs: [],
      };
    }

    if (!prs || prs.length === 0) {
      return {
        repository,
        window,
        strategy: "graph-clustering",
        strategyDescription: "No PRs found in corpus",
        clusters: [],
        unclassified: 0,
        unclassifiedPRs: [],
        allPRs: [],
      };
    }

    phase("Discover");

    const themes: string[] = [];
    const prThemeMap: Record(number, string) = {};

    const batchSize = 10;
    const batches: typeof prs[] = [];
    for (let i = 0; i < prs.length; i += batchSize) {
      batches.push(prs.slice(i, i + batchSize));
    }

    for (let batchIdx = 0; batchIdx < batches.length; batchIdx++) {
      const batch = batches[batchIdx];
      phase("Classify");

      const result = await call(classifyBatch, {
        prs: batch.map((p) => ({
          number: p.number,
          title: p.title,
          snippet: p.body.substring(0, 200),
        })),
        existingThemes: themes,
      });

      if (!Array.isArray(result)) continue;

      for (const item of result) {
        if (!themes.includes(item.theme)) {
          themes.push(item.theme);
        }
        if (item.confidence >= 0.5) {
          prThemeMap[item.prNumber] = item.theme;
        }
      }
    }

    phase("Finalize");

    const themeClusters: Record(string, number[]) = {};
    for (const theme of themes) {
      themeClusters[theme] = [];
    }

    for (const [prNum, theme] of Object.entries(prThemeMap)) {
      themeClusters[theme].push(parseInt(prNum));
    }

    const classifiedPRs = new Set(Object.keys(prThemeMap).map((n) => parseInt(n)));
    const unclassifiedPRs = prs.map((p) => p.number).filter((n) => !classifiedPRs.has(n));

    const clusterArray = Object.entries(themeClusters)
      .map(([theme, prNumbers]) => ({
        id: theme.toLowerCase().replace((s/redacted)+/g, "-"),
        theme,
        size: prNumbers.length,
        prs: prNumbers.sort((a, b) => a - b),
        percentage: (prNumbers.length / prs.length) * 100,
      }))
      .filter((c) => c.size > 0)
      .sort((a, b) => b.size - a.size || a.id.localeCompare(b.id))
      .slice(0, 4);

    return {
      repository,
      window,
      strategy: "graph-clustering",
      strategyDescription:
        "Iteratively discovers themes by analyzing PR batches, extracting keywords and semantic patterns, then groups PRs by shared thematic coherence using multi-turn agent classification.",
      clusters: clusterArray,
      unclassified: unclassifiedPRs.length,
      unclassifiedPRs: unclassifiedPRs.sort((a, b) => a - b),
      allPRs: prs.map((p) => p.number).sort((a, b) => a - b),
    } as ClusterResult;
  },
});

export default prClusteringWorkflow;' | node /home/runner/work/rig/rig/skills/rig/run.ts 2>&1 | tee /tmp/gh-aw/agent/cluster-output.txt: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow too
[Content truncated due to length]

This is a structured incompletion signal (report_incomplete), not a real task outcome. Any other safe outputs emitted alongside this signal (e.g., comments) describe the failure state, not a completed review or action.

Action Required

Assign this issue to an agent to debug and fix the issue.

Debug with any coding agent

Use this prompt with any coding agent (GitHub Copilot, Claude, Gemini, etc.):

Debug the agentic workflow failure using https://raw.githubusercontent.com/github/gh-aw/main/debug.md

The failed workflow run is at https://github.com/githubnext/rig/actions/runs/37754089824
Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

Tip

Stop reporting this workflow as a failure

To stop a workflow from creating failure issues, set report-failure-as-issue: false in its frontmatter:

safe-outputs:
  report-failure-as-issue: false

Generated from Monthly PR Clusters · copilot · 28 AIC · ◷

  • expires on Oct 15, 2026, 9:11 AM UTC

Activity

  1. github-actions commented on Oct 9, 2026

    @github-actions
    ContributorAuthor

    Agent job 37908857183 failed.

    Warning

    Repeated Permission Denied: The agent was denied permission to run 2 command(s) and stopped retrying.

    Denied Commands:

    • shell(cat /tmp/gh-aw/agent/merged-prs.json | jq '.prs | length' && cat /tmp/gh-aw/agent/merged-prs.json | jq '.window')
    • shell(python3 << 'EOF' | shell(rm /tmp/gh-aw/agent/pr-cluster-label-strategy.ts) | shell(cat > /tmp/gh-aw/agent/cluster-rig.ts << 'EOF' | shell(cd /tmp/gh-aw/agent && ls -la *.ts 2>/dev/null | head -20)
    How to fix this

    The agent ran in non-interactive mode (--no-ask-user) and could not request permission at runtime.

    To resolve repeated permission denied errors, update the workflow prompt to avoid these commands or use approved alternatives. Use the following prompt with any coding agent:

    The agentic workflow monthly-pr-clusters encountered repeated permission denied errors for these commands:
    `shell(cat /tmp/gh-aw/agent/merged-prs.json | jq '.prs | length' && cat /tmp/gh-aw/agent/merged-prs.json | jq '.window')`, `shell(python3 << 'EOF' | shell(rm /tmp/gh-aw/agent/pr-cluster-label-strategy.ts) | shell(cat > /tmp/gh-aw/agent/cluster-rig.ts << 'EOF' | shell(cd /tmp/gh-aw/agent && ls -la *.ts 2>/dev/null | head -20)`
    
    Please update the workflow prompt so the agent:
    1. Uses built-in tools (GitHub API, file read/write) instead of the denied shell commands
    2. Or achieves the same goal through alternative approaches that do not require shell permission
    

    Warning

    Task Could Not Be Completed: The agent reported that the task could not be performed due to an infrastructure or tool failure.

    Error details:
    engine_driver_failure
    Agent finished without emitting a terminal safe output; task completion could not be confirmed.
    skill: {"message":"Skill not found: rig","code":"failure"}
    bash: cat /tmp/gh-aw/agent/merged-prs.json | jq '.prs | length' && cat /tmp/gh-aw/agent/merged-prs.json | jq '.window': {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
    bash: python3 << 'EOF'
    import json
    with open('/tmp/gh-aw/agent/merged-prs.json') as f:
        data = json.load(f)
    print(f"PR count: {len(data['prs'])}")
    print(f"Window: {data['window']}")
    print(f"Repository: {data['repository']}")
    EOF: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
    bash: cd /home/runner/work/rig/rig && node skills/rig/run.ts --typecheck < /tmp/gh-aw/agent/pr-cluster-label-strategy.ts 2>&1: {"content":"Error: Typecheck failed for (stdin).\n.tmp/rig-stdin-E0dcKd/program.ts(51,3): error TS2769: No overload matches this call.\n  Overload 1 of 2, '(spec: WorkflowSpec(unknown, unknown)): Workflow(unknown, unknown)', gave the following error.\n    Property 'name' is missing in type '{ description: string; }' but required in type 'WorkflowMeta'.\n  Overload 2 of 2, '(spec: WorkflowWithoutInputSpec(unknown)): Workflow(undefined, unknown)', gave the following error.\n    Property 'name' is missing in type '{ description: string; }' but required in type 'WorkflowMeta'.\n.tmp/rig-stdin-E0dcKd/program.ts(58,46): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'string | PromptIntent | PromptBuilder'.\n.tmp/rig-stdin-E0dcKd/program.ts(62,16): error TS7006: Parameter 'pr' implicitly has an 'any' type.\n.tmp/rig-stdin-E0dcKd/program.ts(67,19): error TS18047: 'themes' is possibly 'null'.\n.tmp/rig-stdin-E0dcKd/program.ts(84,7): error TS2554: Expected 1 arguments, but got 2.\n.tmp/rig-stdin-E0dcKd/program.ts(98,5): error TS18047: 'themes' is possibly 'null'.\n.tmp/rig-stdin-E0dcKd/program.ts(110,11): error TS18046: 'c' is of type 'unknown'.\n.tmp/rig-stdin-E0dcKd/program.ts(111,27): error TS18046: 'c' is of type 'unknown'.\n.tmp/rig-stdin-E0dcKd/program.ts(112,33): error TS18046: 'c' is of type 'unknown'.\n.tmp/rig-stdin-E0dcKd/program.ts(113,24): error TS18046: 'c' is of type 'unknown'.\n.tmp/rig-stdin-E0dcKd/program.ts(113,45): error TS18046: 'c' is of type 'unknown'.\n.tmp/rig-stdin-E0dcKd/program.ts(127,43): error TS7006: Parameter 'p' implicitly has an 'any' type.\n    at typecheckProgram ((redacted)    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async runProgramCodeFromStdin ((redacted)    at async run ((redacted)    at async runLauncherCli ((redacted)    at async runInstalledSkill ((redacted) 7 completed with exit code 1)"}
    bash: cd /home/runner/work/rig/rig && node skills/rig/run.ts --typecheck < /tmp/gh-aw/agent/pr-cluster-label-strategy.ts 2>&1: {"content":"Error: Typecheck failed for (stdin).\n.tmp/rig-stdin-S11Kd8/program.ts(72,7): error TS2345: Argument of type '(() => Promise<{ themeId?: string; themeName?: string; justification?: string; prNumber: number; } | { prNumber: number; themeId: string; themeName: string; justification: string; }>)[]' is not assignable to parameter of type 'readonly (() => { prNumber: number; themeId: string; themeName: string; justification: string; } | Promise<{ prNumber: number; themeId: string; themeName: string; justification: string; }>)[]'.\n  Type '() => Promise<{ themeId?: string; themeName?: string; justification?: string; prNumber: number; } | { prNumber: number; themeId: string; themeName: string; justification: string; }>' is not assignable to type '() => { prNumber: number; themeId: string; themeName: string; justification: string; } | Promise<{ prNumber: number; themeId: string; themeName: string; justification: string; }>'.\n    Type 'Promise<{ themeId?: string; themeName?: string; justification?: string; prNumber: number; } | { prNumber: number; themeId: string; themeName: string; justification: string; }>' is not assignable to type '{ prNumber: number; themeId: string; themeName: string; justification: string; } | Promise<{ prNumber: number; themeId: string; themeName: string; justification: string; }>'.\n      Type 'Promise<{ themeId?: string; themeName?: string; justification?: string; prNumber: number; } | { prNumber: number; themeId: string; themeName: string; justification: string; }>' is not assignable to type 'Promise<{ prNumber: number; themeId: string; themeName: string; justification: string; }>'.\n        Type '{ themeId?: string; themeName?: string; justification?: string; prNumber: number; } | { prNumber: number; themeId: string; themeName: string; justification: string; }' is not assignable to type '{ prNumber: number; themeId: string; themeName: string; justification: string; }'.\n          Type '{ themeId?: string; themeName?: string; justification?: string; prNumber: number; }' is not assignable to type '{ prNumber: number; themeId: string; themeName: string; justification: string; }'.\n            Property 'themeId' is optional in type '{ themeId?: string; themeName?: string; justification?: string; prNumber: number; }' but required in type '{ prNumber: number; themeId: string; themeName: string; justification: string; }'.\n    at typecheckProgram ((redacted)    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async runProgramCodeFromStdin ((redacted)    at async run ((redacted)    at async runLauncherCli ((redacted)    at async runInstalledSkill ((redacted) 8 completed with exit code 1)"}
    create: {"message":"Path already exists","code":"failure"}
    bash: rm /tmp/gh-aw/agent/pr-cluster-label-strategy.ts: {"message":"The user rejected this tool call. User feedback: Tool invocation is not allowed by workflow tool permissions.","code":"denied"}
    bash: cat > /tmp/gh-aw/agent/cluster-rig.ts << 'EOF'
    import { agent, workflow, p, s } from "rig";
    
    // Agent role: analyze PR labels and identify cluster themes.
    const analyzeLabels = agent({
      model: "small",
      instructions: p`Analyze these PR labels and identify 3-4 dominant cluster themes:
    
    ${p.read("/tmp/gh-aw/agent/merged-prs.json")}
    
    For each theme, describe what it represents and which labels are primary indicators.`,
      output: s.array(
        s.object({
          themeId: s.string,
          themeName: s.string,
          description: s.string,
          primaryLabels: s.array(s.string),
        })
      ),
    });
    
    // Agent role: classify a PR into one of the discovered themes.
    const classifyPR = agent({
      model: "small",
      input: s.object({
        prNumber: s.int,
        prTitle: s.string,
        prLabels: s.array(s.string),
        themes: s.array(
          s.object({
            themeId: s.string,
            themeName: s.string,
            primaryLabels: s.array(s.string),
          })
        ),
      }),
      instructions: p`Classify this PR into one of the available themes:
    
    PR #${p.readInput("prNumber")}: ${p.readInput("prTitle")}
    Labels: ${p.readInput("prLabels")}
    
    Themes: ${p.readInput("themes")}
    
    Return the themeId that best matches.`,
      output: s.object({
        themeId: s.string,
      }),
    });
    
    // Workflow role: orchestrate theme discovery and PR classification.
    export default workflow({
      meta: { name: "label-cluster", description: "Label-based PR clustering" },
      body: async ({ call, parallel }) => {
        const fs = require("node:fs");
        const data = JSON.parse(
          fs.readFileSyn
    [Content truncated due to length]
    

    This is a structured incompletion signal (report_incomplete), not a real task outcome. Any other safe outputs emitted alongside this signal (e.g., comments) describe the failure state, not a completed review or action.

    Generated from Monthly PR Clusters · copilot · 17.3 AIC · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions