Skip to content

[comp] Production Deploy#2497

Merged
Marfuen merged 20 commits intoreleasefrom
main
Apr 10, 2026
Merged

[comp] Production Deploy#2497
Marfuen merged 20 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.

github-actions bot and others added 8 commits April 9, 2026 19:18
Skip organizations where no member has logged in within 90 days.
Prevents sending emails to dead/abandoned addresses that may have
become spam traps, which contributes to domain reputation damage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds hasAccess and onboardingCompleted filters alongside the 90-day
session check. This excludes ~4,087 orgs (831 ghost + 3,256 churned)
from receiving weekly digest emails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GET /v1/admin/organizations/activity

Returns per-org activity data: last session, last audit log, and
combined last activity timestamp. Supports filtering by hasAccess,
onboardingCompleted, and inactivity threshold.

Used for identifying inactive orgs that should be suppressed from
email notifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents inactiveDays=0 from silently defaulting to 90.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
parseInt returns NaN on invalid input, which is not nullish so ??
won't catch it. Use Number.isFinite to properly fall back to 90.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per Tofik's review - match the same member scope used in the
select clause so deactivated members don't count as active.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
[dev] [claudfuen] fix/suppress-inactive-org-emails
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Apr 10, 2026 4:48pm
comp-framework-editor Ready Ready Preview, Comment Apr 10, 2026 4:48pm
portal (staging) Ready Ready Preview, Comment Apr 10, 2026 4:48pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 10, 2026

PR Summary

Medium Risk
Adds a new platform-admin reporting endpoint and changes org-selection logic for weekly reminder emails, which could affect admin visibility and notification volume. Also introduces new browser automation enable/disable/delete actions and onboarding idempotency logic that touch persisted state and user flows.

Overview
Platform admin reporting: adds GET /v1/admin/organizations/activity backed by getOrgActivity, returning per-org last session/audit activity plus pagination and hasAccess/onboarded/inactiveDays filters.

Browser automations: updates Stagehand model IDs, and adds UI + hook support to pause/enable and delete automations (with disabled-state handling for scheduling and running).

Onboarding & notifications: makes minimal org creation idempotent (reuses an existing not-onboarded org and completes missing initialization) and blocks duplicate form submissions; weekly task reminder emails now target only orgs with access, completed onboarding, and member sessions within the last 90 days. Removes unused resend helpers from apps/app and apps/portal.

Reviewed by Cursor Bugbot for commit cfee2f2. Bugbot is set up for automated code reviews on this repo. Configure here.

tofikwest and others added 9 commits April 10, 2026 11:17
Helps diagnose org health - an org with 0 tasks, 0 policies, and
0 audit logs is clearly a ghost regardless of session data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…/toggle controls

The Stagehand model config used 'claude-3-7-sonnet-latest' without the
required 'provider/model' prefix, causing "Unsupported model" errors.
Updated both init and CUA agent models to use
'anthropic/claude-sonnet-4-5-20250929'.

Also added delete automation and enable/disable toggle to the frontend
for a more complete MVP experience.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eDays

- Add deactivated:false to members query in getOrgActivity so deactivated
  users don't inflate lastSession or get picked as owner
- Clamp inactiveDays to non-negative to prevent future-dated cutoffs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… paused

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(browser-automation): fix Stagehand v3 model format and add MVP controls
Organization model uses singular `policy` not `policies`.
Would have caused runtime Prisma validation error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(app): prevent duplicate org creation during setup onboarding

When users retry or refresh during the redirect after org creation,
the action fires again and creates a duplicate org. Add server-side
idempotency check that reuses an existing incomplete org with the
same name owned by the user, plus a client-side guard against
double-submission.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(app): complete partial setup when reusing existing org

When reusing an existing incomplete org (idempotency path), ensure
onboarding record and framework initialization exist. Handles the
case where the original request failed after DB insert but before
completing all setup steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Tofik Hasanov <72318342+tofikwest@users.noreply.github.com>
Both apps/app and apps/portal had orphaned Resend client
initializations that nothing imported. All email sending
goes through Trigger.dev via the API.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.20.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants