Skip to content

Drive vectorsdb dimension from the embeddings column only#212

Merged
abnegate merged 1 commit into
mainfrom
fix/vectorsdb-dimension-sync-embeddings
Jul 22, 2026
Merged

Drive vectorsdb dimension from the embeddings column only#212
abnegate merged 1 commit into
mainfrom
fix/vectorsdb-dimension-sync-embeddings

Conversation

@abnegate

Copy link
Copy Markdown
Member

Addresses the P1 on #211: the placeholder-only guard left a stale archived dimension uncorrected when it disagreed with the actual vector column size, while the pre-#211 behavior overwrote it from any vector column (the P1 on #210).

The embeddings column is the schema-defining vector of a vectorsdb collection, so it alone now drives dimension: mismatches (including the pre-dimension-archive placeholder) are corrected from its size, and other vector columns never touch the value. This satisfies both review findings simultaneously.

🤖 Generated with Claude Code

The placeholder-only guard left a stale archived dimension uncorrected
when it disagreed with the actual vector column size, while the
previous always-sync overwrote it from any vector column. The
embeddings column is the schema-defining vector of a vectorsdb
collection, so it alone now drives dimension: mismatches are corrected
from it and other vector columns never touch the value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 04:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes how vectorsdb collection dimensions are restored during Appwrite migrations.

  • Adds a constant for the embeddings vector key.
  • Limits dimension sync to the embeddings column.
  • Updates stale dimensions when the archived value differs from the column size.

Confidence Score: 5/5

This looks safe to merge after checking the non-standard vector-column case.

  • The main changed flow matches the intended embeddings-driven dimension behavior.
  • A collection without an embeddings vector can keep a stale archived dimension.

src/Migration/Destinations/Appwrite.php

Important Files Changed

Filename Overview
src/Migration/Destinations/Appwrite.php Updates vectorsdb dimension reconciliation so embeddings alone drives the stored collection dimension.

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/Migration/Destinations/Appwrite.php:1338
**Non-Embeddings Dimension Stays Stale**

When an archived vectorsdb collection has no serialized `dimension` and its vector column is named anything other than `embeddings`, this guard skips the only size-based correction path. The table keeps the placeholder or stale dimension, so the migrated collection can reject later vector writes because its stored dimension no longer matches the actual vector column size.

Reviews (1): Last reviewed commit: "fix: drive vectorsdb dimension from the ..." | Re-trigger Greptile

Comment thread src/Migration/Destinations/Appwrite.php
@abnegate
abnegate merged commit 9dc8295 into main Jul 22, 2026
4 checks passed
@abnegate
abnegate deleted the fix/vectorsdb-dimension-sync-embeddings branch July 22, 2026 04:10
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