feat: unify installation model catalog
This commit is contained in:
@@ -406,12 +406,12 @@ function numericBinding(binding: Record<string, string>, name: string): number |
|
||||
|
||||
function requireSupportedDescriptor(workspace: unknown): void {
|
||||
if (typeof workspace !== "object" || workspace === null) {
|
||||
throw new Error("Workspace diagnoser supports only workspace schema version 3");
|
||||
throw new Error("Workspace diagnoser supports only workspace schema version 4");
|
||||
}
|
||||
const metadata = Reflect.get(workspace, "workspace");
|
||||
if (typeof metadata !== "object" || metadata === null
|
||||
|| Reflect.get(metadata, "schema_version") !== 3) {
|
||||
throw new Error("Workspace diagnoser supports only workspace schema version 3");
|
||||
|| Reflect.get(metadata, "schema_version") !== 4) {
|
||||
throw new Error("Workspace diagnoser supports only workspace schema version 4");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,11 +506,15 @@ async function diagnoseValidatedWorkspace(
|
||||
try {
|
||||
const vector = await withTimeout(timeoutMs, (signal) => adapters.inspectQdrant({
|
||||
baseUrl: semanticRuntime.internalQdrantUrl,
|
||||
collection: descriptor.semantic_index.vector_store.collection,
|
||||
collection: descriptor.workspace.id,
|
||||
timeoutMs,
|
||||
signal,
|
||||
}));
|
||||
const expected = descriptor.semantic_index.vector_store;
|
||||
const expected = {
|
||||
collection: descriptor.workspace.id,
|
||||
dimensions: semanticRuntime.internalEmbeddingDimensions,
|
||||
distance: "cosine",
|
||||
};
|
||||
if (vector.collection !== expected.collection
|
||||
|| vector.dimensions !== expected.dimensions
|
||||
|| vector.distance !== expected.distance) {
|
||||
@@ -529,10 +533,8 @@ async function diagnoseValidatedWorkspace(
|
||||
timeoutMs,
|
||||
signal,
|
||||
}));
|
||||
if (semanticRuntime.internalEmbeddingModel !== descriptor.semantic_index.embedding.model
|
||||
|| semanticRuntime.internalEmbeddingDimensions !== descriptor.semantic_index.embedding.dimensions
|
||||
|| !embedding.available
|
||||
|| embedding.dimensions !== descriptor.semantic_index.embedding.dimensions) {
|
||||
if (!embedding.available
|
||||
|| embedding.dimensions !== semanticRuntime.internalEmbeddingDimensions) {
|
||||
diagnostics.push(diagnosticError("semantic_index_incompatible"));
|
||||
activatable = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user