Skip to content

Support Azure OpenAI for self-hosted onboarding#3379

Closed
alex-on-ai wants to merge 1 commit into
trycompai:mainfrom
alex-on-ai:agent/azure-openai-trigger-poc
Closed

Support Azure OpenAI for self-hosted onboarding#3379
alex-on-ai wants to merge 1 commit into
trycompai:mainfrom
alex-on-ai:agent/azure-openai-trigger-poc

Conversation

@alex-on-ai

@alex-on-ai alex-on-ai commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • add a shared AI provider that uses Azure OpenAI when Azure env vars are configured, while preserving AI Gateway/OpenAI behavior for default installs
  • make onboarding completion resilient when Trigger background jobs cannot be enqueued immediately
  • throttle and retry embedding upserts so low-quota Azure OpenAI deployments can finish linkage work
  • extend the risk/vendor linkage Trigger task max duration for slower self-hosted runs

Why

Self-hosted deployments that do not have AI Gateway configured currently fail during onboarding/vendor/risk generation. On Azure OpenAI, linkage can also fail on embedding rate limits because task/risk/vendor embedding batches run concurrently and the task hits the default 5 minute duration.

Validation

  • Verified equivalent patch on a self-hosted Azure VM with Azure OpenAI, Trigger dev runner, Postgres, Redis/Vector, and MinIO.
  • On the VM, onboarding generated 18 policies, 6 vendors, 5 risks, 35 task embeddings, 5 risk embeddings, 6 vendor embeddings, 40 risk-task links, and 48 vendor-task links.
  • Ran targeted ESLint on changed app files: no errors, existing warnings only.
  • Ran app typecheck; it currently fails on unrelated existing repo issues such as missing @trycompai/company / @trycompai/billing modules and pre-existing test fixture type errors.
  • Ran secret scan over this diff: no env secrets/tokens detected.

Notes

This is opened as a draft because it was derived from a self-hosted POC patch. It intentionally excludes deployment-only VM files such as Caddy config, Docker overrides, .env backups, and generated Prisma artifacts.


Summary by cubic

Adds Azure OpenAI support for self-hosted installs and hardens onboarding/linkage under low quotas and missing workers. Default installs keep using AI Gateway/OpenAI without changes.

  • New Features

    • Introduced a shared AI provider that prefers Azure when AZURE_* env vars are set, falling back to AI Gateway or OpenAI.
    • Updated chat and embedding calls to use the provider; supports Azure deployment-based models.
    • Added @ai-sdk/azure.
  • Bug Fixes

    • Onboarding completes even if Trigger jobs can’t be enqueued; background tasks are best-effort.
    • Embedding upserts now batch and retry with backoff; configurable via env. Also serialized task/risk/vendor upserts to reduce spikes.
    • Increased linkage task max duration to 20 minutes for slower self-hosted runs.

Written for commit 43f07b4. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@alex-on-ai is attempting to deploy a commit to the Comp AI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@alex-on-ai alex-on-ai closed this Jul 9, 2026
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