From 08cd9dbda14b57deec64cf4cefce1b0844246d4e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 20:02:23 +0100 Subject: [PATCH] feat: add build issue command alias --- CHANGELOG.md | 1 + docs/repair/README.md | 4 +++- docs/repair/internal-features.md | 2 +- docs/repair/operations.md | 4 +++- src/repair/comment-router-core.ts | 8 +++++--- test/repair/comment-router-core.test.ts | 12 ++++++++++++ 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b87dce7222..40394b0597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ checkpoint, and status-only commits are intentionally omitted. findings. Thanks @stainlu. - Added maintainer issue commands that let ClawSweeper create or update one guarded implementation pull request from an open issue. +- Added `build` as an issue implementation command alias. ### Changed diff --git a/docs/repair/README.md b/docs/repair/README.md index 92c8845c79..afd35116b4 100644 --- a/docs/repair/README.md +++ b/docs/repair/README.md @@ -143,6 +143,7 @@ Supported commands: /clawsweeper status /clawsweeper re-review /clawsweeper implement +/clawsweeper build /clawsweeper fix ci /clawsweeper address review /clawsweeper rebase @@ -154,6 +155,7 @@ Supported commands: @clawsweeper re-review @clawsweeper review @clawsweeper implement +@clawsweeper build @clawsweeper create pr @clawsweeper fix issue @openclaw-clawsweeper fix ci @@ -164,7 +166,7 @@ Supported commands: dispatch ClawSweeper review again for an open issue or PR. `fix ci`, `address review`, and `rebase` dispatch the normal `repair-cluster-worker.yml` repair path, but only for existing ClawSweeper PRs identified by the `clawsweeper/*` branch. -`implement`, `create pr`, and `fix issue` work only on open issues. The router +`implement`, `build`, `create pr`, and `fix issue` work only on open issues. The router creates or reuses one durable `issue--` job and dispatches the normal repair worker to verify the issue on latest `main` and open or update one narrow implementation PR. This lane never merges or closes the issue; broad, diff --git a/docs/repair/internal-features.md b/docs/repair/internal-features.md index e302e88f77..442a4ba9ae 100644 --- a/docs/repair/internal-features.md +++ b/docs/repair/internal-features.md @@ -259,7 +259,7 @@ close actions remain blocked. ## Issue Implementation Commands Maintainer comments can turn an open issue into one ClawSweeper implementation -PR with `/clawsweeper implement`, `@clawsweeper create pr`, or +PR with `/clawsweeper implement`, `/clawsweeper build`, `@clawsweeper create pr`, or `@clawsweeper fix issue`. The comment router creates or reuses diff --git a/docs/repair/operations.md b/docs/repair/operations.md index cf5f79c21a..d53057ab90 100644 --- a/docs/repair/operations.md +++ b/docs/repair/operations.md @@ -244,6 +244,7 @@ Supported triggers: /clawsweeper status /clawsweeper re-review /clawsweeper implement +/clawsweeper build /clawsweeper fix ci /clawsweeper address review /clawsweeper rebase @@ -255,13 +256,14 @@ Supported triggers: @clawsweeper re-review @clawsweeper review @clawsweeper implement +@clawsweeper build @clawsweeper create pr @clawsweeper fix issue @openclaw-clawsweeper fix ci ``` `review` and `re-review` dispatch ClawSweeper review again for an open issue or PR. -Issue implementation commands (`implement`, `create pr`, `fix issue`) dispatch +Issue implementation commands (`implement`, `build`, `create pr`, `fix issue`) dispatch the repair worker for one open issue and ask it to create or update a single ClawSweeper implementation PR. The generated job uses `source: issue_implementation`, `repair_strategy: new_fix_pr`, blocks merge and diff --git a/src/repair/comment-router-core.ts b/src/repair/comment-router-core.ts index 47d9f5f551..2814a526bf 100644 --- a/src/repair/comment-router-core.ts +++ b/src/repair/comment-router-core.ts @@ -647,7 +647,7 @@ export function renderResponse(command: LooseRecord, dispatched: LooseRecord) { marker, "ClawSweeper is here and listening for maintainer commands.", "", - "Supported commands: `/review`, `/clawsweeper status`, `/clawsweeper re-review`, `/clawsweeper implement`, `/clawsweeper fix ci`, `/clawsweeper address review`, `/clawsweeper rebase`, `/clawsweeper autofix`, `/clawsweeper automerge`, `/clawsweeper approve`, `/autoclose `, `/clawsweeper explain`, `/clawsweeper stop`.", + "Supported commands: `/review`, `/clawsweeper status`, `/clawsweeper re-review`, `/clawsweeper implement`, `/clawsweeper build`, `/clawsweeper fix ci`, `/clawsweeper address review`, `/clawsweeper rebase`, `/clawsweeper autofix`, `/clawsweeper automerge`, `/clawsweeper approve`, `/autoclose `, `/clawsweeper explain`, `/clawsweeper stop`.", "", "I only act for maintainers, or for trusted ClawSweeper feedback on a ClawSweeper PR or PR opted into `clawsweeper:autofix` or `clawsweeper:automerge`.", ].join("\n"); @@ -882,7 +882,7 @@ export function renderResponse(command: LooseRecord, dispatched: LooseRecord) { `Reason: ${command.reason ?? "unsupported command or target"}.`, "", "Supported re-review commands work on open issues and PRs: `/review`, `/clawsweeper re-review`, or `@clawsweeper re-review`.", - "Supported issue implementation commands work on open issues: `/clawsweeper implement`, `@clawsweeper create pr`, or `@clawsweeper fix issue`.", + "Supported issue implementation commands work on open issues: `/clawsweeper implement`, `/clawsweeper build`, `@clawsweeper create pr`, or `@clawsweeper fix issue`.", "Supported repair commands work on existing ClawSweeper PRs and PRs opted into `clawsweeper:autofix` or `clawsweeper:automerge`: `/clawsweeper fix ci`, `/clawsweeper address review`, `/clawsweeper rebase`.", "A maintainer can opt a PR in with `/clawsweeper autofix` or `/clawsweeper automerge` and I can take another pass.", "A maintainer can close unsupported or declined work with `/autoclose `.", @@ -962,7 +962,7 @@ export function autocloseReasonFromCommand(command: LooseRecord) { function implementationPromptFromCommand(command: LooseRecord) { return String(command ?? "") .trim() - .replace(/^(?:implement|create\s+pr|open\s+pr|fix\s+issue)\b[:\s-]*/i, "") + .replace(/^(?:implement|build|create\s+pr|open\s+pr|fix\s+issue)\b[:\s-]*/i, "") .trim(); } @@ -976,6 +976,8 @@ function normalizeIntent(command: LooseRecord) { if ( command === "implement" || command.startsWith("implement ") || + command === "build" || + command.startsWith("build ") || command === "create pr" || command.startsWith("create pr ") || command === "open pr" || diff --git a/test/repair/comment-router-core.test.ts b/test/repair/comment-router-core.test.ts index bfd069d95e..ce4913f342 100644 --- a/test/repair/comment-router-core.test.ts +++ b/test/repair/comment-router-core.test.ts @@ -113,6 +113,12 @@ test("parseCommand recognizes maintainer slash commands", () => { intent: "implement_issue", implementation_prompt: "", }); + assert.deepEqual(parseCommand("/clawsweeper build add export support"), { + trigger: "slash", + command: "build add export support", + intent: "implement_issue", + implementation_prompt: "add export support", + }); assert.deepEqual(parseCommand("/clawsweeper create pr keep the fix narrow"), { trigger: "slash", command: "create pr keep the fix narrow", @@ -461,6 +467,12 @@ test("parseCommand recognizes ClawSweeper bot mentions", () => { intent: "implement_issue", implementation_prompt: "", }); + assert.deepEqual(parseCommand("@clawsweeper build\nAdd export support."), { + trigger: "mention", + command: "build add export support", + intent: "implement_issue", + implementation_prompt: "Add export support.", + }); assert.deepEqual(parseCommand("@clawsweeper fix issue\nPlease keep the UI small."), { trigger: "mention", command: "fix issue please keep the ui small",