Repository navigation
fix(kilo-mcp): watch router schema inputs and prune stale vectors - #8603
Merged
Merged
Conversation
A router input schema can come from an import: zod schemas from services/cloud-agent-next/src/shared, and schemas or limits from @kilocode/app-shared, cloud-agent-profile, cloud-agent-sdk, kiloclaw-instance-tiers, kiloclaw-secret-catalog, organization-entitlement and session-ingest-contracts. None of those paths matched the catalog workflow's change detection or ci.yml's kilocode_backend filter, so a schema-only change reached main with no catalog regeneration and no Vectorize upsert. Changing PREVIEW_PORT_MIN alone rewrites inputSchema in two catalog rows. - Add those workspaces to both change-detection patterns. - Derive the workspace set in scripts/kilo-mcp-catalog.test.mjs from the router sources' imports and fail when a workspace is neither in the pattern nor covered by web-test's byte-for-byte catalog test. The test also asserts the PR and merge patterns stay identical. - Prune: after the upsert, list the index and delete every vector whose procedure path left the catalog (delete_by_ids, 100 ids per request). An empty catalog prunes nothing, so a bad artifact cannot empty the index.
chrarnoldus
approved these changes
Oct 22, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the widened catalog change-detection patterns, the derived coverage test, and the new stale-vector prune against the current router imports, workflow wiring, and catalog semantics; the change is consistent and fails safe on the paths I could verify. Assumptions:
Files Reviewed (4 files)
Reviewed by deepseek-flash-latest · Input: 196.9K · Output: 34.2K · Cached: 3M Review guidance: REVIEW.md from base branch |
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes two gates that let the kilo-mcp catalog and its Vectorize index fall behind the code.
Change detection missed schema inputs. A router
.input()schema can be built from an import: relative schemas fromservices/cloud-agent-next/src/shared/, and schemas or limits from@kilocode/app-shared,cloud-agent-profile,cloud-agent-sdk,kiloclaw-instance-tiers,kiloclaw-secret-catalog,organization-entitlementandsession-ingest-contracts. Those paths matched neither the catalog workflow's detection pattern norci.yml'skilocode_backendfilter, so a schema-only change reached main with no catalog regeneration and no Vectorize upsert.No prune.
embed-catalog.tsonly upserted, so a removed or renamed procedure kept its vector id. The search drops ids that are absent from the catalog, so no bad call reached an agent, but stale ids competed for the kNN slots.How
scripts/kilo-mcp-catalog.test.mjsderives the workspace set from the router sources' imports and fails when a workspace is neither in the detection pattern nor covered byweb-test's byte-for-byte catalog test. The same test asserts the PR and merge patterns stay identical, and a mutation test proves the derived check bites.delete_by_ids, 100 ids per request, paginated list). An empty catalog prunes nothing, so a bad artifact cannot empty the index.Verification
node --test scripts/kilo-mcp-catalog.test.mjs: all pass, including the derived coverage check.vitest run src/embed-catalog-script.test.ts: prune covers deletion, cursor paging, the in-sync no-op, the empty-catalog skip and the batch size.delete_by_idsfor exactly the two ids the catalog lacks.services/cloud-agent-next/src/shared/preview-port.tsmadedump.ts --checkreport two stale rows, with no CI job watching that file.