fix(gateway): report why curators are disabled instead of never reporting
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-09 00:11:03 +11:00
1 parent db377380a0
commit 21a523bd35
1 file changed
+7 -4
+7 -4
View File
@@ -24,12 +24,12 @@ import (
"github.com/samcharles93/archie-core/internal/infrastructure/toolbuilder"
)
func (b *server) setupCurators(ctx context.Context) bool {
func (b *server) setupCurators(ctx context.Context) error {
log := b.log.With("component", "curator")
model, err := b.chatModels.ModelFor(ctx)
if err != nil {
log.WarnContext(ctx, "curators disabled: chat model unavailable; configure a chat model and restart the gateway", "err", err)
return false
return fmt.Errorf("curators disabled until the gateway restarts with a chat model: %w", err)
}
skillsRoot := b.cfg.SkillsDir
if skillsRoot == "" {
@@ -60,7 +60,7 @@ func (b *server) setupCurators(ctx context.Context) bool {
b.addCleanup(shutdownCuratorRuntime(rt, log))
reg := b.curatorRegistry
b.addCleanup(shutdownCuratorRegistry(reg, log))
return true
return nil
}
//nolint:contextcheck // shutdown runs after the parent context is cancelled
@@ -218,7 +218,10 @@ func (b *server) watchCurators(ctx context.Context, version int64) error {
func (b *server) startCurators(ctx context.Context) error {
// Curators wake on this process's turns and read its conversations.
if !b.setupCurators(ctx) {
// A disabled runtime is reported, so the dashboard shows why curators do
// not apply rather than a process that never reported.
if err := b.setupCurators(ctx); err != nil {
b.applyStatus.Report(ctx, controlplanestore.CuratorsKind, 0, err)
return nil
}
if err := b.curatorRuntime.Start(ctx); err != nil {