Skip to content

Commit a9b17a1

Browse files
committed
fix: preserve automatic issue titles
1 parent 662b5de commit a9b17a1

3 files changed

Lines changed: 61 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ checkpoint, and status-only commits are intentionally omitted.
7474

7575
### Fixed
7676

77-
- Correlated active issue-build workers by workflow run when GitHub job titles omit the target, preserved generated PR links on blocked lifecycle cards and issue progress comments, and stopped generic repository repairs from requiring a nonexistent `pnpm check:changed` script.
77+
- Correlated active issue-build workers by workflow run when GitHub job titles omit the target, preserved source issue titles and generated PR links across repair lifecycle events, and stopped generic repository repairs from requiring a nonexistent `pnpm check:changed` script.
7878
- Persisted dashboard lifecycle events in a globally consistent Cloudflare Durable Object so automatic issue-build cards remain visible across edge locations, and accepted Ansible plus repository-local shell-script validation commands without permitting inline shell execution.
7979
- Prevented ClawSweeper-owned advisory labels from invalidating queued issue implementation source revisions, and accepted quoted arguments plus common validation toolchains while blocking shell/eval runners and removing GitHub write credentials from target validation.
8080
- Skip optional ClawSweeper label additions when an issue or pull request already has GitHub's 100-label maximum, so one saturated item cannot abort a comment-sync batch.

‎dashboard/worker.ts‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,14 @@ export function automaticIssueWork(storedEvents, workers) {
31233123
worker_id: null,
31243124
timeline: [],
31253125
};
3126-
row.title = nullableString(event.title) || row.title;
3126+
const eventTitle = nullableString(event.title);
3127+
if (
3128+
eventTitle &&
3129+
isAutomaticWorkPlaceholderTitle(row.title, repository, issueNumber) &&
3130+
!isAutomaticWorkPlaceholderTitle(eventTitle, repository, issueNumber)
3131+
) {
3132+
row.title = eventTitle;
3133+
}
31273134
row.phase = nullableString(event.stage) || row.phase;
31283135
row.status = nullableString(event.status) || row.status;
31293136
row.run_url = nullableString(event.run_url) || row.run_url;
@@ -3195,7 +3202,13 @@ export function automaticIssueWork(storedEvents, workers) {
31953202
row.status = worker.status || row.status;
31963203
row.run_url = worker.run_url || row.run_url;
31973204
row.updated_at = worker.updated_at || worker.started_at || row.updated_at;
3198-
row.title = target?.title || row.title;
3205+
if (
3206+
target?.title &&
3207+
isAutomaticWorkPlaceholderTitle(row.title, row.repository, row.issue_number) &&
3208+
!isAutomaticWorkPlaceholderTitle(target.title, row.repository, row.issue_number)
3209+
) {
3210+
row.title = target.title;
3211+
}
31993212
row.timeline.push({
32003213
event_type: "clawsweeper.worker_active",
32013214
phase: worker.current_step || worker.stage || "worker",
@@ -3227,6 +3240,17 @@ function issueNumberFromUrl(value) {
32273240
return match ? Number(match[1]) : null;
32283241
}
32293242

3243+
function isAutomaticWorkPlaceholderTitle(value, repository, issueNumber) {
3244+
const title = String(value || "").trim();
3245+
if (!title) return true;
3246+
const escapedRepository = String(repository || "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3247+
return (
3248+
new RegExp(`^Issue #${issueNumber}$`, "i").test(title) ||
3249+
/^PR #\d+$/i.test(title) ||
3250+
new RegExp(`^${escapedRepository}#\\d+$`, "i").test(title)
3251+
);
3252+
}
3253+
32303254
function operationEventCounts(storedEvents) {
32313255
const counts = {
32323256
inherited_label_cleanups: 0,

‎test/dashboard-worker.test.ts‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,40 @@ test("dashboard correlates issue implementation workers by run URL", () => {
320320
assert.equal(workers[0].target_items[0].title, "Install sudo when missing");
321321
});
322322

323+
test("dashboard preserves issue titles across generated PR repair events", () => {
324+
const rows = automaticIssueWork(
325+
[
326+
{
327+
event_type: "clawsweeper.issue_build_started",
328+
repository: "openclaw/openclaw-ansible",
329+
source_item_number: 20,
330+
source_item_url: "https://github.com/openclaw/openclaw-ansible/issues/20",
331+
title: "installation fails due to not sudo installed",
332+
stage: "building",
333+
status: "running",
334+
automatic: true,
335+
received_at: "2026-06-14T10:00:00Z",
336+
},
337+
{
338+
event_type: "clawsweeper.contributor_branch_repaired",
339+
repository: "openclaw/openclaw-ansible",
340+
source_item_number: 20,
341+
source_item_url: "https://github.com/openclaw/openclaw-ansible/issues/20",
342+
item_url: "https://github.com/openclaw/openclaw-ansible/pull/49",
343+
pr_url: "https://github.com/openclaw/openclaw-ansible/pull/49",
344+
title: "openclaw/openclaw-ansible#49",
345+
stage: "repair_contributor_branch",
346+
status: "pushed",
347+
received_at: "2026-06-14T10:10:00Z",
348+
},
349+
],
350+
[],
351+
);
352+
353+
assert.equal(rows[0].title, "installation fails due to not sudo installed");
354+
assert.equal(rows[0].pr_url, "https://github.com/openclaw/openclaw-ansible/pull/49");
355+
});
356+
323357
test("dashboard exposes active worker jobs and their current steps", async () => {
324358
const originalFetch = globalThis.fetch;
325359
const originalCaches = globalThis.caches;

0 commit comments

Comments
 (0)