Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions actions/setup/js/handle_agent_failure.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function findPullRequestForCurrentBranch() {
*/
async function ensureParentIssue(previousParentNumber = null) {
const { owner, repo } = context.repo;
const parentTitle = "[agentics] Agentic Workflow Issues";
const parentTitle = "[agentic-workflows] Failed runs";
const parentLabel = "agentic-workflows";

core.info(`Searching for parent issue: "${parentTitle}"`);
Expand Down Expand Up @@ -99,9 +99,7 @@ async function ensureParentIssue(previousParentNumber = null) {
const creationReason = previousParentNumber ? `creating new parent (previous #${previousParentNumber} reached limit)` : "creating first parent";
core.info(`No suitable parent issue found, ${creationReason}`);

let parentBodyContent = `# Agentic Workflow Failures

This issue tracks all failures from agentic workflows in this repository. Each failed workflow run creates a sub-issue linked here for organization and easy filtering.`;
let parentBodyContent = `This issue tracks all failures from agentic workflows in this repository. Each failed workflow run creates a sub-issue linked here for organization and easy filtering.`;

// Add reference to previous parent if this is a continuation
if (previousParentNumber) {
Expand Down
6 changes: 3 additions & 3 deletions actions/setup/js/handle_agent_failure.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ When prompted, instruct the agent to debug this workflow failure.`;

// Verify parent issue was searched for
expect(mockGithub.rest.search.issuesAndPullRequests).toHaveBeenCalledWith({
q: expect.stringContaining('repo:test-owner/test-repo is:issue is:open label:agentic-workflows in:title "[agentics] Agentic Workflow Issues"'),
q: expect.stringContaining('repo:test-owner/test-repo is:issue is:open label:agentic-workflows in:title "[agentic-workflows] Failed runs"'),
per_page: 1,
});

// Verify parent issue was created
expect(mockGithub.rest.issues.create).toHaveBeenCalledWith({
owner: "test-owner",
repo: "test-repo",
title: "[agentics] Agentic Workflow Issues",
title: "[agentic-workflows] Failed runs",
body: expect.stringContaining("This issue tracks all failures from agentic workflows"),
labels: ["agentic-workflows"],
});
Expand Down Expand Up @@ -914,7 +914,7 @@ When prompted, instruct the agent to debug this workflow failure.`;

// Verify new parent issue was created with reference to old parent
const newParentCall = mockGithub.rest.issues.create.mock.calls[0][0];
expect(newParentCall.title).toBe("[agentics] Agentic Workflow Issues");
expect(newParentCall.title).toBe("[agentic-workflows] Failed runs");
expect(newParentCall.labels).toEqual(["agentic-workflows"]);
expect(newParentCall.body).toContain("continuation parent issue");
expect(newParentCall.body).toContain("previous parent issue #1");
Expand Down
Loading