fix(knowledge): classify rejected BYOK embedding keys - #7226
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR preserves embedding credential ownership on provider errors and gives rejected customer-managed keys a terminal, actionable document-processing outcome while retaining the existing hard-failure behavior for platform credentials.
Confidence Score: 5/5The PR appears safe to merge; the changed ownership classification and terminal retry behavior are consistent across embedding, persistence, and worker paths. Customer-managed 401/403 failures propagate as the original typed error into actionable document handling, while platform-owned and quota failures remain on their distinct existing paths; no actionable defect remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/embeddings/client.ts | Propagates credential ownership into embedding errors and introduces a guarded classifier for non-quota BYOK 401/403 responses. |
| apps/sim/background/knowledge-processing.ts | Converts rejected customer-managed credentials into an actionable terminal worker outcome while continuing to throw platform credential failures. |
| apps/sim/lib/knowledge/documents/service.ts | Persists the actionable rejection message, marks the failed document terminal for automatic processing, and keeps manual retry available. |
| apps/sim/lib/embeddings/index.ts | Exposes the new rejection classifier and customer-facing message through the embeddings barrel. |
| apps/sim/background/knowledge-processing.test.ts | Covers distinct worker behavior for customer-managed and platform-owned rejected credentials. |
| apps/sim/lib/embeddings/client.test.ts | Covers ownership propagation and ensures quota-related BYOK responses are not treated as credential rejection. |
| apps/sim/lib/knowledge/documents/document-processing-source.test.ts | Verifies rejected BYOK credentials persist an actionable terminal document failure. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Embedding request] --> B{Provider response}
B -->|Success| C[Persist embeddings]
B -->|Quota exhausted| D[Existing quota handling]
B -->|401 or 403| E{Customer-managed credential?}
E -->|Yes| F[Persist actionable document failure]
F --> G[Stop automatic retries]
E -->|No| H[Preserve hard-failure path]
Reviews (1): Last reviewed commit: "fix(knowledge): classify rejected BYOK e..." | Re-trigger Greptile
Summary
Type of Change
Testing
bunx vitest run background/knowledge-processing.test.ts lib/embeddings/client.test.ts lib/knowledge/documents/document-processing-source.test.tsbun run type-check --filter=@sim/appbun run lintbun run apps/sim/scripts/check-block-registry.ts origin/stagingbun run check:auditsChecklist
Screenshots/Videos
Not applicable; this change has no UI surface.