aida_bug_fix
Mark bugs as resolved in AI development analytics. Log bug fixes with ID and solution details to improve coding patterns.
Instructions
当你修复了一个 bug 后调用。标记 bug 为已修复。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bugId | Yes | Bug ID,如 BUG-01 | |
| fix | No | 修复方案简述 |
Implementation Reference
- src/mcp/server.ts:371-402 (handler)The implementation of the aida_bug_fix tool handler. It updates the bug status to fixed, records tokens, and saves the changes.
function handleBugFix(args: any): any { const { path, data } = ensureRunJson(); const bug = data.bugs.find(b => b.bugId === args.bugId); if (!bug) return { success: false, message: `Bug ${args.bugId} 未找到` }; bug.status = 'fixed'; bug.fixedAt = now(); if (args.fix) bug.fix = args.fix; // Auto-collect tokens for bug fix let bugTokens = 0; if (bug.reportedAt && bug.fixedAt) { bugTokens = getTaskTokens(bug.reportedAt, bug.fixedAt); if (bugTokens > 0) { (bug as any).tokensConsumed = bugTokens; if (!data.cost) data.cost = {}; if (!data.cost.tokenBreakdown) data.cost.tokenBreakdown = []; data.cost.tokenBreakdown.push({ stage: `bugfix:${args.bugId}`, tokens: bugTokens, }); } } addEvent(data, 'bug_fixed', { bugId: args.bugId, tokensConsumed: bugTokens }); addTimeline(data, 'bug-fix', `${args.bugId}: ${bug.title}`); save(path, data); syncTokenUsage(path, data); const tokenMsg = bugTokens > 0 ? ` (${bugTokens} tokens)` : ''; return { success: true, message: `${args.bugId} 已修复${tokenMsg}` }; } - src/mcp/server.ts:692-694 (registration)The switch-case registration for the aida_bug_fix tool.
case 'aida_bug_fix': result = handleBugFix(args); break;