Skip to content

v0.9.74: two-factor authentication, polling backoff and admission fixes, mothership tool forms - #10740

Merged
waleedlatif1 merged 37 commits into
mainfrom
staging
Dec 5, 2026
Merged

waleedlatif1 merged 37 commits into
mainfrom
staging

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

waleedlatif1 and others added 15 commits December 3, 2026 10:56
Co-authored-by: Sim Pi Agent <pi@sim.ai>
…ts (#10732)

Source apply runs the tool-binding authoring check only for a Copilot principal, so no benchmark or user-run test saw it refuse source the SDK prints. A corpus test now prints every tool the editor's picker writes, adds it to the workflow as source, and gates it as Copilot and as a user; Copilot must get nothing a user does not.

It found three more refusals beside #10722's: a block tool's title and tool id (the block name and the tool its operation selects), an inline custom tool's custom-<name> id, and the server name and URL the picker records on a Sim Chat MCP tool. Authoring now derives the first two from the binding's definition, as it does for child workflow and MCP tools, and Sim Chat MCP params accept the recorded server name and URL.
…2026 (#10735)

Co-authored-by: Sim Pi Agent <pi@sim.ai>
…opping them (#10733)

* fix(polling): keep items refused by execution admission instead of dropping them

* test(billing): expect the limit-reached reason when a reservation spends the whole limit
#10723)

* feat(auth): two-factor authentication and organization 2FA requirement

Authenticator-app (TOTP) two-factor with backup codes via Better Auth's
twoFactor plugin, plus an Enterprise "Require two-factor authentication"
organization setting.

- Sim guard plugin challenges every first-factor sign-in (email code,
  email verification, Google/GitHub/Microsoft, SSO), not only password
  sign-in, and session creation refuses unrecognized paths for 2FA users.
- Members of a requiring organization enroll before any session exists
  (/two-factor/setup + the plugin's verify endpoint); turning the
  requirement on signs out unenrolled members; enforcement follows the
  Enterprise entitlement.
- Disabling, re-enrolling, or regenerating backup codes needs a current
  code, with lockout; disabling is refused while required.
- Platform-admin "Reset two-factor" for lost authenticators.
- Sign-in challenge page, settings sections, docs.

* chore(docs): regenerate docs manifest for the two-factor page

* fix(auth): harden two-factor, audit its lifecycle, align the challenge page with the auth UI

* fix(auth): two-factor setup request method, list padding, copy, and docs from the end-to-end walk

* improvement(auth): read two-factor results from mutations, fail closed on policy load, tighten tests

* fix(auth): report the enforced two-factor requirement, cover desktop session reads, fail closed on check errors

* fix(auth): batch two-factor grant revocation, audit before read-back, step-up backup codes without dash, review fixes

* chore(auth): re-record module baseline for the two-factor auth plugin

* fix(auth): keep the change-authenticator and new-codes dialogs open until finished
…osoft Sentinel, and Datadog (#10737)

Co-authored-by: Sim Pi Agent <pi@sim.ai>
…nce, and email when a trigger is turned off (#10736)

* fix(polling): back off failed polls, disable revoked credentials at once, and email when a trigger is turned off

* fix(polling): honor Retry-After from Outlook and HubSpot, and log trigger-disabled emails that were not sent

* fix(polling): honor Retry-After from Gmail search too
…share the resource resolver with corpus tests (#10734)

- valueKindMatches('upload') now accepts file() nodes, so a list mixing a workspace file and an
  uploaded object compiles into the upload member instead of the pair's text twin
- extract the pure resolver (keys, files by path, uploadOf, skills) into resource-resolver.ts;
  loadResourceKeyResolver and CORPUS_RESOURCES both build on it
- add stored workspace-file upload cases for every file-upload field to the round-trip corpus
…d() and how to make it editable (#10730)

A code field (a Function's code) holding a detected credential prints whole as stored(), and its W_LITERAL_SECRET hint said to interpolate env.NAME in a t template, which does not apply to code. The finding now says the whole code is hidden, and that storing the key as a workspace secret read as {{NAME}} ($env.NAME in a JavaScript code file) lets the next get print it. Print, compile and both tool paths carry the field's value kind. The CLI appends the sim secrets set command to that hint.
@waleedlatif1
waleedlatif1 requested a review from a team as a code owner December 3, 2026 21:52
@vercel

vercel Bot commented Dec 3, 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 5, 2026 12:57am UTC

Request Review

@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 150 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/webhooks/polling/imap.ts Resolved
Comment thread apps/sim/lib/webhooks/processor.ts Resolved
Comment thread apps/sim/lib/auth/two-factor/policy.ts Resolved
Comment thread apps/sim/lib/sim-search/live/http.ts Resolved
Comment thread apps/sim/lib/auth/auth.ts Resolved
Comment thread apps/sim/lib/auth/two-factor/guard.ts Resolved
Comment thread apps/sim/lib/auth/two-factor/guard.ts Resolved
Comment thread apps/sim/lib/sim-search/live/http.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

…name (#10746)

The default short-id alphabet includes '_' and '-', so about one run in nine
named the missing class something the RuntimeClass name check rejects before
the cluster lookup the test asserts on.
…cal output (#10745)

Sort Object.keys with compareStrings and read fields directly instead of Object.entries, and quote printable-ASCII keys without calling JSON.stringify. A seeded differential test pins the output, and the errors it throws, to the previous implementation.
… for a literal token (#10742)

* fix(workflow-code): give print the same credential hint compile gives for a literal token

Print and compile now derive a W_LITERAL_SECRET finding's field traits through one secretFieldOf in secrets.ts, which reuses isCredentialIdTwin. A literal token in a credential pair's manual input printed the generic env hint under the member id; it now names the written param and says credential('<key>'), as compile does, including when compiling stored().

* fix(workflow-code): name credential() for a literal token in an agent tool's credential pair

Agent tool params key a pair's value by its canonical id, which names no subBlock, so secretFieldOf now takes that id and matches the credential pair through it.
…ate primer, compact display findings (#10754)

* perf(cli): print what apply rewrote, drop the starter's duplicate primer, compact display findings

- workflows/workspaces source apply and create list the lines the reprint changed in the files
  they sent as `rewrote` (path -> context-free hunks, capped at 60 lines; {} when nothing
  changed), so an agent edits on without rereading workflow.ts; primer and help say so
- a create starter's JSON result names the guide instead of embedding its primer (agents read
  .sim/AGENTS.md anyway, Mothership holds the primer as a skill); --verbose keeps it
- display findings print only a frame's marked lines, and a hint once per code

* perf(cli): share the rewrite budget across writes, skip diffs past it, color display diffs; primer policy in printTreeResult

* chore(cli): drop a comment the rewrites TSDoc already says

* fix(cli): never list a workflow folder's .sim records as rewritten

* fix(cli): primer rereads a file rewrote says to; share hint dedupe across a command's prints
waleedlatif1 and others added 2 commits December 3, 2026 17:21
…d requests (#10743)

* feat(credential-groups): people status chips, send reminder, integrations header cleanup

- People: one status badge per person (Revoked > Email failed > Needs reconnect >
  Connected > Expired > Invited); needs-reconnect connections shown distinctly
  instead of being filtered out
- Row menu: Resend -> Send reminder, hidden once the enrollment is completed
- Remove uncalled props (searchConnection, panel, filters, setupFallback,
  requestDisabled, enabled, visibleProviders) and the 'Revoke all account access' variant
- Integrations: drop the persistent help text; 'Update configurations' becomes a
  header overflow 'Re-apply app configuration' with a confirm modal; provider ->
  integration in catalog and toast/remove copy
- Invitation email: org groups read '{Org}', not '{Org} workspace' (explicit ownerKind)
- README: current tab and action names

* feat(credential-groups): Slack return allowlist, specific enrollment link errors, connect sign-in

- lib/credential-groups/return-url: closed allowlist (slack.com/app_redirect, *.slack.com,
  slack://app|open|channel) matched on the raw string before parsing
- OAuth attempt state carries a validated returnUrl and a 'connect' returnTo; the callback
  reads the destination only from stored state; enroll and completion pages render a
  'Return to Slack' link (never an automatic redirect)
- explainCredentialGroupEnrollmentLink: expired / revoked / paused / delivery failed /
  wrong account outcomes for a signed-in person; others see only a masked address
- login: credential-group callbacks get 'Sign in to connect your accounts' with social first

* feat(credential-groups): enrollment links stop rotating invitations

Invitation bearer tokens move to a new credential_group_enrollment_link
table (migration 0489, expand-only, backfilled one 'email' link per
existing enrollment). Issuing a link (admin invite, resend, self or viewer
enroll) inserts a link and never invalidates another, so an emailed link
keeps working after the person connects themselves, and an OAuth attempt
started before a resend still completes.

- Every token check (public resolve, bind, completion, OAuth and MCP grant
  persistence) goes through liveEnrollmentLinkCondition: an unrevoked
  link, unexpired only while the enrollment has no bound user. A hash with
  no link row falls back to the legacy column the released app still
  writes during the deploy window.
- invitation_token_hash stays NOT NULL and mirrors the newest link so a
  rollback keeps working; invitation_expires_at keeps the latest expiry.
- Self/viewer enroll no longer resets createdBy, invitedAt, sentAt or
  status on an existing enrollment; admin invite and resend keep their
  behavior, and resend's sentAt write is guarded by its own link.
- Disconnect and revoke revoke every link; a reinvitation after
  revocation issues a fresh link without reviving the old ones.
- delivery_failed no longer blocks a session-verified or bound person
  holding a live link (completion, MCP grants, personal tokens).

* feat(credential-groups): workflow connection status and requests

- Credential block: get_connection_status (collapsed connected / not_connected /
  needs_reconnect + credentialId + stable connectUrl) and request_connection
  (constant { requested, connectUrl } result).
- Shared connect URL builder lib/credential-groups/connect-url.ts.
- Org admin policy for workflow connection requests, stored as a
  WorkflowConnectionRequests statement in the organization account access policy
  (v2 documents without it still parse; absent = off). Access updates preserve it.
  Read/update org operations, route, contract, React Query hook, and an Access tab
  section.
- requestOrganizationAccountConnection: policy-gated (enabled, workspace, email
  domain, provider), daily cap under a group lock, per-email invitation lock,
  creates only absent enrollments (never reactivates revoked or re-attributes an
  admin invite), optional email with the connect link, audited with the workflow
  as actor.
- Expand-only migration: nullable credential_group_enrollment.requested_by_workflow_id.
- Real-Postgres integration tests for status mapping and request guards; codec tests.

* feat(credential-groups): connect page, focused links, auto-complete

- /credential-groups/<publicId>/connect resolves the signed-in, verified
  person's own enrollment (resolveCredentialGroupConnectTarget, session
  operation credential_groups.connect.resolve) and mints a one-hour
  'connect' link focused on the single matching option, then hands off to
  the enroll page. Outcomes: ready, wrong_account, not_invited, revoked,
  choose_option, unavailable (unknown ID, disabled group, entitlement off and
  unoffered provider answer identically). Organization members with no
  enrollment go through member self-enroll. `provider` is the credential
  provider ID; `return=slack` opens slack://open, other values must pass the
  Slack allowlist. The session is the authority, so an unbound enrollment
  whose invitation expired (or that a workflow requested with no link) still
  connects. Per-IP and per-user rate limits.
- Focused links are enforced server-side: OAuth start/complete for another
  option and MCP start/complete are refused (CredentialGroupLinkFocusError,
  redirected with oauth=other_option), and the enroll page shows only the
  focused option with no Submit.
- A connection saved through a focused link completes the enrollment and
  fires form_submitted once, through the same path as Submit.
- findCredentialGroupEnrollmentLinkRecord resolves through the link table
  (legacy column fallback as liveEnrollmentLinkCondition), so revoked and
  expired links are explained; a link revoked by a disconnect on a live
  enrollment reads "Link no longer active".
- lib/credential-groups/connect-url.ts (shared with W3), publicId in the org
  accounts response, and a "Copy connect link" menu on the People tab.
- Unavailable / wrong-account states lifted into app/credential-groups/link-states.tsx.

* fix(credential-groups): store workflow request policy apart from Access

- Request policy moves to its own table (credential_group_connection_request_policy,
  own revision; no row = off). The Access resource-policy document, its codec, the DB
  validator, and the Access save path are back to staging byte for byte, so old pods and
  rollbacks keep reading every Access document. The connections.request evaluator action
  is gone.
- Turning requests off skips workspace/integration cross-checks and prunes stale ids;
  reads prune them too. Policy lists normalize on parse (no separate sorted refine);
  oversized lists are validation errors.
- Request log table (credential_group_connection_request): every accepted request,
  whatever the person's state, is logged and counts toward the daily cap, which is
  checked before any per-address lookup and fails identically for every target.
- Emails go through the outbox (enqueued in the request transaction, delivered detached
  right away, retried by the worker), so the response never waits on rendering or
  sending. The handler re-reads the enrollment and sends nothing to a revoked or bound
  person; success clears lastDeliveryError.
- Reminders: only for workflow-created, unbound, invited enrollments, when no request for
  the address was logged in the last day, at most 3, none after 30 days; the claim is a
  conditional UPDATE so a racing revoke sends nothing.
- request_connection refuses + aliases. Invitation email names the requesting workflow
  (from the workflow record) and the organization.
- Block drops the redundant provider output; docs updated. connect-url.ts matches the
  shared builder. requireCurrentWorkflow exported instead of a wrapper.
- Admin UI: "Connection requests from workflows", summary with workspaces and email
  state, exact-domain and daily-limit hints, inline free-mail domain warning.
- Integration tests: stale-policy disable, cap counts existing addresses, identical cap
  error, plus-alias refusal, reminder cap and 30-day stop, revoke race, Access and
  request policy saves independent.

* fix(credential-groups): link lifecycle and Slack return audit findings

- Reinviting an enrollment the released app revoked (status only) now revokes
  every link into it first, so old emailed/self links cannot come back to life.
- A legacy-column invitation with no link row (emailed by the released app
  during a deploy) is adopted as an 'email' link before the column is
  overwritten.
- Delivery bookkeeping is guarded on invitedAt as well, so a slower, older send
  can no longer record delivery_failed (or sentAt) over a newer send.
- 'self' and 'connect' links always expire after one hour; only an emailed
  link outlives its expiry once the enrollment is bound. The link outcome
  explains an expired connect link accordingly. invitation_expires_at (the
  admin-visible expiry) now tracks the newest emailed link only.
- Removed the session-less bearer completeCredentialGroupEnrollment and
  getPublicCredentialGroupEnrollment (no production callers), their tests and
  mocks, plus a mock-asserting and a constant-restating test assertion.
- The completion page no longer reads ?return=: a Slack destination is stored
  server-side bound to the signed-in user (completion-return) and only its
  opaque returnId travels in the redirect, from both the OAuth callback and the
  Submit path. On failure it offers Open Sim and Return to Slack.
- Return allowlist narrowed to slack.com/app_redirect (app/team/channel only),
  slack://open, and slack://app?team=T…&id=A….
- The OAuth start route no longer validates the return URL itself; the use
  case and attempt state do. An overlong return (up to 8192) is ignored, not a
  400.
- Copy: revoked shows the title only, needs-new-link asks "an admin at {Org}
  for a new link", completion copy uses "accounts".
- Login recognizes absolute same-origin /credential-groups/ callbacks and shows
  the divider in connect mode whenever another method follows social sign-in.

* fix(credential-groups): connect page audit findings and wave seams

- Connect page: an org member with no enrollment is enrolled only by a confirmation POST
  (/api/credential-groups/connect/[publicId]), never on GET, and only after the member
  self-enroll checks (integrations.manage permission group, finished setup); refusals read
  not_invited. A revocation racing self-enrollment reads revoked, other refusals unavailable;
  no second bind after self-enroll.
- Focused links refuse Submit (/complete); the MCP start route keeps returnTo/return on every
  redirect back. Copy: stable-link unavailable message, masked email on wrong_account,
  "You can close this tab." beside Return to Slack.
- Enrollments created without an emailed link (self-enroll, workflow request, disconnect) store
  an unissued placeholder in the legacy token column that no token hashes to, so link adoption
  skips it and pruning a session link cannot revive its token through the column.
- Retention: the outbox processor prunes connection request rows after two days and self/connect
  links a day past expiry, in bounded batches, with indexes for both.
- 0490 is replay-safe; connect URLs and the enroll handoff come from connect-url.ts.
- Fix a TDZ read of `focused` in the enroll page's error handler.

* fix(credential-groups): connect UI, copy, and docs review findings

- Integrations rows get Copy connect link; People drops the floating menu
- People: Send reminder hidden only when connected or revoked, no menu on
  revoked rows, gray account chips, Loading… and request-led empty state
- Workflow connection requests: clearer labels, All workspaces, free-mail
  warning through the field hint
- Connect page: Connect your {Integration} account with a centered button,
  shorter not-invited copy, Return to Slack on dead ends (also on enroll)
- Completion: Try again after a failed Integrations connection, Slack
  secondary on failure, failure-aware page title, Slack continue copy
- Sign-in title, invitation email footer for workflow requests
- Credential block: Integration labels, person@example.com placeholder,
  Request Connection guidance; docs follow

* refactor(credential-groups): split enrollment links and the connect flow out of enrollments

- links.ts holds link storage: liveness condition (now an indexed primary-key lookup instead of
  an EXISTS-or-legacy filter that scanned every enrollment), its TypeScript expiry rule, link
  insertion shared by emailed, self and connect links, legacy adoption, the link record reader,
  and the focus error with a code-based predicate the routes use.
- connect-subject.ts loads the connect target and mints the connect link, self-enrolling and
  binding in the same locked transaction.
- The connect page resolves read-only, then a separate start operation writes and audits; a
  revocation racing it reports revoked, an unfinished setup reports unavailable.
- Explaining a failed link is a defined use case; an expired connect link offers Start again,
  and a failed delivery is no longer an outcome.
- The confirmation POST requires a same-origin request and has its own rate-limit bucket.
- An admin reinvitation clears a workflow's request marker and reminder count.
- Workflow connection lookups read the policy and public ID from the resolved context and refuse
  through one pure policy check.
- Completion redirects take an options object; one DAY_MS and invitation lifetime.
- README and 0489 record link lifetimes, revocation semantics during deploy, and the contract
  phase for the legacy invitation column.

* refactor(credential-groups): prune connect history from its own cron job

The connection-request log and expired session links are pruned by an hourly
cleanup-credential-group-links job (background task, cron route, Helm, Compose crontab and
self-hosting docs), following cleanup-oauth-tokens, instead of from the outbox processor, whose
changes are reverted.

* fix(credential-groups): safer connection request emails and a Slack return for workflows

- The email subject names only the organization and integration; the body shows the workflow
  name with control and formatting characters removed, cut to 60 characters.
- The email handler skips an enrollment an admin has since reinvited, records a failed delivery
  as delivery_failed like an admin invitation, writes only while the enrollment is as the request
  left it, and never throws after the provider accepted the email, so it is not sent twice.
- The Credential block's connection operations take a Return to input (none or Slack) that the
  connect URL carries as return=slack.
- Saving the request policy uses the contract-parsed policy instead of parsing it again.

* test(credential-groups): connect flow proofs and merge reconciliation

Reconciliation after the core and UI lanes merged:
- One helper in return-url.ts turns a stable connect URL's `return` value into a destination:
  only the keyword `slack` (the Slack app), shared by the connect page and the connect use case;
  the enroll page keeps accepting the validated URL the server put on its link.
- A workflow's repeat request emails with a "Reminder: ..." subject (organization and integration
  only). The inbox preview no longer shows the workflow name, which appears only in the body.
- The Credential block's Return to options read None / Slack; the block docs describe the input.
- The organization-accounts query mock covers the personal-accounts and request-policy hooks.
- Fix the enroll page's duplicated slackReturnUrl prop left by the merge.
- Request Connection's use case returns only { requested, connectUrl }; the enrollment and
  whether it was created stay inside the module for the audit row.

Tests (each shown red against a reverted guard):
- 0489 backfill: legacy invitations become one emailed link each, a replay adds nothing, and
  every token answers as it did through the legacy column.
- Connect POST: IP limit, signed-out/unverified, per-person limit, non-ready outcomes, no-store
  and no-referrer on success, no GET handler.
- Request Connection answers revoked, admin-invited and new people identically; the limit test
  seeds a real revoked enrollment; the one-day window; concurrent repeats send one reminder.
- Admin request policy refuses a member, another organization's admin, and a stale revision.
- Focused links refuse MCP completion and always read their one option; MCP grants refuse
  revoked and expired links at real Postgres; racing saves complete the enrollment once.
- A revocation holding the lifecycle lock wins over a waiting completion; a bounced invitation
  still binds its person, a status-revoked one does not.
- Retention keeps rows exactly at the cutoff, skips locked rows, and caps batches per run.
- Lock-wait helpers wait on the specific holder (pg_blocking_pids), not any lock in the server.
- Removed call-order and mock-argument unit tests now covered at the real boundary.

* refactor(credential-groups): simplify and cleanup pass

Connect page runs only the start use case (drops the read-only resolve twin), shared helpers for unissued enrollments, revocation, pending workflow requests and no-store redirects, strict same-origin check moved to lib/core/security, lib throws OrchestrationError directly, cleanup job on the cleanup pool, admin modal validates with the policy schema, duplicate error surfaces removed, comment fixes.

* feat(credential-groups): lane E connect states, people statuses, policy UX, docs

- Connect page: presentational states in link-states (ConnectConfirm, DifferentEmail,
  NotInvited with Switch account, RequestExpired, VerifyEmail, ChooseConnectOption) and a
  shared action row that pairs Return to Slack with "You can close this tab."
- Enroll page: a focused connect link opened by someone already connected shows
  "{Integration} connected"; Slack returns use the shared action row
- People: Invited/Requested/Expired/Email failed/Not connected/Connected/Needs reconnect/
  Revoked, Requested by workflow marker, reminder while any active option lacks a
  connection, Re-invite on revoked rows
- Workflow requests policy: close modal and toast on revision conflict, header switch
  opens the editor when the saved policy cannot be enabled, Not in effect badge, inline
  domain errors, labelled toggle, loading skeleton, All allowed workspaces
- Contracts: requestedByWorkflow/emailed on People rows, inEffect on the policy read
- Docs: when Sim emails, lower-cased event email, listen for added and reconnected,
  member-only status links, Find returns the first match, editor runs are real,
  policy is the only request gate, Return to Slack opens the app

* refactor(credential-groups): one link expiry rule, revoked check, and request lifecycle

- liveEnrollmentLinkCondition refuses a revoked enrollment itself; caller copies removed
- unexpiredLinkCondition is the single expiry rule for lookups, link explanations and
  retention; a bound person's emailed link stops expiring only while the legacy column
  names it, so the pre-link app's disconnect ends it
- enrollment-lifecycle holds the pure row rules (unissued values, revoked, request expiry);
  findOrCreateUnissuedEnrollment is the one locked find-or-create for link-less enrollments
- an unbound enrollment is a request that expires at invitation_expires_at; People's expired
  flag uses the same predicate
- email verification that a deployment cannot enforce counts as verified for enrollments
- retention drains are isolated from each other's failures
- 0490 adds requested_provider_id and puts the enrollment columns first

* feat(credential-groups): read-only connect page, start POST, and one return destination

- openCredentialGroupConnect (GET page) only reads; startCredentialGroupConnect (same-origin
  POST) enrolls or binds and mints the focused link in one transaction, then goes straight to
  the provider's OAuth start; refusals, limits and outages return to the page, never JSON
- outcomes: ready_to_connect, confirm_self_enrollment, wrong_account, different_email,
  not_invited, expired, revoked, choose_option, unavailable, verify_email
- connect URLs built for one person carry a for= request handle (keyed hash of group and
  email); a mismatch says so without revealing the address and never self-enrolls
- page and POST share one session gate; a limiter outage is told apart from a real limit
- ConnectReturnDestination ('slack') travels block input, return=slack, OAuth attempt and
  completion redirect, resolved to slack://open only where rendered; the Redis completion
  return store and URL allowlist are gone; the in-app return enum is renamed origin
- OAuth attempts live 30 minutes (state v6, MCP v5); an expired attempt still offers the way
  back to Slack
- signed-in OAuth starts are bounded by their enrollment, not the shared IP bucket
- a focused connection completes the enrollment only when every active option is connected
  or a workflow requested it
- reconnecting the wrong account tells an invitee which account to choose

* feat(credential-groups): workflow request cap, reminders, policy effect, and block copy

- the daily cap counts distinct addresses; asking again today is unlogged and uncapped
- a workflow request, its reminder, and an admin reminder renew an unanswered request
- an admin's Send reminder on a workflow's open request re-sends that workflow's request for
  its integration and keeps the attribution
- request emails use the outbox's default attempts and record sentAt only on delivery
- the policy read reports inEffect; saving rejects an integration no chosen workspace may use;
  conflict copy and a wider free-mail list
- org invitations no longer name the group; the workflow email asks the person to sign in or
  create a Sim account with their address
- the block input is returnTo; the dropdown hides ORGANIZATION_OPERATIONS from the block;
  handler copy says Integration and asks for the primary email

* fix(credential-groups): renew a member's expired request from the connect page

- an organization member who passes the self-enroll checks (membership, Integrations
  capability, setup) and whose own unbound request expired is offered the confirm step
  instead of the expired dead end; non-members still see expired
- the start POST renews that enrollment (invitation_expires_at) and binds it in the same
  transaction that mints the focused link, instead of creating another enrollment
- a request-handle mismatch is still refused first and never renews

* refactor(credential-groups): make the link table the only invitation token authority

The 0490 backfill still turns each existing invitation_token_hash into one
emailed link. After that, nothing reads or writes the enrollment column:

- drop the legacy-column branch of liveEnrollmentLinkCondition, the token
  lookup fallback, and adoptLegacyInvitationLink
- stop mirroring the newest emailed link into the column; a bound person's
  emailed links simply do not expire (self and connect links always do)
- drop the unissued: placeholder helpers and the cleanup job's column check
- revoked is status === 'revoked' alone; a reinvitation no longer re-revokes
  links a revocation already revoked
- 0490 makes invitation_token_hash nullable; schema.ts marks it unused and
  scheduled for removal by its own contract migration
- remove tests of old-app behavior; fixtures seed link rows instead of the
  column; README states current behavior only

* fix(credential-groups): harden connect flow, people status, and request cap

- Refuse every workflow connection request once the daily cap is reached,
  repeats included, so the cap reveals nothing about other workspaces.
- Re-check membership, Integrations capability and setup inside the link
  transaction for self-enrollment and expired-request renewal.
- Spend the per-person connect budget only on the Connect POST; the page
  keeps its per-IP limit.
- Send malformed and cross-origin Connect POSTs back to the connect page
  (unavailable / try again) instead of JSON.
- Add an already_connected outcome to the connect page so a connected
  person is not sent through consent again; needs-reauth still connects.
- People: expose `bound` (drop `emailed`, derived from sentAt), rework the
  status order, label "Send email" before any email, surface per-email
  re-invite failures; policy row explains "Not in effect" and Save shows
  why it is disabled.
- Connect/enroll/complete pages: recovery stays primary beside Return to
  Slack, "You can close this tab." only once connected, no Open Sim on a
  focused connect link, Slack return kept on early states, clearer expired
  copy; one slackHref vocabulary.
- Block and refusal copy name the integration; scripts stop writing
  invitation_token_hash; docs and README match.

* fix(credential-groups): type the enrollment detail's bound and workflow fields

* fix(credential-groups): narrow expired OAuth attempts in tests, bump chart for the cleanup cron

* fix(credential-groups): address connect-flow review findings

- Dry run: answer a Credential block's request_connection whole, like other
  blocks that write outside the tool seam, so no enrollment or email is made.
- A workflow's open request records the latest workflow and integration
  together, so a reminder names the workflow that asked for it.
- A focused connection finishes a workflow's request only when the requested
  integration is connected (or every option is).
- Connect page: unknown, disabled and unoffered groups answer unavailable
  before the verify-email step.
- Explain answers unknown to a viewer whose email is unverified.
- Connect link refusals roll back, so a refused self-enrollment leaves no row.
- Policy editor opened from the switch saves the policy enabled.
- Request log and session link retention share an inclusive cutoff.
- Workflow names collapse whitespace before control characters are removed;
  invitation email says the 7 days apply before the person accepts.
- Integration tests: release held locks in finally, assert in_progress, and
  clean up the delivery suite's outbox events.

* fix(credential-groups): deliver a request email only while its request is current

* chore(ci): retrigger checks after runner infrastructure failures
… it leaves (#10751)

* fix(workspaces): scope a departure's ownership scan to the workspaces it leaves

Leaving a workspace takes its Project lock exclusively and then asks which
workspaces the departing member owns shared resources in. That query scanned
every row the member had ever created, in every workspace, and only the
answer for the workspaces being left was used. For a member who has created
a lot it takes tens of seconds, with the Project lock held throughout: a
second departure or a file write in the same Project waits out the 5s lock
timeout and fails with "Project is changing; retry the operation", and a
retry that arrives after the slow departure commits is refused because the
member has already left.

Both ownership scans now take the ids the departure hands off (its
workspaces, and their Projects), so the lookup reads only those rows.
Callers that need every workspace or Project (account deletion, the
departure preview, organization departure's Project pass) still scan
unscoped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* improvement(workspaces): leave a workspace and remove a teammate optimistically

* fix(workspaces): keep a left workspace out of the switcher while a list re-fetch races the leave

Leaving the open workspace moves to the next one, and the visit that records
re-fetches the workspace list. When that re-fetch reads the server before the
leave commits, it overwrites the optimistic removal and the left workspace
shows in the switcher again until the leave settles.

useOrderedWorkspacesQuery now hides any workspace whose leave is pending,
tracked through a leave mutation key. The leave removes the workspace from the
lists again on success, and onSettled returns the list re-fetch, so the leave
stays pending until the list is current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(workspaces): return the user to where they were when a leave is refused

Leaving the open workspace moves to the next one before the server answers.
When the server refuses the leave (the last admin, the billing account), the
rollback restored the workspace list but left the user on the other workspace.

A refusal now takes the user back to the path they left, unless they have
moved on to another workspace since. It pushes that path directly: the
navigation away may still be in flight, and the rollback makes the left
workspace active again, so switchWorkspace would do nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(workspaces): yield to the macrotask queue instead of sleeping in the leave hook test

check:test-patterns refuses a new wall-clock wait in a unit test, and the
refused-leave navigation test flushed React Query with sleep(1). It now
yields with flushMacrotask, which is a zero-delay turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Waleed Latif <walif6@gmail.com>
…0758)

* test(search): preserve admission failure attribution and retry hints

* fix(search): distinguish admission outages from provider failures
@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 4, 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.

9 issues found across 392 files

Confidence score: 3/5

  • block-executor.ts can let a whitespace-padded request_connection bypass the dry-run policy even though the handler executes it. Normalize the operation before the policy check.
  • organization-account-management.ts can send a reminder and renew enrollment for a disabled group; the reminder also drops the Slack return target. Check that the group is active and preserve the return target.
  • The workspace leave flow closes the modal before the request finishes, and a refused leave restores only the pathname, losing query-driven state. Keep the modal pending until the request resolves and include the current query string in the rollback URL.
  • Back-forward cache restores can leave signup disabled or verification stuck in verifying; reset those states on persisted pageshow. Challenged signups also skip sign_up tracking even though the account is already created.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/credential-groups/application/organization-account-management.ts">

<violation number="1" location="apps/sim/lib/credential-groups/application/organization-account-management.ts:212">
P2: The reminder branch skips the disabled-group check that ordinary resend enforces, so a disabled group still sends a connection-request email and renews the enrollment. Check `group.status !== 'active'` before calling `remindWorkflowConnectionRequest`, matching `getInvitationContext`.</violation>

<violation number="2" location="apps/sim/lib/credential-groups/application/organization-account-management.ts:222">
P2: The reminder's connect URL drops `return=slack`, which the original workflow request carried for Slack-originated requests. The enrollment stores no `returnTo`, so the reminder cannot restore it. Either persist the destination on the enrollment or accept that reminders lose the Return to Slack action.</violation>
</file>

<file name="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx:412">
P2: The leave modal now closes before the request runs, and the pending state was removed, so the user gets no feedback while the leave request is in flight. Keep the modal open with a pending state until `onLeaveWorkspace` resolves, and only close it on success. Otherwise, restore the `pending`/`pendingLabel` props.</violation>
</file>

<file name="packages/sim-cli/src/commands/protocol/source-rewrites.ts">

<violation number="1" location="packages/sim-cli/src/commands/protocol/source-rewrites.ts:77">
P2: `rewritesText` drops the reread hint. For a file that was capped or timed out, the text `rewrote` field shows only a line count such as `a.ts (1 diff lines)`, so the agent gets no instruction to reread it. The last entry already carries the message, so render that instead of the count. Also, the count includes the `…` placeholder line, so it is inflated. (Based on your team's feedback about honoring reread hints for capped or timed-out files.)</violation>
</file>

<file name="apps/sim/app/(auth)/signup/signup-form.tsx">

<violation number="1" location="apps/sim/app/(auth)/signup/signup-form.tsx:357">
P3: The early 2FA return skips `trackGoogleEvent('sign_up')`, but the account is already created on that path. Move the tracking call above the challenge check so challenged sign-ups still record the conversion.</violation>

<violation number="2" location="apps/sim/app/(auth)/signup/signup-form.tsx:359">
P3: Back navigation from the two-factor page can restore signup from the back-forward cache with `isLoading` still true, leaving the form disabled. Add the persisted `pageshow` reset used by the login form.</violation>
</file>

<file name="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.ts">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.ts:213">
P2: A refused leave restores only the pathname, so query-driven workspace state is lost. Build the rollback URL from `pathname` plus the current `useSearchParams()` string.</violation>
</file>

<file name="apps/sim/app/(auth)/verify/use-verification.ts">

<violation number="1" location="apps/sim/app/(auth)/verify/use-verification.ts:114">
P3: Back navigation can restore the verification page with `status` still `verifying`, leaving the OTP flow stuck. Reset the verification state on a persisted `pageshow`, or otherwise handle BFCache restoration before redirecting to two-factor.</violation>
</file>

<file name="apps/sim/executor/execution/block-executor.ts">

<violation number="1" location="apps/sim/executor/execution/block-executor.ts:296">
P2: The dry-run policy can miss `request_connection` when the resolved operation contains surrounding whitespace, while the Credential handler trims it and executes the request. Pass the normalized operation to the policy so this write cannot bypass dry-run stubbing.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.

Turn on auto-fix | Re-trigger cubic

isCredentialGroupProvider(option.provider) &&
getCredentialGroupProviderId(option.provider) === providerId
)?.label ?? null,
connectUrlFor: ({ providerId, email }) =>

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: The reminder's connect URL drops return=slack, which the original workflow request carried for Slack-originated requests. The enrollment stores no returnTo, so the reminder cannot restore it. Either persist the destination on the enrollment or accept that reminders lose the Return to Slack action.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/lib/credential-groups/application/organization-account-management.ts, line 222:

<comment>The reminder's connect URL drops `return=slack`, which the original workflow request carried for Slack-originated requests. The enrollment stores no `returnTo`, so the reminder cannot restore it. Either persist the destination on the enrollment or accept that reminders lose the Return to Slack action.</comment>

<file context>
@@ -187,13 +197,43 @@ export const inviteOrganizationAccountPeople = defineOrganizationAccountsUseCase
+            isCredentialGroupProvider(option.provider) &&
+            getCredentialGroupProviderId(option.provider) === providerId
+        )?.label ?? null,
+      connectUrlFor: ({ providerId, email }) =>
+        buildCredentialGroupConnectUrl({
+          publicId: group.publicId,
</file context>
Fix with cubic

context,
}: OrganizationExecution<OrganizationInput & { enrollmentId: string; optionId?: string }>) {
const { scope, group } = await requireGroup(context.organizationId)
const reminded = await remindWorkflowConnectionRequest({

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: The reminder branch skips the disabled-group check that ordinary resend enforces, so a disabled group still sends a connection-request email and renews the enrollment. Check group.status !== 'active' before calling remindWorkflowConnectionRequest, matching getInvitationContext.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/lib/credential-groups/application/organization-account-management.ts, line 212:

<comment>The reminder branch skips the disabled-group check that ordinary resend enforces, so a disabled group still sends a connection-request email and renews the enrollment. Check `group.status !== 'active'` before calling `remindWorkflowConnectionRequest`, matching `getInvitationContext`.</comment>

<file context>
@@ -187,13 +197,43 @@ export const inviteOrganizationAccountPeople = defineOrganizationAccountsUseCase
     context,
   }: OrganizationExecution<OrganizationInput & { enrollmentId: string; optionId?: string }>) {
     const { scope, group } = await requireGroup(context.organizationId)
+    const reminded = await remindWorkflowConnectionRequest({
+      credentialGroupId: group.credentialGroupId,
+      enrollmentId: input.enrollmentId,
</file context>
Suggested change
const reminded = await remindWorkflowConnectionRequest({
if (group.status !== 'active')
throw new OrchestrationError('conflict', 'Credential group is disabled')
const reminded = await remindWorkflowConnectionRequest({
Fix with cubic

const handleLeaveWorkspace = async () => {
if (!leaveTarget) return

setIsLeaveModalOpen(false)

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: The leave modal now closes before the request runs, and the pending state was removed, so the user gets no feedback while the leave request is in flight. Keep the modal open with a pending state until onLeaveWorkspace resolves, and only close it on success. Otherwise, restore the pending/pendingLabel props.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx, line 412:

<comment>The leave modal now closes before the request runs, and the pending state was removed, so the user gets no feedback while the leave request is in flight. Keep the modal open with a pending state until `onLeaveWorkspace` resolves, and only close it on success. Otherwise, restore the `pending`/`pendingLabel` props.</comment>

<file context>
@@ -412,10 +409,10 @@ function WorkspaceHeaderImpl({
   const handleLeaveWorkspace = async () => {
     if (!leaveTarget) return
 
+    setIsLeaveModalOpen(false)
+    setLeaveTarget(null)
     try {
</file context>
Fix with cubic

export function rewritesText(rewrote: Readonly<Record<string, string[]>>): string {
const files = Object.entries(rewrote)
if (files.length === 0) return 'none: every file is as you wrote it'
return files.map(([path, lines]) => `${path} (${lines.length} diff lines)`).join(', ')

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: rewritesText drops the reread hint. For a file that was capped or timed out, the text rewrote field shows only a line count such as a.ts (1 diff lines), so the agent gets no instruction to reread it. The last entry already carries the message, so render that instead of the count. Also, the count includes the … placeholder line, so it is inflated.

(Based on your team's feedback about honoring reread hints for capped or timed-out files.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/sim-cli/src/commands/protocol/source-rewrites.ts, line 77:

<comment>`rewritesText` drops the reread hint. For a file that was capped or timed out, the text `rewrote` field shows only a line count such as `a.ts (1 diff lines)`, so the agent gets no instruction to reread it. The last entry already carries the message, so render that instead of the count. Also, the count includes the `…` placeholder line, so it is inflated.

(Based on your team's feedback about honoring reread hints for capped or timed-out files.) </comment>

<file context>
@@ -0,0 +1,85 @@
+export function rewritesText(rewrote: Readonly<Record<string, string[]>>): string {
+  const files = Object.entries(rewrote)
+  if (files.length === 0) return 'none: every file is as you wrote it'
+  return files.map(([path, lines]) => `${path} (${lines.length} diff lines)`).join(', ')
+}
+
</file context>
Fix with cubic

const nextWorkspace = isLeavingCurrentWorkspace
? workspacesRef.current.find((w) => w.id !== workspaceToLeave.id)
: undefined
const returnHref = pathname

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: A refused leave restores only the pathname, so query-driven workspace state is lost. Build the rollback URL from pathname plus the current useSearchParams() string.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.ts, line 213:

<comment>A refused leave restores only the pathname, so query-driven workspace state is lost. Build the rollback URL from `pathname` plus the current `useSearchParams()` string.</comment>

<file context>
@@ -204,28 +204,42 @@ export function useWorkspaceManagement({
+      const nextWorkspace = isLeavingCurrentWorkspace
+        ? workspacesRef.current.find((w) => w.id !== workspaceToLeave.id)
+        : undefined
+      const returnHref = pathname
+
       try {
</file context>
Fix with cubic

blockId: mockedBlockId,
blockName: block.metadata?.name ?? mockedBlockId,
blockType: block.metadata?.id ?? '',
operation: typeof resolvedInputs.operation === 'string' ? resolvedInputs.operation : null,

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P2: The dry-run policy can miss request_connection when the resolved operation contains surrounding whitespace, while the Credential handler trims it and executes the request. Pass the normalized operation to the policy so this write cannot bypass dry-run stubbing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/executor/execution/block-executor.ts, line 296:

<comment>The dry-run policy can miss `request_connection` when the resolved operation contains surrounding whitespace, while the Credential handler trims it and executes the request. Pass the normalized operation to the policy so this write cannot bypass dry-run stubbing.</comment>

<file context>
@@ -293,6 +293,7 @@ export class BlockExecutor {
       blockId: mockedBlockId,
       blockName: block.metadata?.name ?? mockedBlockId,
       blockType: block.metadata?.id ?? '',
+      operation: typeof resolvedInputs.operation === 'string' ? resolvedInputs.operation : null,
     }
     const answeredBy = site && sideEffects?.answersBlock(site) ? sideEffects : undefined
</file context>
Suggested change
operation: typeof resolvedInputs.operation === 'string' ? resolvedInputs.operation : null,
operation: typeof resolvedInputs.operation === 'string' ? resolvedInputs.operation.trim() : null,
Fix with cubic

return
}

const twoFactorChallenge = readTwoFactorChallenge(response.data)

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P3: The early 2FA return skips trackGoogleEvent('sign_up'), but the account is already created on that path. Move the tracking call above the challenge check so challenged sign-ups still record the conversion.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/app/(auth)/signup/signup-form.tsx, line 357:

<comment>The early 2FA return skips `trackGoogleEvent('sign_up')`, but the account is already created on that path. Move the tracking call above the challenge check so challenged sign-ups still record the conversion.</comment>

<file context>
@@ -353,6 +354,15 @@ function SignupFormContent({
         return
       }
 
+      const twoFactorChallenge = readTwoFactorChallenge(response.data)
+      if (twoFactorChallenge) {
+        window.location.href = buildTwoFactorPagePath(
</file context>
Fix with cubic


const twoFactorChallenge = readTwoFactorChallenge(response.data)
if (twoFactorChallenge) {
window.location.href = buildTwoFactorPagePath(

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P3: Back navigation from the two-factor page can restore signup from the back-forward cache with isLoading still true, leaving the form disabled. Add the persisted pageshow reset used by the login form.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/app/(auth)/signup/signup-form.tsx, line 359:

<comment>Back navigation from the two-factor page can restore signup from the back-forward cache with `isLoading` still true, leaving the form disabled. Add the persisted `pageshow` reset used by the login form.</comment>

<file context>
@@ -353,6 +354,15 @@ function SignupFormContent({
 
+      const twoFactorChallenge = readTwoFactorChallenge(response.data)
+      if (twoFactorChallenge) {
+        window.location.href = buildTwoFactorPagePath(
+          redirectUrl || DEFAULT_POST_AUTH_ROUTE,
+          twoFactorChallenge
</file context>
Fix with cubic

resolveRedirectUrl(searchParams.get('redirectAfter')) ?? DEFAULT_POST_AUTH_ROUTE
sessionStorage.removeItem('verificationEmail')
sessionStorage.removeItem(POST_AUTH_REDIRECT_STORAGE_KEY)
window.location.href = buildTwoFactorPagePath(destination, twoFactorChallenge)

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

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.

P3: Back navigation can restore the verification page with status still verifying, leaving the OTP flow stuck. Reset the verification state on a persisted pageshow, or otherwise handle BFCache restoration before redirecting to two-factor.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/app/(auth)/verify/use-verification.ts, line 114:

<comment>Back navigation can restore the verification page with `status` still `verifying`, leaving the OTP flow stuck. Reset the verification state on a persisted `pageshow`, or otherwise handle BFCache restoration before redirecting to two-factor.</comment>

<file context>
@@ -104,6 +105,16 @@ export function useVerification({
+          resolveRedirectUrl(searchParams.get('redirectAfter')) ?? DEFAULT_POST_AUTH_ROUTE
+        sessionStorage.removeItem('verificationEmail')
+        sessionStorage.removeItem(POST_AUTH_REDIRECT_STORAGE_KEY)
+        window.location.href = buildTwoFactorPagePath(destination, twoFactorChallenge)
+        return
+      }
</file context>
Fix with cubic

- Agent block appends "Current date: YYYY-MM-DD." (UTC) to the first system message, or adds one; never written to memory; fallbacks reuse it
- Exa search query/date param descriptions steer models to the published-date filters instead of baking a stale year into the query
…Access (#10766)

* fix(credential-groups): require verified email, send queued request emails, honest expiry copy

- Claiming a request for an address again requires user.emailVerified everywhere, including on
  deployments that cannot verify email: drop verified-email.ts and the relaxed credentials query.
- Verify email state sends a code when opened (/verify?sendCode=true); where no code can be sent
  it asks the person to sign in with Google or Microsoft instead of looping through /verify.
- A connection request email is sent while the enrollment is still a pending workflow request,
  no longer pinned to the latest workflow and integration, so a later request for another
  integration no longer drops the first email. providerId leaves the outbox payload.
- An expired non-Slack OAuth attempt shows the generic expired message.

* fix(credential-groups): tidy the connect link code paths

- Link cleanup cron returns 500 when a table's drain fails, after both tables run
- One active-options-for-provider helper and one Access-tab provider predicate for the
  request path and the admin policy's in-effect check
- Connect, start, OAuth start and MCP start URLs come from connect-url builders; enrollment
  links hand back their token instead of being parsed (enrollment-links.ts removed)
- Invitation tokens hash through hashInvitationToken everywhere
- requestExpiresAt(now) replaces five copies of the renewal arithmetic
- Link OAuth origins come from one const array the contract and types derive from
- pendingWorkflowRequestCondition lives with the request email event; static import of the
  email handlers ends the cycle
- Drop an unread link-record field, file-local exports, a restating TSDoc, and the duplicated
  connection-status/request input; reuse hasOrganizationSetup in canSelfEnroll
- Connect route test: drop the declaration test and the six identical outcome cases
- README: MCP attempts live ten minutes, Send email vs Send reminder, outbox wording
- A first workflow-request email sent from People no longer reads as a reminder
- Policy and Access refusals name the setting they come from

* fix(credential-groups): clearer connect states, reconnect wording, and request docs

* fix(credential-groups): open the Access tab for organizations with more than 1000 workspaces

The Access read loaded every active workspace in the organization and refused once there were
more than the grant cap, so large organizations saw only "Workspace access supports at most 1000
workspaces" and could not use Access or Workflow connection requests.

The read now names only the granted workspaces (bounded by the grant cap), and Add workspace
searches the organization's workspaces without access on the server: a bounded, wildcard-escaped
name search behind the same admin read operation, exposed to the settings UI and to Copilot
(search_workspaces). The grant cap itself is unchanged.

* fix(credential-groups): honest verify fallback, active-only access grants, review follow-ups

* improvement(credential-groups): simplify connect errors, verify cooldown and access helpers

* chore(credential-groups): cleanup pass on comments and tests

* fix(credential-groups): first request email keeps every reminder, hide unmatched picker selection
… for Docker Compose (#10765)

* fix(self-hosting): durable uploads, compose overlays, and setup fixes for Docker Compose

* fix(sim-setup): keep Compose overlays across down and bind Ollama to the Docker bridge

* fix(sim-setup): ignore a blank socket URL override

* improvement(self-hosting): tighten compose docs and guard update against in-container uploads

* fix(sim-setup): don't probe a Compose-internal Ollama from the host

* fix(sim-setup): guard stopped legacy containers' uploads on update
…g settings, and route realtime on the app host (#10768)

* fix(helm): keep bundled Postgres upgradable, stop secret modes masking settings, and route realtime on the app host

- volumeClaimTemplates labels: reuse an existing StatefulSet's labels (lookup), stable selector labels otherwise; Kubernetes rejects any change there, so every version bump failed helm upgrade
- CI: install the newest published chart and helm upgrade it to the checkout
- External Secrets: skip an envDefaults key mapped in remoteRefs.app
- existingSecret: inline envDefaults values changed from the chart's defaults
- BETTER_AUTH_URL follows $(NEXT_PUBLIC_APP_URL) unless set
- ingress.realtime defaults to the app host under /socket.io; a separate host derives NEXT_PUBLIC_SOCKET_URL; "/" on the app host fails
- refuse multi-replica installs on local upload storage, warn otherwise
- fail on empty existingSecret names and on both databases enabled
- NOTES: realtime port-forward, OCI upgrade ref, upgrade pointer; chart 1.20.0

* fix(helm): exact uploads mount match, https socket URL from every source, legacy realtime host, and runnable example installs

* improvement(helm): one env resolver, shared ingress and env templates, and concise upgrade notes

* fix(helm): grant Marketplace S3 access to the named upload buckets only
…tup failures, and chart-derived sandbox defaults (#10767)

* fix(sandbox): show Shell when a sandbox provider is ready, clearer setup failures, and chart-derived sandbox defaults

* fix(sandbox): tolerate an untagged release commit at publish, keep Kubernetes read errors honest, and resolve the effective TRIGGER_DEV_ENABLED

* improvement(sandbox): drop overheadPerPod, concise chart messages and docs

* improvement(sandbox): use the shared env resolver and fold upgrade notes

* fix(sandbox): count the agent init container in the derived quota
…here (#10757)

The website's /models pages become a generated reference in the docs, at the
same paths: the directory, 26 provider pages, 375 model pages, 47 head-to-head
comparisons and the context window comparison. The interactive pricing
calculator and token counter become static pricing and tokens pages.

- scripts/generate-model-docs.ts writes apps/docs/content/docs/models from the
  platform catalog; check:model-docs keeps it current through check:audits.
- The catalog moves from app/(landing)/models to lib/model-catalog; the
  platform's model routes, components and OG images are removed.
- next.config permanently redirects /models and /models/* to docs.sim.ai in
  one hop, including the renamed calculator, token counter and retired Sonnet
  comparison.
- The sitemap drops model URLs (the docs publish their own), llms.txt and the
  footer link the docs, and the SEO e2e asserts the redirects.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…10776)

- Help form sends the path it was submitted from, plus the open chat tab, so a report opened from any sidebar (including the organization view, which sends no workspace) names the screen it is about
- Email adds the requesting surface and app version from the request context
- A malformed page value is dropped from the report rather than failing the request
@waleedlatif1
waleedlatif1 merged commit 8f7441e into main Dec 5, 2026
193 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 6b9613a1 Deployed Dec 5, 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.

3 participants