fix(plugins): expose enabled skills for agent assignment

This commit is contained in:
2026-09-01 20:27:51 +08:00
parent 08099ea1c2
commit adc28db785
3 changed files with 146 additions and 6 deletions

View File

@@ -674,7 +674,7 @@ export function createCodingProductHost(options: CodingProductHostOptions): Codi
async listSkills(agentId) {
const project = await activeProject();
const assignedSkillIds = await selectedSkillIds(project.path, agentId);
const effective = options.effectiveResolver
const effective = agentId && options.effectiveResolver
? await options.effectiveResolver.resolve({
projectId: project.id,
projectPath: project.path,
@@ -687,11 +687,17 @@ export function createCodingProductHost(options: CodingProductHostOptions): Codi
// still supplies the availability set; only the worker opener receives
// the effective subset.
const skillIds = assignedSkillIds;
const enabledPluginIds = effective
? effective.effectiveSkillIds
: options.getEnabledPluginIds
? await options.getEnabledPluginIds(project.path)
: [];
// The unscoped list is the Agent assignment catalog. It must expose
// every project-enabled plugin Skill before that Skill has been assigned;
// the resolver's effective subset is only authoritative once an Agent is
// selected (and for worker-facing projections).
const enabledPluginIds = !agentId && options.getEnabledPluginIds
? await options.getEnabledPluginIds(project.path)
: effective
? effective.effectiveSkillIds
: options.getEnabledPluginIds
? await options.getEnabledPluginIds(project.path)
: [];
return await options.productTools.listSkills(
skillIds,
enabledPluginIds,