From 7d8d66b82b270d605e556f65d42180664e1083c4 Mon Sep 17 00:00:00 2001 From: unraid Date: Sat, 9 May 2026 18:22:41 +0800 Subject: [PATCH] fix: rename /schedule slash command to /triggers to avoid bundled-skill collision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both `src/commands/schedule/index.ts` (our new UI command) and the upstream `src/skills/bundled/scheduleRemoteAgents.ts` registered `name: 'schedule'`, producing two `/schedule` entries in the slash-command picker — one tagged "(bundled)" with the prompt-skill description, the other our CRUD UI. Rename the primary name to `triggers` (matches the API endpoint `/v1/code/triggers`) and drop `'schedule'` from the alias list. `/cron` alias is preserved. Directory stays `src/commands/schedule/` because renaming the dir would touch every test file's import path for negligible benefit. Updated test that asserted the old name + alias, and the user-facing feature guide that documented `/schedule create ...` examples. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/features/all-features-guide.md | 12 +++++++----- src/commands/schedule/__tests__/index.test.ts | 10 ++++++---- src/commands/schedule/index.ts | 9 +++++++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/features/all-features-guide.md b/docs/features/all-features-guide.md index e87292575..353241ef5 100644 --- a/docs/features/all-features-guide.md +++ b/docs/features/all-features-guide.md @@ -8,7 +8,7 @@ 1. [Buddy 伴侣系统](#1-buddy-伴侣系统) 2. [Remote Control 远程控制](#2-remote-control-远程控制) -3. [定时任务 /schedule](#3-定时任务-schedule) +3. [定时任务 /triggers](#3-定时任务-triggers) 4. [Voice Mode 语音模式](#4-voice-mode-语音模式) 5. [Chrome 浏览器控制](#5-chrome-浏览器控制) 6. [Computer Use 屏幕操控](#6-computer-use-屏幕操控) @@ -72,19 +72,21 @@ CLAUDE_BRIDGE_BASE_URL=https://your-server.com CLAUDE_BRIDGE_OAUTH_TOKEN=your-to --- -## 3. 定时任务 /schedule +## 3. 定时任务 /triggers **PR**: #88 `feat: enable /schedule by adding AGENT_TRIGGERS_REMOTE` **Feature Flag**: `AGENT_TRIGGERS_REMOTE` +> 命令名已从 `/schedule` 改为 `/triggers`,避免与上游 bundled skill `schedule` 冲突。`/cron` 是别名。 + ### 说明 创建定时执行的远程 agent 任务,支持 cron 表达式。 ### 使用 ``` -/schedule create "每天检查依赖更新" --cron "0 9 * * *" --prompt "检查 package.json 中的过期依赖并创建更新 PR" -/schedule list — 列出所有定时任务 -/schedule delete — 删除指定任务 +/triggers create "每天检查依赖更新" --cron "0 9 * * *" --prompt "检查 package.json 中的过期依赖并创建更新 PR" +/triggers list — 列出所有定时任务 +/triggers delete — 删除指定任务 ``` --- diff --git a/src/commands/schedule/__tests__/index.test.ts b/src/commands/schedule/__tests__/index.test.ts index 68682487d..0b8e29ef2 100644 --- a/src/commands/schedule/__tests__/index.test.ts +++ b/src/commands/schedule/__tests__/index.test.ts @@ -24,8 +24,8 @@ beforeAll(async () => { }) describe('scheduleCommand metadata', () => { - test('name is "schedule"', () => { - expect(cmd.name).toBe('schedule') + test('name is "triggers" (renamed from "schedule" to avoid bundled-skill collision)', () => { + expect(cmd.name).toBe('triggers') }) test('type is local-jsx', () => { @@ -36,9 +36,11 @@ describe('scheduleCommand metadata', () => { expect(cmd.isEnabled?.()).toBe(true) }) - test('aliases include cron and triggers', () => { + test('aliases include cron (triggers is now the primary name)', () => { expect(cmd.aliases).toContain('cron') - expect(cmd.aliases).toContain('triggers') + // 'triggers' moved to primary `name`; the bundled skill /schedule + // owns the 'schedule' slot upstream so we don't alias to it either. + expect(cmd.aliases).not.toContain('schedule') }) test('bridgeSafe is false', () => { diff --git a/src/commands/schedule/index.ts b/src/commands/schedule/index.ts index 9f9a8f601..e5fae9e54 100644 --- a/src/commands/schedule/index.ts +++ b/src/commands/schedule/index.ts @@ -2,8 +2,13 @@ import type { Command } from '../../types/command.js' const scheduleCommand: Command = { type: 'local-jsx', - name: 'schedule', - aliases: ['cron', 'triggers'], + // Primary name renamed from 'schedule' → 'triggers' to avoid collision + // with the upstream bundled skill `src/skills/bundled/scheduleRemoteAgents.ts`, + // which also registers as `/schedule`. The new name matches the underlying + // API endpoint (`/v1/code/triggers`). Directory still named schedule/ to + // keep the rename minimal — only the user-facing slash name changes. + name: 'triggers', + aliases: ['cron'], description: 'Manage scheduled remote agent triggers (cloud cron). Requires Claude Pro/Max/Team subscription.', // REPL markdown renderer strips `<...>` as HTML tags — use uppercase.