Skip to content

feat(models): email workflow owners when a workflow runs a deprecated model - #10531

Merged
waleedlatif1 merged 5 commits into
stagingfrom
feat/deprecated-model-email
Dec 1, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
feat/deprecated-model-email

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • When a workflow calls a model whose provider retired it (sunset.status === 'deprecated'), Sim emails the workflow's owner and the workspace admins (up to 10) to say which model it is and to pick a current one
  • Sent at most once per workflow and model every 30 days, so a workflow that keeps running doesn't spam anyone
  • Fired from the executor (Agent handler and executeBlockProviderRequest, which covers Router, Evaluator and model fallbacks) without being awaited: it never throws or delays the model call. Runs with a side-effect policy (dry runs, workflow tests) never send it
  • Each sender's claim has its own token and lasts 30 minutes while sending. It extends to 30 days only after at least one email is delivered, and is released otherwise so a later run retries
  • Uses the notifications email type, so the existing unsubscribe preference applies
  • Moved the owner + admin recipient lookup out of the schedule-disabled notifier into a shared lib/workflows/notifications/recipients.ts
  • Re-recorded the tool-registry module baseline. Staging already sits at the limit for /api/v2/blocks/[blockId], and the shared recipients module adds one more. The registry is still unreachable from every guarded entry

Type of Change

  • New feature

Testing

  • lib/workflows/notifications/deprecated-model.test.ts (new) and lib/workflows/schedules/disable-notifications.test.ts: 10 passed. Red-checked the dedupe guard: removing it fails its test
  • biome, check:boundaries, check:client-boundary, check:file-names, check:comment-hygiene, check:test-patterns, check:source-conventions, check:tool-registry-boundary

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • 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 Dec 1, 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 Dec 1, 2026 4:32am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The changes since the previous review appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes since the previous review appear safe to merge.

Summary

Adds retired-model emails for workflow owners and workspace admins.

  • Live workflow runs notify owners when they use retired models.
  • Workflow notices share one lookup for owners and workspace admins.
  • The tool-registry boundary check uses an updated module baseline.

No new actionable issues were found in the changes since the previous review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Agent, Router, Evaluator, or generic tool] --> B{Live run and retired model?}
  B -->|No| C[Continue without email]
  B -->|Yes| D[Start notice without awaiting]
  D --> E{Sending claim acquired?}
  E -->|No| C
  E -->|Yes| F[Email owner and workspace admins]
  F --> G{Any send succeeded?}
  G -->|Yes| H[Keep claim for 30 days]
  G -->|No| I[Release claim for retry]
Loading

Reviews (4) · Last reviewed commit: "fix(models): send deprecated-model notic..." · Reviewed by Greptile

Comment thread apps/sim/providers/index.ts Resolved
@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 Dec 1, 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.

All reported issues were addressed across 12 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/providers/index.ts Resolved
@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 Dec 1, 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.

All reported issues were addressed across 14 files

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

Turn on auto-fix | Re-trigger cubic

@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 Dec 1, 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 16 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 1187560 into staging Dec 1, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/deprecated-model-email branch December 1, 2026 06:07

This branch was previously deployed

1 inactive deployment
Preview — c8fe22dc Deployed Dec 1, 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