Skip to content

fix(embeddings): preserve safe provider failure diagnostics - #7946

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/embedding-provider-error-diagnostics
Sep 17, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
codex/embedding-provider-error-diagnostics

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Log bounded embedding provider, model/deployment, HTTP status, recognized error codes, and request IDs internally without retaining response messages, document text, credentials, or full headers.
  • Classify embedding failures, including concurrent batch aggregates, separately from unavailable source content. Preserve existing caller-facing errors, retries, quota handling, and model selection.

Type of Change

  • Bug fix

Testing

  • 253 tests passed across embedding requests, diagnostic sanitization, connector diagnostics, and document processing.
  • Lint, application type-check, all 46 repository audits (including API boundary validation), block registry validation, and docs manifest verification passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 17, 2026 9:32pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable regression or outstanding repository-rule violation was identified.

Summary

This PR preserves bounded, sanitized diagnostics for embedding-provider failures and distinguishes wrapped embedding failures from unavailable source content.

  • Moves EmbeddingAPIError into a dedicated module and adds cycle-safe traversal through causes and aggregate errors.
  • Logs allowlisted provider metadata, status codes, request IDs, and machine-readable error codes without retaining free-form response content.
  • Classifies wrapped embedding failures separately in connector diagnostics while preserving caller-facing errors, quota handling, and retry behavior.
  • Adds coverage for provider diagnostics, malformed bodies, nested aggregates, cycles, and traversal bounds.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Embedding provider response] --> B{Response successful?}
  B -->|Yes| C[Validate and return embeddings]
  B -->|No| D[Read bounded response body]
  D --> E[Extract allowlisted code, type, and request ID]
  E --> F[Write sanitized internal diagnostic]
  F --> G[Create EmbeddingAPIError]
  G --> H{Quota exhausted?}
  H -->|Yes| I[Apply existing quota handling]
  H -->|No| J[Apply existing retry policy]
  G --> K[Cause or AggregateError wrappers]
  K --> L[Find bounded embedding failure]
  L --> M[Classify connector diagnostic as embedding]
Loading

Reviews (2) · Last reviewed commit: "fix(embeddings): classify aggregated bat..."

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/knowledge/connectors/connector-error.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 97f4e04 into staging Sep 17, 2026
34 of 35 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/embedding-provider-error-diagnostics branch September 17, 2026 21:40

This branch was previously deployed

1 inactive deployment
Preview 17c18a15 Deployed Sep 17, 2026 by vercel[bot]
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.

1 participant