Skip to content

0.34.0

Choose a tag to compare

@cliftonc cliftonc released this 11 Nov 07:53
· 161 commits to main since this release
0.34.0
a4995dc

Suspended organisations run no agents, invitation and ownership rules hold on every path, API keys stay in their organisation, AI config saves lock their row, decide is metered, sign-in mail counts per mailbox, uploads stay capped, and Microsoft proves addresses.

  • Suspension: enqueueRun / enqueueRunBatch refuse a non-active tenant with 403 tenant_suspended (route, plugin and event trigger alike); executeRun settles a run whose tenant is suspended cancelled before any model call; isCancelRequested reads the tenant's status, so an executing run stops at its next poll; setTenantSuspended cancels the tenant's queued and awaiting_input runs. See docs/CONCEPTS.md §1.
  • Plugin hook: ServerPlugin.hooks.onTenantStatusChanged(db, tenantId, status, env) runs for every installed plugin after a suspend or reactivate, best-effort (runTenantStatusChangedHooks in utils/db/tenant-helpers.ts). See docs/CONCEPTS.md §16.
  • Invitations: acceptInvitation re-checks the issuer inside its transaction (exists, not blocked, a global admin or a member whose role could issue the invitation's role) and otherwise marks the row revoked and answers 410 invitation_revoked; changeMemberRole revokes the target's pending invitations the new role could not issue. See docs/CONCEPTS.md §1.
  • Ownership ceiling: MAX_OWNED_TENANTS_PER_USER is checked (assertMayOwnAnother, under the user-row lock) on a promotion to owner and on accepting an owner invitation, and also bounds creations per person per UTC day through the new tenant_creation_counters table, which has no foreign key to tenants. See docs/CONCEPTS.md §1.
  • API keys: a key acts only within its organisation plus its creator's own profile — GET /api/tenants lists the key's organisation alone, and POST /api/tenants, GET /api/invitations/pending and POST /api/access-requests answer 403 insufficient_scope to a key (withAccountAuth). See docs/CONCEPTS.md §2.
  • AI config saves: POST /api/ai/config reads the row it overwrites FOR UPDATE inside its transaction and decides whether the stored key stays on that row, so a concurrent save never leaves a key beside an endpoint it was not saved with. See docs/CONCEPTS.md §9.
  • Decide metering: ctx.decide's chat fallback runs through the run meter like ctx.chat.client — assertPriced and check() before each model call, one ai_usage row as each returns (a decide whose answer fails validation twice leaves both), priced on who pays for the agent-decide model; createDecide records once per ask only for TypeSafe. See docs/CONCEPTS.md §9.
  • Sign-in mail per recipient: the 5-per-15-minutes window is keyed on the canonical mailbox (canonicalMailbox: lower-cased, +tag dropped, dots dropped for gmail.com / googlemail.com), so tagged and dotted spellings of one mailbox share it; mail still goes to the address as typed. See docs/CONCEPTS.md §2.
  • Upload-path body cap: beneath UPLOAD_PATHS and a plugin's uploadPaths, a JSON body keeps the 1 MB cap and any other body is capped at MAX_UPLOAD_PATH_BODY_BYTES (10 MB + 64 KB) instead of skipping the cap; each upload route's own tighter cap still applies. See docs/CONCEPTS.md §3.
  • Microsoft address proof: the Microsoft provider sets emailVerified from Graph /organization (the UPN's domain among the directory's verified domains; a personal account, an unlisted domain or a failed lookup is false), and the OAuth callback refuses an unverified address only where it would match or admit an account — so for every provider, Google and OIDC included, an identity already linked now signs in even when the provider calls its address unverified. Personal Microsoft accounts sign in by linking from account settings first. See docs/CONCEPTS.md §2.

Porting note · Compare