feat: add task_update and task_comment tools (#33)

Closes #26

This PR adds two new DevClaw tools for better task lifecycle management:

- task_update: Change issue state programmatically without full pickup/complete flow
- task_comment: Add review comments or notes to issues with optional role attribution
This commit is contained in:
Lauren ten Hoor
2026-02-10 09:20:27 +08:00
committed by GitHub
parent 78bc95efb3
commit a9e5b9ef3e
7 changed files with 370 additions and 2 deletions

View File

@@ -197,6 +197,26 @@ export class GitHubProvider implements TaskManager {
}
}
async addComment(issueId: number, body: string): Promise<void> {
// Write body to temp file to preserve newlines
const tempFile = join(tmpdir(), `devclaw-comment-${Date.now()}.md`);
await writeFile(tempFile, body, "utf-8");
try {
await this.gh([
"issue", "comment", String(issueId),
"--body-file", tempFile,
]);
} finally {
// Clean up temp file
try {
await unlink(tempFile);
} catch {
// Ignore cleanup errors
}
}
}
async healthCheck(): Promise<boolean> {
try {
await this.gh(["auth", "status"]);