Conversation
Fix Vector Search plugin type errors, lint, and test failures: - Use `payload` instead of `body` in apiClient.request() calls - Handle ExecutionResult discriminated union from execute() - Make getConfig route handler async to match RouteConfig type - Make indexes config optional to satisfy PluginConstructor constraint - Add setExecution to test logger mock - Sort exports in index.ts for Biome import ordering Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
The vector-search plugin imported from the connectors barrel, which re-exports the lakebase connector using a @/ path alias that tsx cannot resolve at runtime during integration tests. Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
tsx cannot resolve tsconfig @/ path aliases at runtime during integration tests. Replace all 5 occurrences in the appkit package with standard relative imports. Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
The vector-search plugin is not yet exported from @databricks/appkit, so the playground imported it directly from source. This caused a dual-singleton CacheManager issue during integration tests. Commenting out until vector-search is properly exported. Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
There was a problem hiding this comment.
Pull request overview
This PR focuses on getting AppKit CI passing by resolving TypeScript/lint/test failures around plugin execution results, SDK request payload shape, and module import paths.
Changes:
- Update Vector Search plugin + connector to use
apiClient.request({ payload })and to handleExecutionResult<T>(result.ok/result.data). - Adjust route handler typing (async handler), config typing (
indexes?), and test mocks/expectations to satisfy stricter type/lint checks. - Replace several
@/…path-alias imports with relative imports and apply minor ordering fixes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/appkit/src/plugins/vector-search/vector-search.ts | Handle ExecutionResult from execute(), add indexes runtime validation, async route handler, optional-chaining index resolution |
| packages/appkit/src/plugins/vector-search/types.ts | Make indexes optional in config type |
| packages/appkit/src/plugins/vector-search/tests/vector-search.test.ts | Update request assertion from .body to .payload; extend logger mock with setExecution |
| packages/appkit/src/plugins/vector-search/index.ts | Reorder exports for Biome import ordering |
| packages/appkit/src/plugins/server/vite-dev-server.ts | Switch mergeConfigDedup import from alias to relative |
| packages/appkit/src/plugin/dev-reader.ts | Switch remote-tunnel gate import from alias to relative |
| packages/appkit/src/connectors/vector-search/client.ts | Use payload instead of body in apiClient.request() |
| packages/appkit/src/connectors/lakebase/index.ts | Switch logger import from alias to relative |
| packages/appkit/src/connectors/lakebase-v1/client.ts | Switch telemetry import from alias to relative |
| packages/appkit/src/cache/index.ts | Switch lakebase connector import from alias to relative |
| apps/dev-playground/server/index.ts | Comment out Vector Search plugin usage pending export from @databricks/appkit |
Comments suppressed due to low confidence (1)
packages/appkit/src/plugins/vector-search/vector-search.ts:66
indexesis now optional inIVectorSearchConfig, butObject.entries(this.config.indexes)/Object.keys(this.config.indexes)still pass a possibly-undefined value. WithstrictNullChecks, this will fail typechecking. Consider assigning to a localconst indexes = this.config.indexesafter the guard (or using a non-null assertion) and then usingindexesforObject.entries/keysand logging.
if (!this.config.indexes || Object.keys(this.config.indexes).length === 0) {
throw new Error(
'VectorSearchPlugin requires at least one index in "indexes" config',
);
}
for (const [alias, idx] of Object.entries(this.config.indexes)) {
if (!idx.indexName) {
throw new Error(
`Index "${alias}" is missing required field "indexName"`,
);
}
if (!idx.columns || idx.columns.length === 0) {
throw new Error(`Index "${alias}" is missing required field "columns"`);
}
if (idx.pagination && !idx.endpointName) {
throw new Error(
`Index "${alias}" has pagination enabled but is missing "endpointName"`,
);
}
}
logger.debug(
"Vector Search plugin configured with %d index(es)",
Object.keys(this.config.indexes).length,
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkosiec
left a comment
There was a problem hiding this comment.
I got this diff on your branch after doing:
pnpm clean; pnpm build; pnpm docs:build; pnpm check:fix; pnpm -r typecheck
Could you please validate that? and already hide the vector search plugin maybe? Thanks!
❯ git diff
diff --git a/template/appkit.plugins.json b/template/appkit.plugins.json
index d1420d2e..e9289103 100644
--- a/template/appkit.plugins.json
+++ b/template/appkit.plugins.json
@@ -173,6 +173,34 @@
],
"optional": []
}
+ },
+ "vector-search": {
+ "name": "vector-search",
+ "displayName": "Vector Search Plugin",
+ "description": "Query Databricks Vector Search indexes with built-in hybrid search, reranking, and pagination",
+ "package": "@databricks/appkit",
+ "resources": {
+ "required": [
+ {
+ "type": "vector_search_index",
+ "alias": "Vector Search Index",
+ "resourceKey": "vector-search-index",
+ "description": "A Databricks Vector Search index to query. Index names configured via plugin config.",
+ "permission": "SELECT",
+ "fields": {
+ "indexName": {
+ "env": "DATABRICKS_VS_INDEX_NAME",
+ "description": "Three-level UC name of the default index (catalog.schema.index_name)"
+ },
+ "endpointName": {
+ "env": "DATABRICKS_VS_ENDPOINT_NAME",
+ "description": "Vector Search endpoint name (required for pagination)"
+ }
+ }
+ }
+ ],
+ "optional": []
+ }
}
}
}
pkosiec
left a comment
There was a problem hiding this comment.
LGTM - but please rename the PR title to avoid showing it up in the next AppKit release. Thanks!
no logic change, just getting CI to pass
there's more work coming here for docs and adjusting some internal funcionality
Fix Vector Search plugin type errors, lint, and test failures:
payloadinstead ofbodyin apiClient.request() calls