From 60e9c8b6691fc09e1b526582b180efdfaf221444 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Feb 2026 01:34:57 +0000 Subject: [PATCH 1/2] fix: preserve indented checkbox states in PR Meta body sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parseCheckboxStates() and mergeCheckboxStates() only matched top-level checkboxes (^- \[), ignoring indented sub-tasks ( - \[). When PR Meta regenerated the PR body from the issue, auto-reconciled sub-task checkboxes were silently reverted to unchecked. This caused the keepalive loop to stall with rounds_without_task_completion: 8 despite the agent completing real work — PR #256 had 5 tasks auto-checked then immediately un-checked on every push. https://claude.ai/code/session_01JhCWWDJG8PqwaSbVPCGfm6 --- .github/scripts/agents_pr_meta_update_body.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/agents_pr_meta_update_body.js b/.github/scripts/agents_pr_meta_update_body.js index ec9a585a..3e987c10 100644 --- a/.github/scripts/agents_pr_meta_update_body.js +++ b/.github/scripts/agents_pr_meta_update_body.js @@ -404,7 +404,7 @@ function parseCheckboxStates(block) { if (inCodeBlock) { continue; } - const match = line.match(/^- \[(x| )\]\s*(.+)$/i); + const match = line.match(/^\s*- \[(x| )\]\s*(.+)$/i); if (match) { const checked = match[1].toLowerCase() === 'x'; const text = match[2].trim(); @@ -461,12 +461,13 @@ function mergeCheckboxStates(newContent, existingStates) { updated.push(line); continue; } - const match = line.match(/^- \[( )\]\s*(.+)$/); + const match = line.match(/^(\s*)- \[( )\]\s*(.+)$/); if (match) { - const text = match[2].trim(); + const indent = match[1]; + const text = match[3].trim(); const normalized = text.replace(/^-\s*/, '').trim().toLowerCase(); if (existingStates.has(normalized)) { - updated.push(`- [x] ${text}`); + updated.push(`${indent}- [x] ${text}`); continue; } } From a3d07a5e0d3aa320bcc15248a7149464e52cbfa8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Feb 2026 02:04:12 +0000 Subject: [PATCH 2/2] fix: skip non-issue refs like "Run #NNN" in extractIssueNumberFromPull The body scan in extractIssueNumberFromPull was treating patterns like "Run #2615" as issue references, causing the Upsert PR body sections check to fail with a 404 when trying to fetch non-existent issues. Add a preceding-word filter to skip #NNN when preceded by common non-issue words (run, attempt, step, job, check, task, version, v). https://claude.ai/code/session_01JhCWWDJG8PqwaSbVPCGfm6 --- .github/scripts/agents_pr_meta_keepalive.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/scripts/agents_pr_meta_keepalive.js b/.github/scripts/agents_pr_meta_keepalive.js index 7a219753..10eab2c8 100644 --- a/.github/scripts/agents_pr_meta_keepalive.js +++ b/.github/scripts/agents_pr_meta_keepalive.js @@ -240,6 +240,11 @@ function extractIssueNumberFromPull(pull) { if (match.index > 0 && /\w/.test(bodyText[match.index - 1])) { continue; } + // Skip non-issue refs like "Run #123", "run #123", "attempt #2" + const preceding = bodyText.slice(Math.max(0, match.index - 20), match.index); + if (/\b(?:run|attempt|step|job|check|task|version|v)\s*$/i.test(preceding)) { + continue; + } candidates.push(match[1]); }