feat: add build issue command alias
Some checks failed
CI / pnpm check (push) Waiting to run
Pages / Deploy docs (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (push) Has been cancelled

This commit is contained in:
Peter Steinberger 2026-05-02 20:02:23 +01:00
parent 9e52627d79
commit 08cd9dbda1
No known key found for this signature in database
6 changed files with 25 additions and 6 deletions

View File

@ -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

View File

@ -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-<repo>-<number>` 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,

View File

@ -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

View File

@ -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

View File

@ -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 <reason>`, `/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 <reason>`, `/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 <reason>`.",
@ -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" ||

View File

@ -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",