Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(action-center): name a task its check completed once in History, by its title when it has one (#1685)
Cihanc5724564bed2
diff --git a/server/src/lib/action-center/task-checks.js b/server/src/lib/action-center/task-checks.jsindex 3968e7699..1532cff93 100644--- a/server/src/lib/action-center/task-checks.js+++ b/server/src/lib/action-center/task-checks.js@@ -603,7 +603,12 @@ export async function runTaskCheck(task, action, { fetch = fetchPage, now = newconst { error: eventError } = await supabaseAdmin.from('action_events').insert({action_id: task.action_id,event: 'task_checked',- data: { taskId: task.id, task: task.task_key ?? null, title: task.title ?? null },+ // Named once: by its own title when someone renamed it, else its library key.+ data: {+ taskId: task.id,+ task: task.title ? null : (task.task_key ?? null),+ title: task.title ?? null,+ },actor_id: null,});if (eventError) logger.warn({ err: eventError }, '[task-checks] History line not written');diff --git a/server/src/lib/action-center/task-checks.test.js b/server/src/lib/action-center/task-checks.test.jsindex ba970b5b2..9bd8d7168 100644--- a/server/src/lib/action-center/task-checks.test.js+++ b/server/src/lib/action-center/task-checks.test.js@@ -483,6 +483,16 @@ describe('runTaskCheck', () => {});});+ it('names a renamed task in History by its title alone (#1565)', async () => {+ const renamed = task({ title: 'Fix the pricing link' });+ await runTaskCheck(renamed, action, { fetch: fetchOf({ [PAGE]: html('x') }), now });+ expect(ops.find((op) => op.table === 'action_events').payload.data).toEqual({+ taskId: 't1',+ task: null,+ title: 'Fix the pricing link',+ });+ });+it('holds a task someone reopened: open, its checks kept, never closed again on that page', async () => {const reopened = task({details: {diff --git a/web/src/lib/action-center/display.test.ts b/web/src/lib/action-center/display.test.tsindex 94e1dc2aa..cce220983 100644--- a/web/src/lib/action-center/display.test.ts+++ b/web/src/lib/action-center/display.test.ts@@ -400,6 +400,20 @@ describe('actionEventText', () => {).toBe('30-day result: not enough data to compare positions');});+ it('names a checked task once: its title when renamed, else its library name (#1565)', () => {+ expect(+ actionEventText(event('task_checked', { task: 'refresh_content', title: null }), tPage, t),+ ).toBe('Checked automatically and done: Refresh outdated content');+ // A line written before the API sent one name carries both: the title alone.+ expect(+ actionEventText(+ event('task_checked', { task: 'refresh_content', title: 'Refresh the pricing page' }),+ tPage,+ t,+ ),+ ).toBe('Checked automatically and done: Refresh the pricing page');+ });+it("passes a task's own title and the measured verdict", () => {expect(actionEventText(event('task_added', { title: 'Ask the agency' }), tPage, t)).toBe('Task added: “Ask the agency”',diff --git a/web/src/lib/action-center/display.ts b/web/src/lib/action-center/display.tsindex df5d54534..242613eca 100644--- a/web/src/lib/action-center/display.ts+++ b/web/src/lib/action-center/display.ts@@ -225,7 +225,12 @@ export function actionEventText(// Work the product did itself names the task in the reader's language// and the tool as it is recorded — the tool id is the audit fact, so it// is not translated.- task: eventTaskText(event.data.task, tTasks),+ // A checked task is named once (`{task}{title}`): by its own title when it+ // has one; lines written before the API sent only one carry both.+ task:+ event.event === 'task_checked' && event.data.title+ ? ''+ : eventTaskText(event.data.task, tTasks),tool: String(event.data.tool ?? ''),improved: Number(event.data.improved ?? 0),measurable: Number(event.data.measurable ?? 0),