Files
esengine 4ca0351086 fix(composition): say which module is unavailable and why
The unavailable refusal carried the module and detail only inside a nested
diagnostics list, so the window filled a generic sentence from a code alone.
Flat module/detail params now cross the boundary and both languages use them.
2026-10-20 00:21:21 -07:00

30 lines
1.0 KiB
Go

package boot
import (
"fmt"
"reasonix/internal/contract/agentcomposition"
"reasonix/internal/contract/config"
"reasonix/internal/ext/pluginpkg"
)
func (b *builder) validateCompositionAvailability() error {
if err := b.prompt.skillStore.ValidateSnapshot(); err != nil {
return agentcomposition.Unavailable("skills", err.Error())
}
if err := b.tools.host.CompositionContractError(); err != nil {
return fmt.Errorf("%w: %w", agentcomposition.ErrUnavailable, err)
}
for _, entry := range b.cfg.Plugins {
decision, _, err := config.DefaultActivationStore().ServerDecision(entry, b.root)
if err != nil {
return fmt.Errorf("%w: %w", agentcomposition.ErrUnavailable, err)
}
if decision == config.ActivationDisabled {
return agentcomposition.Unavailable(entry.Name, "MCP authorization was revoked.")
}
}
installed, _ := pluginpkg.LoadInstalled(b.roots.Home())
return verifySelected("extensions", b.opts.Composition.Resolved.Extensions, installed, func(p pluginpkg.InstalledPackage) string { return p.Installed.Name })
}