GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mailer): permissions entitlements for enabling/disabling by icecrasher321 · Pull Request #5312 · simstudioai/sim

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Workspace admins should be able to enable/disable inboxes. AgentMail infra teardown on subscription deletion.

Type of Change

  • Bug fix

Testing

Tested manually

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
waleedlatif1 and others added 30 commits April 3, 2026 23:30
@waleedlatif1
v0.6.23: MCP fixes, remove local state in favor of server state, moth…
0b9019d
…ership workflow edits via sockets, ui improvements
@waleedlatif1
v0.6.24: copilot feedback wiring, captcha fixes
a54dcbe
@waleedlatif1
v0.6.25: cloudwatch, cloudformation, live kb sync, linear fixes, post…
28af223
…hog upgrade
@waleedlatif1
v0.6.26: ui improvements, multiple response blocks, docx previews, ol…
d889f32
…lama fix
@waleedlatif1
v0.6.27: new triggers, mothership improvements, files archive, queuei…
316bc8c
…ng improvements, posthog, secrets mutations
@waleedlatif1
v0.6.28: new docs, delete confirmation standardization, dagster integ…
3f508e4
…ration, signup method feature flags, SSO improvements
@TheodoreSpeaks
v0.6.29: login improvements, posthog telemetry (#4026)
d6ec115
* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <[email protected]>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
@waleedlatif1
v0.6.30: slack trigger enhancements, connectors performance improveme…
d7da35b
…nts, secrets performance, polling refactors, drag resources in mothership
@waleedlatif1
v0.6.31: elevenlabs voice, trigger.dev fixes, cloud whitelabeling for…
cf233bb
… enterprises
@waleedlatif1
v0.6.32: BYOK fixes, ui improvements, cloudwatch tools, jsm tools ext…
f8f3758
…ension
@waleedlatif1
v0.6.33: polling improvements, jsm forms tools, credentials reactquer…
3c8bb40
…y invalidation, HITL docs
@waleedlatif1
v0.6.34: trigger.dev fixes, CI speedup, atlassian error extractor
d33acf4
@waleedlatif1
v0.6.35: additional jira fields, HITL docs, logs cleanup efficiency
4f40c4c
@waleedlatif1
v0.6.36: new chunkers, sockets state machine, google sheets/drive/cal…
cbfab1c
…endar triggers, docs updates, integrations/models pages improvements
@waleedlatif1
v0.6.37: audit logs page, isolated-vm worker rotation, permission gro…
4309d06
…ups ui
@waleedlatif1
v0.6.38: models page
8b57476
@waleedlatif1
v0.6.39: billing fixes, tools audit, landing fix
e3d0e74
@waleedlatif1
v0.6.40: mothership tool loop, new skills, agiloft, STS, IAM integrat…
0ac0539
…ions, jira forms endpoints
@waleedlatif1
v0.6.41: webhooks fix, workers removal
3838b6e
@waleedlatif1
v0.6.42: mothership nested file reads, search modal improvements
fc07922
@waleedlatif1
v0.6.43: mothership billing idempotency, env var resolution fixes
3a1b1a8
@waleedlatif1
v0.6.44: streamdown, mothership intelligence, excel extension
46ffc49
@Sg312
v0.6.45: superagent, csp, brightdata integration, gemini response for…
010435c
…mat, logs performance improvements

fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179)
fix(landing): return 404 for invalid dynamic route slugs (#4182)
improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170)
fix(gemini): support structured output with tools on Gemini 3 models (#4184)
feat(brightdata): add Bright Data integration with 8 tools (#4183)
fix(mothership): fix superagent credentials (#4185)
fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
@icecrasher321
Merge pull request #4190 from simstudioai/staging
c0bc62c
v0.6.46: mothership streaming fixes, brightdata integration
@waleedlatif1
v0.6.46: mothership queueing, web vitals
387cc97
@waleedlatif1
v0.6.47: files focusing, documentation, opus 4.7
2dbc7fd
@waleedlatif1
v0.6.48: import csv into tables, subflow fixes, CSP updates
8a50f18
@waleedlatif1
v0.6.49: deploy sockets event, resolver, logs improvements, monday.co…
dcf3302
…m integration, atlassian triggers
@icecrasher321
v0.6.50: ppt/doc/pdf worker isolation, docs, chat, sidebar improvements
bc09865
@waleedlatif1
v0.6.51: tables improvements, billing fixes, 404 pages, code hygiene
5f56e46
waleedlatif1 and others added 19 commits June 10, 2026 13:20
@waleedlatif1
v0.7.1: chat voice mode model update, sim trigger, codepipeline integ…
7ffc495
…ration, smooth streaming, security hardening, db fixes
@icecrasher321
v0.7.2: logs export security, code hygiene, mship cost attribution
d4722f9
@TheodoreSpeaks
v0.7.3: jira oauth scope fix, read-replica client, table wire data fi…
f4d22ff
…x, db migrations from ci, docs updates, read replicas

v0.7.3: jira oauth scope fix, read-replica client, table wire data fix, db migrations from ci, docs updates, read replicas
@waleedlatif1
v0.7.4: round-robin byok support, table block fix, db read replica ro…
a48b4a1
…uting, trigger.dev, temporal, latex, quartr, brex, convex integrations
@waleedlatif1
v0.7.5: deployments API and block, vanta integration, performance imp…
79d98b3
…rovements, styling consolidation
@waleedlatif1
v0.7.6: calendar scheduled tasks, new hubspot tools, virtualized chat…
e6587ca
…, db perf improvements
@waleedlatif1
v0.7.7: square, context.dev integrations, scheduled tasks styling cha…
8c3706e
…nges, code hygiene
@waleedlatif1
v0.7.8: security hardening, code hygiene, MSFT oauth provider, new at…
59d9496
…lassian assets and google calendar tools
@icecrasher321
v0.7.9: agent file attachments, chat autoscroll, knowledge base uploa…
56a88a2
…d, security fixes
@icecrasher321
v0.7.10: models sorting, compress/decompress file block tools, new en…
db47da5
…richment providers, deepseek models, db performance
@waleedlatif1
v0.7.11: parallel subagents, new tools, rich markdown editor, governa…
8df34a3
…nce, file sharing, scheduled tasks granularity
@icecrasher321
v0.7.12: mcp servers ui/ux fixes, nuqs for query param management
aaca750
@TheodoreSpeaks
v0.7.13: pii redaction, react query frontend refactor, pi coding agen…
ad0b867
…t harness, sakana fugu provider

v0.7.13: pii redaction, react query frontend refactor, pi coding agent harness, sakana fugu provider
@waleedlatif1
v0.7.14: perf improvements, code hygiene, GitLab private host support
11168f9
@waleedlatif1
v0.7.15: academy, perf improvements, db attribution, kb tags filter f…
613e8ea
…ix, settings overhaul, thrive learning integration
@waleedlatif1
v0.7.16: security hardening, db o11y and profiling, settings UI
38c088a
@waleedlatif1
v0.7.17: emcn and workflow renderer isolated package, popular blocks …
0371856
…extension, workspace forking, slack trigger extension, new README
Vikhyath Mondreti
fix(mailer): permissions entitlements for enabling/disabling
8205b38
Vikhyath Mondreti
fix lifecycle for agentmail infra
6c1175f
@vercel

vercel Bot commented Jul 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 1, 2026 3:54am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Jul 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches billing gates, inbound webhooks, and destructive inbox teardown via cron; grace logic limits accidental teardown on past_due, but wrong entitlement checks could block paying workspaces or leave infra provisioned too long.

Overview
Sim Mailer (inbox) entitlement is now evaluated per workspace billing entity instead of the signed-in user, so org-backed workspaces and external admins can manage inboxes when the workspace’s org or billed account is on Max/Enterprise.

API & billing: hasInboxAccess(userId) is replaced by hasWorkspaceInboxAccess(workspaceId) (usable subscription) and hasWorkspaceInboxGraceAccess(workspaceId) (active or past_due, fails open for teardown). Inbox GET returns an entitled flag; PATCH allows disable without a plan but gates enable/address updates on workspace entitlement. AgentMail webhooks reject mail with not_entitled when the workspace no longer qualifies.

Ops: A new cron /api/cron/reconcile-inbox-entitlement (daily in Helm) disables AgentMail for workspaces still marked enabled after a terminal plan lapse.

UI: Settings use server entitled instead of client subscription checks; admins with a stale enabled inbox can still turn it off; sidebar “Max” lock for inbox follows workspace entitlement; rejected tasks show “Plan no longer includes Sim Mailer”.

Reviewed by Cursor Bugbot for commit 6c1175f. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves Sim Mailer entitlement checks to workspace billing. The main changes are:

  • Workspace-based entitlement helpers for inbox access and teardown grace.
  • API and webhook checks that reject non-entitled inbox use.
  • UI updates that read the new entitled inbox config field.
  • A daily cron job to reclaim AgentMail resources after entitlement loss.

Confidence Score: 4/5

The personal-workspace entitlement path needs a fix before merging.

  • Personal workspaces can gain inbox access through unrelated organization memberships.
  • The cleanup cron can keep personal inbox infrastructure for the same reason.
  • The API, UI, webhook, and cron wiring otherwise follows the intended workspace-based flow.

apps/sim/lib/billing/core/subscription.ts

Security Review

Personal workspaces can inherit Sim Mailer entitlement from unrelated organization memberships because the new personal-workspace path uses the broad highest-priority subscription lookup.

Important Files Changed

Filename Overview
apps/sim/lib/billing/core/subscription.ts Adds workspace-scoped inbox entitlement helpers, but the personal-workspace branch can use unrelated organization subscriptions.
apps/sim/app/api/workspaces/[id]/inbox/route.ts Returns entitlement in the inbox config and allows admins to disable an inbox after entitlement loss.
apps/sim/app/api/webhooks/agentmail/route.ts Rejects inbound AgentMail messages when the workspace entitlement helper returns false.
apps/sim/app/api/cron/reconcile-inbox-entitlement/route.ts Adds an authenticated cron route that disables enabled inboxes after grace entitlement is lost.
apps/sim/app/workspace/[workspaceId]/settings/components/inbox/inbox.tsx Updates inbox settings rendering to use the config-level entitlement flag.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-sidebar.tsx Locks the Inbox sidebar item based on inbox config entitlement instead of generic Max access.

Reviews (1): Last reviewed commit: "fix lifecycle for agentmail infra" | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Jul 1, 2026
View reviewed changes
Comment thread apps/sim/lib/billing/core/subscription.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/billing/core/subscription.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 1, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6c1175f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/app/api/workspaces/[id]/inbox/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/webhooks/agentmail/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview July 1, 2026 03:46
View deployment
Vikhyath Mondreti @claude
Merge origin/staging into make-badge-workspace-scoped
7e945ec
Resolve conflict in scripts/check-api-validation-contracts.ts: staging
deleted the contact route (removed from allowlists) while this branch added
the reconcile-inbox-entitlement cron. Net route count is unchanged at 881,
so the baseline is set to 881 (both allowlist edits kept).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vercel
vercel Bot deployed to Preview July 1, 2026 03:54
View deployment
@icecrasher321
icecrasher321 merged commit ca34301 into staging Jul 1, 2026
15 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321
icecrasher321 deleted the make-badge-workspace-scoped branch July 1, 2026 04:23
@icecrasher321 icecrasher321 mentioned this pull request Jul 1, 2026
v0.7.18: landing, tools depth, media embeds in md editor, sonnet 5 #5296
Merged

This branch was successfully deployed

1 active deployment
Preview — 7e945ec3 Deployed Jul 1, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@icecrasher321 @waleedlatif1 @TheodoreSpeaks @Sg312
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.