Skip to content

feat(platform): tell a person when their agent is disconnected - #4913

Merged
yannickmonney merged 1 commit into
mainfrom
feat/agent-notices
Oct 13, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
feat/agent-notices

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A person now finds out why a coding agent of theirs stopped working. When something other than themselves disconnects an agent they connected, they get a notice in their bell, in the organization the connection was to, saying which agent was disconnected and why. Sign-in stays off unless an operator turns it on, so nothing changes for a deployment until then.

  • Which endings tell. A refresh token used twice ("connect it again if this was you"), a changed password or sign-in method (their own change, an admin's, or an owner reset: "your password or another sign-in method changed"), and an owner's or admin's disconnect (by name). Their own disconnect, a seat that ended (they can no longer read that organization's bell) and an erasure (which removes every trace of the person and must write none anew) tell nothing.
  • One notice per connection, in its organization. A refresh reuse that ends the app's sign-in in three organizations leaves three notices, one in each bell. The row links to the MCP settings, where the Connected agents list will live.
  • Never e-mailed, never to anyone else. The type is bell-only like the API key notice, absent from the preference columns so it cannot be muted away, and never shown to admins (they have the list and the audit log).
  • A notice that cannot be written never undoes the disconnect. It is written in a savepoint of the ending's own transaction and logged when it fails; the security act is what matters.
  • Structure. end.ts stays the quiet ending (stamp, tokens, audit row, hint). The new end-and-tell.ts wraps it and is what every other ending calls, so a new way to end an agent tells the person unless someone decides here that it must not; a source guard holds the quiet one to the membership cascade and the erasure pass. It also keeps the UI suites' import graph (and their turbo inputs) free of the collaboration domain.
  • New notification type agent_connection_ended with its link case, both URL builders, and en/de/fr copy (a title and three bodies).

Rule AGCONN-R20 (agent connections). Not in this PR: telling the person when an agent gains write access — they have just allowed it on the consent page and the audit log records it; that is better decided with the consent page work.

Checklist

  • bun run check passes — the gate ran locally on the committed tree. The one red is app/routes/dashboard.test.tsx ("takes a signed-in tab to sign-in on a lapsed-session answer"), which fails identically on main and does not touch this change.
  • bun run lint:sast — runs in the commit hook.
  • Translations — the new bell copy in en/de/fr (inbox.yml), registered in keys-dynamic.yml.
  • Docs — N/A here: the user-facing pages come with the slice that turns sign-in on, so they never describe a door that is off.
  • README — N/A.

Test plan

  • Real Postgres lanes checkAgentLifecycle and checkAgentConnections: a refresh reuse leaves Ada one notice in each organization, naming the app, as the platform's act, and Mia (whose sign-in was not touched) none; Mia's own password change, an admin's 2FA reset and password seizure, and a forced rotation each leave the account notice, a refused change none; an owner's disconnect of Ada's agent leaves a notice naming the owner and Ada's own disconnect none; a seat that ended leaves none; an erasure writes none for the erased person.
  • Unit tests of the ending that tells (which reasons, which words, the admin looked up once and by name else by address, one notice per connection and organization, nothing when nothing ended, a failing notice given up alone and logged) with a 27-mutant round (all killed), lane-level mutations of every caller (quiet vs telling), the link parity suites, and the source guard.
  • checkNotificationEmailSink fails 2 checks identically on clean main when run on its own (A/B: detached at the parent commit); it is left out of the evidence above.

When something other than the person ends a coding agent they connected
- a refresh token used twice, a changed password or sign-in method, an
owner or admin - they find a notice in their bell, in the organization
the connection was to, saying which agent and why (an admin by name).
Their own disconnect, a seat that ended and an erasure tell nothing; it
is never e-mailed, and a notice that cannot be written never undoes the
disconnect.

The quiet ending stays in end.ts for the membership cascade and the
erasure pass, which a source guard holds to those two; every other ending
comes through end-and-tell.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant