diff --git a/integration-tests/terminal-capture/scenarios/cron-loop.ts b/integration-tests/terminal-capture/scenarios/cron-loop.ts new file mode 100644 index 000000000..a1c71236c --- /dev/null +++ b/integration-tests/terminal-capture/scenarios/cron-loop.ts @@ -0,0 +1,17 @@ +import type { ScenarioConfig } from '../scenario-runner.js'; + +/** + * Demonstrates the /loop skill and cron scheduling tools. + * Creates a recurring job, lists it, then clears all jobs. + */ +export default { + name: 'cron-loop', + spawn: ['node', 'dist/cli.js', '--yolo'], + terminal: { title: 'qwen-code', cwd: '../../..' }, + flow: [ + { type: 'hi' }, + { type: '/loop 1m say hi to me' }, + { type: '/loop list' }, + { type: '/loop clear' }, + ], +} satisfies ScenarioConfig; diff --git a/packages/core/src/tools/cron-create.ts b/packages/core/src/tools/cron-create.ts index ab113b9bb..0a154282b 100644 --- a/packages/core/src/tools/cron-create.ts +++ b/packages/core/src/tools/cron-create.ts @@ -51,12 +51,12 @@ class CronCreateInvocation extends BaseToolInvocation< if (recurring) { llmContent = `Scheduled recurring job ${job.id} (${job.cronExpr}). ` + - 'Session-only (not written to disk, dies when Claude exits). ' + + 'Session-only (not written to disk, dies when Qwen Code exits). ' + 'Auto-expires after 7 days. Use CronDelete to cancel sooner.'; } else { llmContent = `Scheduled one-shot task ${job.id} (${job.cronExpr}). ` + - 'Session-only (not written to disk, dies when Claude exits). ' + + 'Session-only (not written to disk, dies when Qwen Code exits). ' + 'It will fire once then auto-delete.'; } @@ -99,7 +99,7 @@ export class CronCreateTool extends BaseDeclarativeTool< ' "in an hour or so, remind me to..." → pick whatever minute you land on, don\'t round\n\n' + 'Only use minute 0 or 30 when the user names that exact time and clearly means it ("at 9:00 sharp", "at half past", coordinating with a meeting). When in doubt, nudge a few minutes early or late — the user will not notice, and the fleet will.\n\n' + '## Session-only\n\n' + - 'Jobs live only in this Claude session — nothing is written to disk, and the job is gone when Claude exits.\n\n' + + 'Jobs live only in this Qwen Code session — nothing is written to disk, and the job is gone when Qwen Code exits.\n\n' + '## Runtime behavior\n\n' + 'Jobs only fire while the REPL is idle (not mid-query). The scheduler adds a small deterministic jitter on top of whatever you pick: recurring tasks fire up to 10% of their period late (max 15 min); one-shot tasks landing on :00 or :30 fire up to 90 s early. Picking an off-minute is still the bigger lever.\n\n' + 'Recurring tasks auto-expire after 3 days — they fire one final time, then are deleted. This bounds session lifetime. Tell the user about the 3-day limit when scheduling recurring jobs.\n\n' +