From 2260f39383f36ef9be8bc1f40e0b0451e5686cd9 Mon Sep 17 00:00:00 2001 From: Lauren ten Hoor Date: Tue, 10 Feb 2026 20:32:51 +0800 Subject: [PATCH] feat: enhance notification URLs with issue links and tool aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improvements to notification system for better traceability: 1. DEV Completion Notifications: - Always include issue URL (šŸ“‹ Issue: ...) - Include PR/MR URL when available (šŸ”— PR: ...) - Issue URL serves as fallback when PR/MR not found - Both URLs shown when PR/MR exists for maximum traceability 2. QA Pass Notifications: - Now include issue URL (šŸ“‹ Issue: ...) - Provides direct link to resolved issue 3. Tool Aliases: - Added 'work_finish' as alias for 'task_complete' - Added 'work_start' as alias for 'task_pickup' - Added 'status' as alias for 'queue_status' - Matches naming used in AGENTS.md documentation Example DEV notification: āœ… DEV done #106 — Enhanced notification URLs šŸ“‹ Issue: https://github.com/user/repo/issues/106 šŸ”— PR: https://github.com/user/repo/pull/107 Moved to QA queue. Example QA notification: šŸŽ‰ QA PASS #106 — All tests passed šŸ“‹ Issue: https://github.com/user/repo/issues/106 Issue closed. Addresses issue #106 --- index.ts | 6 +++--- lib/tools/task-complete.ts | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/index.ts b/index.ts index 9ab88f0..97098cd 100644 --- a/index.ts +++ b/index.ts @@ -65,10 +65,10 @@ const plugin = { register(api: OpenClawPluginApi) { // Agent tools (primary interface — agent calls these directly) api.registerTool(createTaskPickupTool(api), { - names: ["task_pickup"], + names: ["task_pickup", "work_start"], }); api.registerTool(createTaskCompleteTool(api), { - names: ["task_complete"], + names: ["task_complete", "work_finish"], }); api.registerTool(createTaskUpdateTool(api), { names: ["task_update"], @@ -77,7 +77,7 @@ const plugin = { names: ["task_comment"], }); api.registerTool(createQueueStatusTool(api), { - names: ["queue_status"], + names: ["queue_status", "status"], }); api.registerTool(createSessionHealthTool(api), { names: ["session_health"], diff --git a/lib/tools/task-complete.ts b/lib/tools/task-complete.ts index 2801a46..f47f0b0 100644 --- a/lib/tools/task-complete.ts +++ b/lib/tools/task-complete.ts @@ -138,6 +138,10 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) { output.gitPull = `warning: ${(err as Error).message}`; } + // Fetch issue to get URL + const issue = await provider.getIssue(issueId); + const issueUrl = issue.web_url; + // Auto-detect PR/MR URL if not provided if (!prUrl) { try { @@ -152,17 +156,19 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) { output.labelTransition = "Doing → To Test"; - // Build announcement with PR URL if available + // Build announcement with URLs let announcement = `āœ… DEV done #${issueId}`; if (summary) { announcement += ` — ${summary}`; } + announcement += `\nšŸ“‹ Issue: ${issueUrl}`; if (prUrl) { announcement += `\nšŸ”— PR: ${prUrl}`; } - announcement += `. Moved to QA queue.`; + announcement += `\nMoved to QA queue.`; output.announcement = announcement; + output.issueUrl = issueUrl; if (prUrl) { output.prUrl = prUrl; } @@ -215,13 +221,18 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) { // === QA PASS === if (role === "qa" && result === "pass") { + // Fetch issue to get URL + const issue = await provider.getIssue(issueId); + const issueUrl = issue.web_url; + await deactivateWorker(workspaceDir, groupId, "qa"); await provider.transitionLabel(issueId, "Testing", "Done"); await provider.closeIssue(issueId); output.labelTransition = "Testing → Done"; output.issueClosed = true; - output.announcement = `šŸŽ‰ QA PASS #${issueId}${summary ? ` — ${summary}` : ""}. Issue closed.`; + output.issueUrl = issueUrl; + output.announcement = `šŸŽ‰ QA PASS #${issueId}${summary ? ` — ${summary}` : ""}\nšŸ“‹ Issue: ${issueUrl}\nIssue closed.`; } // === QA FAIL ===