From 43d3c91d441541dc91b83b5f9f3bccc41a38d7a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 14:45:43 +0000 Subject: [PATCH] fix: handle string priority values in plugin updateLoadOrder() The priority field accepts strings ('highest'|'high'|'normal'|'low'|'lowest') but updateLoadOrder() only processed numbers, treating all string priorities as 0. Add a priority map to convert string values to numeric equivalents. Closes #78 https://claude.ai/code/session_013SuTCMwGbVm2sR7bnC5yw1 --- core/plugins/registry.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/plugins/registry.ts b/core/plugins/registry.ts index 200a000..9bbe3fd 100644 --- a/core/plugins/registry.ts +++ b/core/plugins/registry.ts @@ -738,11 +738,12 @@ export class PluginRegistry { } // Sort ready plugins by priority (highest first) + const priorityMap: Record = { highest: -100, high: -50, normal: 0, low: 50, lowest: 100 } ready.sort((a, b) => { const pluginA = this.plugins.get(a) const pluginB = this.plugins.get(b) - const priorityA = typeof pluginA?.priority === 'number' ? pluginA.priority : 0 - const priorityB = typeof pluginB?.priority === 'number' ? pluginB.priority : 0 + const priorityA = typeof pluginA?.priority === 'number' ? pluginA.priority : (priorityMap[pluginA?.priority as string] ?? 0) + const priorityB = typeof pluginB?.priority === 'number' ? pluginB.priority : (priorityMap[pluginB?.priority as string] ?? 0) return priorityB - priorityA })