diff --git a/pkg/agentic/actions.go b/pkg/agentic/actions.go index 944ab4d..a085f51 100644 --- a/pkg/agentic/actions.go +++ b/pkg/agentic/actions.go @@ -193,7 +193,11 @@ func (s *PrepSubsystem) handlePersona(_ context.Context, options core.Options) c // // )) func (s *PrepSubsystem) handleComplete(ctx context.Context, options core.Options) core.Result { - return s.Core().Task("agent.completion").Run(ctx, s.Core(), options) + c := s.Core() + if c == nil { + return core.Result{Value: core.E("agentic.complete", "core runtime is required", nil), OK: false} + } + return c.Task("agent.completion").Run(ctx, c, options) } // input := agentic.CompleteInput{Workspace: "/srv/.core/workspace/core/go-io/task-42"} diff --git a/pkg/agentic/actions_test.go b/pkg/agentic/actions_test.go index 5368c24..840d467 100644 --- a/pkg/agentic/actions_test.go +++ b/pkg/agentic/actions_test.go @@ -201,6 +201,17 @@ func TestActions_HandleIngest_Bad_NoWorkspace(t *testing.T) { assert.False(t, r.OK) } +func TestActions_HandleComplete_Bad_NoCore(t *testing.T) { + s := &PrepSubsystem{} + + r := s.handleComplete(context.Background(), core.NewOptions()) + + assert.False(t, r.OK) + err, ok := r.Value.(error) + require.True(t, ok) + assert.Contains(t, err.Error(), "core runtime is required") +} + func TestActions_HandleWorkspaceQuery_Good(t *testing.T) { s := newPrepWithProcess() s.workspaces = core.NewRegistry[*WorkspaceStatus]()