feat: enhance notification URLs with issue links and tool aliases
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
This commit is contained in:
6
index.ts
6
index.ts
@@ -65,10 +65,10 @@ const plugin = {
|
|||||||
register(api: OpenClawPluginApi) {
|
register(api: OpenClawPluginApi) {
|
||||||
// Agent tools (primary interface — agent calls these directly)
|
// Agent tools (primary interface — agent calls these directly)
|
||||||
api.registerTool(createTaskPickupTool(api), {
|
api.registerTool(createTaskPickupTool(api), {
|
||||||
names: ["task_pickup"],
|
names: ["task_pickup", "work_start"],
|
||||||
});
|
});
|
||||||
api.registerTool(createTaskCompleteTool(api), {
|
api.registerTool(createTaskCompleteTool(api), {
|
||||||
names: ["task_complete"],
|
names: ["task_complete", "work_finish"],
|
||||||
});
|
});
|
||||||
api.registerTool(createTaskUpdateTool(api), {
|
api.registerTool(createTaskUpdateTool(api), {
|
||||||
names: ["task_update"],
|
names: ["task_update"],
|
||||||
@@ -77,7 +77,7 @@ const plugin = {
|
|||||||
names: ["task_comment"],
|
names: ["task_comment"],
|
||||||
});
|
});
|
||||||
api.registerTool(createQueueStatusTool(api), {
|
api.registerTool(createQueueStatusTool(api), {
|
||||||
names: ["queue_status"],
|
names: ["queue_status", "status"],
|
||||||
});
|
});
|
||||||
api.registerTool(createSessionHealthTool(api), {
|
api.registerTool(createSessionHealthTool(api), {
|
||||||
names: ["session_health"],
|
names: ["session_health"],
|
||||||
|
|||||||
@@ -138,6 +138,10 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) {
|
|||||||
output.gitPull = `warning: ${(err as Error).message}`;
|
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
|
// Auto-detect PR/MR URL if not provided
|
||||||
if (!prUrl) {
|
if (!prUrl) {
|
||||||
try {
|
try {
|
||||||
@@ -152,17 +156,19 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) {
|
|||||||
|
|
||||||
output.labelTransition = "Doing → To Test";
|
output.labelTransition = "Doing → To Test";
|
||||||
|
|
||||||
// Build announcement with PR URL if available
|
// Build announcement with URLs
|
||||||
let announcement = `✅ DEV done #${issueId}`;
|
let announcement = `✅ DEV done #${issueId}`;
|
||||||
if (summary) {
|
if (summary) {
|
||||||
announcement += ` — ${summary}`;
|
announcement += ` — ${summary}`;
|
||||||
}
|
}
|
||||||
|
announcement += `\n📋 Issue: ${issueUrl}`;
|
||||||
if (prUrl) {
|
if (prUrl) {
|
||||||
announcement += `\n🔗 PR: ${prUrl}`;
|
announcement += `\n🔗 PR: ${prUrl}`;
|
||||||
}
|
}
|
||||||
announcement += `. Moved to QA queue.`;
|
announcement += `\nMoved to QA queue.`;
|
||||||
|
|
||||||
output.announcement = announcement;
|
output.announcement = announcement;
|
||||||
|
output.issueUrl = issueUrl;
|
||||||
if (prUrl) {
|
if (prUrl) {
|
||||||
output.prUrl = prUrl;
|
output.prUrl = prUrl;
|
||||||
}
|
}
|
||||||
@@ -215,13 +221,18 @@ export function createTaskCompleteTool(api: OpenClawPluginApi) {
|
|||||||
|
|
||||||
// === QA PASS ===
|
// === QA PASS ===
|
||||||
if (role === "qa" && result === "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 deactivateWorker(workspaceDir, groupId, "qa");
|
||||||
await provider.transitionLabel(issueId, "Testing", "Done");
|
await provider.transitionLabel(issueId, "Testing", "Done");
|
||||||
await provider.closeIssue(issueId);
|
await provider.closeIssue(issueId);
|
||||||
|
|
||||||
output.labelTransition = "Testing → Done";
|
output.labelTransition = "Testing → Done";
|
||||||
output.issueClosed = true;
|
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 ===
|
// === QA FAIL ===
|
||||||
|
|||||||
Reference in New Issue
Block a user