Merge pull request #1370 from misyuari/fix/refactor-skills
fix: update skill resolution to support disabled skills functionality
This commit is contained in:
+4
-4
@@ -388,6 +388,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
const lookAt = isMultimodalLookerEnabled ? createLookAt(ctx) : null;
|
||||
const browserProvider =
|
||||
pluginConfig.browser_automation_engine?.provider ?? "playwright";
|
||||
const disabledSkills = new Set<string>(pluginConfig.disabled_skills ?? []);
|
||||
const delegateTask = createDelegateTask({
|
||||
manager: backgroundManager,
|
||||
client: ctx.client,
|
||||
@@ -396,6 +397,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
gitMasterConfig: pluginConfig.git_master,
|
||||
sisyphusJuniorModel: pluginConfig.agents?.["sisyphus-junior"]?.model,
|
||||
browserProvider,
|
||||
disabledSkills,
|
||||
onSyncSessionCreated: async (event) => {
|
||||
log("[index] onSyncSessionCreated callback", {
|
||||
sessionID: event.sessionID,
|
||||
@@ -414,11 +416,8 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
});
|
||||
},
|
||||
});
|
||||
const disabledSkills = new Set(pluginConfig.disabled_skills ?? []);
|
||||
const systemMcpNames = getSystemMcpServerNames();
|
||||
const builtinSkills = createBuiltinSkills({ browserProvider }).filter(
|
||||
(skill) => {
|
||||
if (disabledSkills.has(skill.name as never)) return false;
|
||||
const builtinSkills = createBuiltinSkills({ browserProvider, disabledSkills }).filter((skill) => {
|
||||
if (skill.mcpConfig) {
|
||||
for (const mcpName of Object.keys(skill.mcpConfig)) {
|
||||
if (systemMcpNames.has(mcpName)) return false;
|
||||
@@ -450,6 +449,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
mcpManager: skillMcpManager,
|
||||
getSessionID: getSessionIDForMcp,
|
||||
gitMasterConfig: pluginConfig.git_master,
|
||||
disabledSkills
|
||||
});
|
||||
const skillMcpTool = createSkillMcpTool({
|
||||
manager: skillMcpManager,
|
||||
|
||||
Reference in New Issue
Block a user