Skip to content

fix(api): remove embedding property access from debug endpoints#23

Merged
GMNAPI merged 1 commit into
mainfrom
fix/typescript-embedding-errors
Feb 7, 2026
Merged

fix(api): remove embedding property access from debug endpoints#23
GMNAPI merged 1 commit into
mainfrom
fix/typescript-embedding-errors

Conversation

@GMNAPI

@GMNAPI GMNAPI commented Feb 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove references to r.chunk.embedding in /retrieve and /debug endpoints that were causing TypeScript build errors (TS2339)
  • ContentChunk type does not include an embedding property — embeddings are stored in the vector DB and not returned on retrieval queries
  • Replace embeddingPrefix with score in /debug endpoint for more useful diagnostics

Root cause: PR #17 (debug endpoints) accessed r.chunk.embedding but RetrievalResult.chunk is typed as ContentChunk, which does not have an embedding field. The EmbeddedChunk type (which includes embeddings) only exists during the ingestion phase.

Impact: This error was blocking ALL Railway deployments since PR #17.

Verification

  • pnpm build passes with zero TypeScript errors
  • Railway deployment succeeds after merge

Test plan

  1. Merge PR
  2. Verify Railway build completes without TypeScript errors
  3. Test /debug endpoint returns valid JSON with score instead of embeddingPrefix
  4. Test /retrieve endpoint returns chunks without embeddingPrefix

Remove references to r.chunk.embedding in /retrieve and /debug endpoints. ContentChunk does not have an embedding property - embeddings are stored in the vector DB and not returned on retrieval queries. Replace embeddingPrefix with score in /debug for more useful diagnostics.

Fixes TypeScript build error blocking Railway deployments since PR #17.

Co-authored-by: Cursor <cursoragent@cursor.com>
@GMNAPI GMNAPI merged commit 0eb29ea into main Feb 7, 2026
1 check 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