Skip to content

feat(provider): add Qdrant Cloud REST provider - #218

Merged
l1shen merged 2 commits into
oomol-lab:mainfrom
vinkiYu:codex/add-qdrant-cloud-provider
Jul 28, 2026
Merged

feat(provider): add Qdrant Cloud REST provider#218
l1shen merged 2 commits into
oomol-lab:mainfrom
vinkiYu:codex/add-qdrant-cloud-provider

Conversation

@vinkiYu

@vinkiYu vinkiYu commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

中文

概要

新增 Qdrant Cloud Provider,通过官方 REST API 提供 7 个可本地执行的向量数据库 Action:

  • qdrant.list_collections
  • qdrant.get_collection
  • qdrant.create_collection
  • qdrant.upsert_points
  • qdrant.get_point
  • qdrant.query_points
  • qdrant.scroll_points

主要变更

  • 使用 custom_credential,支持 Qdrant Cloud clusterUrlapiKey
  • Credential Validator 通过 GET /collections 验证数据库访问权限。
  • 仅支持 HTTPS、官方 *.cloud.qdrant.io 主机和 6333 端口。
  • 所有请求使用共享 SSRF 防护 Fetch,不启用私网访问或 DNS 校验绕过。
  • 支持 unnamed dense vectors、JSON payload、基础 Qdrant filter 和单页 scroll 分页。
  • Upsert 使用单次 PUT .../points?wait=true 请求,避免写入与可见性之间的竞态。
  • 统一处理 Qdrant 响应包络、超时、取消、非 JSON 响应和 HTTP 错误。
  • 严格拒绝 named/sparse vector 字段,保持首版能力边界清晰。
  • 未增加 npm 依赖、共享运行时改动或 Provider Proxy。

验证

  • Qdrant 定向测试:9/9 通过。
  • 完整测试:58 个文件、557 个测试全部通过。
  • TypeScript 检查通过。
  • oxlint 通过。
  • oxfmt 格式检查通过。
  • Catalog 已生成并包含 7 个 Qdrant Action;生成文件未提交。

English

Summary

Add a locally executable Qdrant Cloud Provider backed by the official REST API with seven vector-database actions:

  • qdrant.list_collections
  • qdrant.get_collection
  • qdrant.create_collection
  • qdrant.upsert_points
  • qdrant.get_point
  • qdrant.query_points
  • qdrant.scroll_points

Changes

  • Add custom_credential authentication with Qdrant Cloud clusterUrl and apiKey.
  • Validate credentials through GET /collections to verify database access.
  • Restrict URLs to HTTPS, official *.cloud.qdrant.io hosts, and port 6333.
  • Route every request through the shared SSRF-protected Fetch without private-network access or DNS-validation bypasses.
  • Support unnamed dense vectors, JSON payloads, basic Qdrant filters, and single-page scroll pagination.
  • Use one PUT .../points?wait=true request for upserts to provide write visibility without a separate race-prone request.
  • Normalize Qdrant response envelopes and handle timeouts, cancellation, non-JSON responses, and HTTP errors consistently.
  • Reject named/sparse vector fields explicitly to keep the initial capability boundary clear.
  • Add no npm dependencies, shared runtime changes, or Provider Proxy.

Verification

  • Qdrant focused tests: 9/9 passed.
  • Full test suite: 58 files, 557 tests passed.
  • TypeScript check passed.
  • oxlint passed.
  • oxfmt check passed.
  • Catalog generation includes all seven Qdrant actions; generated files are not committed.

Scope Notes

This initial provider intentionally excludes self-hosted Qdrant, gRPC, named/sparse/multivectors, deletion operations, aliases, snapshots, payload indexes, and arbitrary endpoint proxying.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 620bac43-f58f-4dd6-bd4a-30adc10aa701

📥 Commits

Reviewing files that changed from the base of the PR and between 64aed1c and 8940069.

📒 Files selected for processing (4)
  • src/providers/qdrant/actions.ts
  • src/providers/qdrant/definition.ts
  • src/providers/qdrant/runtime.test.ts
  • src/providers/qdrant/runtime.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/providers/qdrant/definition.ts
  • src/providers/qdrant/actions.ts
  • src/providers/qdrant/runtime.test.ts
  • src/providers/qdrant/runtime.ts

Summary by CodeRabbit

  • New Features
    • Added Qdrant Cloud integration with secure credential configuration.
    • Added actions to list, view, create, upsert, and manage collections.
    • Added support for inserting, retrieving, querying, and scrolling through points.
    • Added credential validation with collection-count metadata and consistent error handling.
  • Bug Fixes
    • Added strict input validation for collection names, point IDs, payloads, and vectors.
    • Improved pagination normalization and operation ID handling for query/scroll flows.
    • Hardened request/response envelope parsing and error mapping, including phase-aware auth handling.

Walkthrough

Adds a Qdrant Cloud provider with seven collection and point actions, JSON-schema contracts, custom credential configuration, executor wiring, and a runtime for authenticated HTTP requests. The runtime validates cluster URLs and inputs, normalizes Qdrant responses and pagination, and maps transport, validation, timeout, and API errors. Tests cover request construction, credential validation, input rejection, pagination, URL validation, response envelopes, and error mapping.

Sequence Diagram(s)

sequenceDiagram
  participant ProviderExecutor
  participant qdrantActionHandlers
  participant requestQdrantJson
  participant QdrantCloudAPI
  ProviderExecutor->>qdrantActionHandlers: execute Qdrant action
  qdrantActionHandlers->>requestQdrantJson: construct authenticated request
  requestQdrantJson->>QdrantCloudAPI: send HTTP request
  QdrantCloudAPI-->>requestQdrantJson: return response envelope
  requestQdrantJson-->>qdrantActionHandlers: return unwrapped result
  qdrantActionHandlers-->>ProviderExecutor: return normalized output
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the required type(scope): subject format and clearly summarizes the Qdrant Cloud REST provider change.
Description check ✅ Passed The description is clearly related to the Qdrant provider changes and matches the scope of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/providers/qdrant/executors.ts (1)

11-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the exported QdrantContext type instead of ReturnType<typeof createQdrantContext>.

QdrantContext is already exported from ./runtime.ts; referencing it directly is more readable than deriving it via ReturnType.

♻️ Suggested refactor
-import { createQdrantContext, qdrantActionHandlers, validateQdrantCredential } from "./runtime.ts";
+import type { QdrantContext } from "./runtime.ts";
+import { createQdrantContext, qdrantActionHandlers, validateQdrantCredential } from "./runtime.ts";
@@
-  async createContext(context: ExecutionContext, fetcher): Promise<ReturnType<typeof createQdrantContext>> {
+  async createContext(context: ExecutionContext, fetcher): Promise<QdrantContext> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/qdrant/executors.ts` around lines 11 - 14, Update the
createContext method’s return type to use the exported QdrantContext type from
./runtime.ts instead of ReturnType<typeof createQdrantContext>, adding or
adjusting the import as needed while preserving the existing implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/qdrant/actions.ts`:
- Around line 12-17: Update the min_should field description in filterSchema to
describe the expected Qdrant object shape, including conditions and min_count,
rather than describing it as a standalone minimum number. Leave the other filter
fields unchanged.

---

Nitpick comments:
In `@src/providers/qdrant/executors.ts`:
- Around line 11-14: Update the createContext method’s return type to use the
exported QdrantContext type from ./runtime.ts instead of ReturnType<typeof
createQdrantContext>, adding or adjusting the import as needed while preserving
the existing implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa5fc71c-e437-4835-bd46-12c027931654

📥 Commits

Reviewing files that changed from the base of the PR and between ee067c6 and 64aed1c.

📒 Files selected for processing (5)
  • src/providers/qdrant/actions.ts
  • src/providers/qdrant/definition.ts
  • src/providers/qdrant/executors.ts
  • src/providers/qdrant/runtime.test.ts
  • src/providers/qdrant/runtime.ts

Comment thread src/providers/qdrant/actions.ts
@l1shen

l1shen commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

已根据 review 完成修复并推送:对齐 Qdrant Point ID 的 schema 与运行时校验,保留并正确校验 collection name,修正 min_should schema,同时兼容 Qdrant Cloud 的 443/6333 端口,并补充了相关回归测试。

本地验证已通过:npm run generate:catalognpm run fix-checknpm test(58 files / 561 tests)。

@l1shen
l1shen merged commit d07e27b into oomol-lab:main Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants