Skip to content

Commit 09a6834

Browse files
author
VoardWalker-Code
committed
fix: /skill slash command — dispatch through /api/task/run instead of broken endpoint
The /skill command was POSTing to GET-only /api/skills/workspace/list (which lists workspace files, not invoke skills). Fixed to dispatch through /api/task/run with taskType: 'skill' and the skill name, matching how /websearch and the task wizard already work. Also adds entity-loaded check and skill args forwarding. 2012/2012 tests passing.
1 parent 55d0a37 commit 09a6834

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

project/client/js/apps/core/slash-commands.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,19 @@
209209
const parts = args.split(/\s+/);
210210
const skillName = parts[0];
211211
if (!skillName) { _sysMsg('Usage: /skill <name> [args…]'); return; }
212-
_sysMsg(`🔧 Invoking skill: ${skillName}…`);
213-
_post('/api/skills/workspace/list', {})
214-
.catch(() => _sysMsg('⚠️ Skill dispatch failed — check the Skills tab for available skills.'));
212+
const skillArgs = parts.slice(1).join(' ');
213+
const entityId = _entityId();
214+
if (!entityId) { _sysMsg('⚠️ Load an entity first.'); return; }
215+
_sysMsg(`🔧 Invoking skill: ${skillName}${skillArgs ? ' — ' + skillArgs : ''}…`);
216+
_post('/api/task/run', {
217+
message: skillArgs || skillName,
218+
entityId,
219+
taskType: 'skill',
220+
skill: skillName,
221+
async: true,
222+
}).then(r => {
223+
if (r && !r.ok) _sysMsg('⚠️ Skill dispatch failed: ' + (r.error || 'unknown error'));
224+
}).catch(() => _sysMsg('⚠️ Skill request failed — check the Skills tab for available skills.'));
215225
}
216226

217227
// ── Command: /websearch ───────────────────────────────────────────────────────

0 commit comments

Comments
 (0)