feat: include issue URL in workerComplete notifications for better tracking

This commit is contained in:
Lauren ten Hoor
2026-02-10 23:17:45 +08:00
parent ff83c25e8c
commit 94363f9ae0
2 changed files with 4 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ export type NotifyEvent =
project: string; project: string;
groupId: string; groupId: string;
issueId: number; issueId: number;
issueUrl: string;
role: "dev" | "qa"; role: "dev" | "qa";
result: "done" | "pass" | "fail" | "refine" | "blocked"; result: "done" | "pass" | "fail" | "refine" | "blocked";
summary?: string; summary?: string;
@@ -95,6 +96,7 @@ function buildMessage(event: NotifyEvent): string {
if (event.nextState) { if (event.nextState) {
msg += `${event.nextState}`; msg += `${event.nextState}`;
} }
msg += `\n🔗 ${event.issueUrl}`;
return msg; return msg;
} }

View File

@@ -56,6 +56,7 @@ export function createWorkFinishTool(api: OpenClawPluginApi) {
const { provider } = resolveProvider(project); const { provider } = resolveProvider(project);
const repoPath = resolveRepoPath(project.repo); const repoPath = resolveRepoPath(project.repo);
const issue = await provider.getIssue(issueId);
// Execute completion (pipeline service) // Execute completion (pipeline service)
const completion = await executeCompletion({ const completion = await executeCompletion({
@@ -71,7 +72,7 @@ export function createWorkFinishTool(api: OpenClawPluginApi) {
const pluginConfig = getPluginConfig(api); const pluginConfig = getPluginConfig(api);
const notifyConfig = getNotificationConfig(pluginConfig); const notifyConfig = getNotificationConfig(pluginConfig);
await notify( await notify(
{ type: "workerComplete", project: project.name, groupId, issueId, role, result: result as "done" | "pass" | "fail" | "refine" | "blocked", summary, nextState: NEXT_STATE[`${role}:${result}`] }, { type: "workerComplete", project: project.name, groupId, issueId, issueUrl: issue.web_url, role, result: result as "done" | "pass" | "fail" | "refine" | "blocked", summary, nextState: NEXT_STATE[`${role}:${result}`] },
{ workspaceDir, config: notifyConfig, groupId, channel: project.channel ?? "telegram" }, { workspaceDir, config: notifyConfig, groupId, channel: project.channel ?? "telegram" },
); );