diff --git a/packages/core/src/tools/send-message.ts b/packages/core/src/tools/send-message.ts index 37ad925e4ab..ba2ca80234c 100644 --- a/packages/core/src/tools/send-message.ts +++ b/packages/core/src/tools/send-message.ts @@ -254,7 +254,7 @@ export class SendMessageTool extends BaseDeclarativeTool< super( SendMessageTool.Name, ToolDisplayNames.SEND_MESSAGE, - 'Send a message to a teammate (use "to") or to a running background task (use "task_id"). ' + + 'Send a message to a teammate (use "to") or to a running, paused, or completed background task (use "task_id"); completed tasks are revived. ' + 'For teams, set "to" to a bare teammate name (no @) or "*" to broadcast. ' + 'For background tasks, set "task_id" to the id from the launch response, a recovered paused task, or a completed task to revive. ' + 'Running tasks receive it at the next tool-round boundary; paused recovered tasks are resumed with the message as their first continuation instruction; a completed task is revived from its transcript and continued with your message. ' + diff --git a/packages/core/src/utils/environmentContext.test.ts b/packages/core/src/utils/environmentContext.test.ts index fa419f79965..16dcd480695 100644 --- a/packages/core/src/utils/environmentContext.test.ts +++ b/packages/core/src/utils/environmentContext.test.ts @@ -38,6 +38,7 @@ import { import { prependToFirstTextPart } from './partUtils.js'; import type { Config } from '../config/config.js'; import type { ToolRegistry } from '../tools/tool-registry.js'; +import { SendMessageTool } from '../tools/send-message.js'; import { getFolderStructure } from './getFolderStructure.js'; import { collectAvailableSkillEntries } from '../tools/skill-utils.js'; import type { AvailableSkillEntry } from '../tools/skill-utils.js'; @@ -519,6 +520,22 @@ describe('startup reminder builders', () => { expect(reminder).toContain('- "cron_list": "List scheduled jobs."'); }); + it('keeps completed-task revival visible in the send_message summary', () => { + const tool = new SendMessageTool({} as Config); + const reminder = buildDeferredToolsReminder( + registry({ + getDeferredToolSummary: vi + .fn() + .mockReturnValue([ + { name: tool.name, description: tool.description }, + ]), + }), + ); + + expect(reminder).toContain('completed background task'); + expect(reminder).toContain('completed tasks are revived'); + }); + it('JSON-encodes deferred tool metadata before rendering', () => { const reminder = buildDeferredToolsReminder( registry({