Skip to content

feat: show your agent connecting and disconnecting at once on Your agent - #229

Open
artem-broccoli wants to merge 15 commits into
mainfrom
artem/bro-266-your-agent-shows-connect-and-disconnect-at
Open

artem-broccoli wants to merge 15 commits into
mainfrom
artem/bro-266-your-agent-shows-connect-and-disconnect-at

Conversation

@artem-broccoli

Copy link
Copy Markdown
Contributor

Summary

Your agent now updates by itself. With the page open, it turns to the connected card the moment the person chooses Allow in their agent's app, and back to "You disconnected …" (or why the connection ended) the moment it ends, with no reload and no need to come back to the window. The dot on the menu item follows on every page.

  • Live stream: a signed-in browser keeps one server-sent events stream open at GET /api/live. It carries only a nudge that the person's agent connection changed, never data; the page then reads its usual GraphQL queries again, so what a person may see is still decided there. A request without a session gets 401, and a nudge reaches only the streams of the person whose connection changed.
  • When it nudges: the agent connection service publishes agentAccess.connection_changed in the transaction that allows a connection or ends one (Disconnect, another agent replacing it, a password reset, 30 days unused). The stream sends it after the commit.
  • Web: the app shell opens the stream and reads the agent connection again on each nudge and each time the stream (re)opens, starting a fresh read so one already in flight cannot hide the change. Focus still refreshes the page as before.
  • Robustness: the stream opens with a comment so a proxy passes its headers at once; streams end when the server stops (it stops in under half a second with a stream open); a tab that closes, or a server that starts stopping, while the session is being read never leaves a stream behind.
  • Copy: "Waiting for your agent… This page updates the moment you choose Allow."
  • Docs: architecture §3 gains the live-updates line; the Your agent QA checklist gains the live checks.

Connected, without focusing or reloading the page:

Connected live

Disconnected from elsewhere, live:

Disconnected live

Evidence: report (PDF)

Testing

  • Integration: allowing, Disconnect, a password reset and a use after 30 days unused each publish one change for that person; Disconnect without a connection publishes nothing.
  • End to end: with the stream open, connecting an agent and Disconnect each send one nudge; no session gets 401; another person's change never reaches a stream.
  • pnpm check, all integration (1562) and end-to-end (306) tests pass.
  • By hand on pnpm dev (through the Vite proxy) and on the Docker image: a scripted OAuth agent connected and disconnected as the signed-in person while Your agent stayed open and unfocused; the page changed within a second each time. Not checked: a deployed ingress and real Claude or ChatGPT clients.

To try it: open Your agent, connect Claude Code (claude mcp add --transport http broccoli <address>, then /mcp and Allow) and watch the page switch without coming back to it; Disconnect in a second tab and watch the first.

Release Notes:

  • Added: Your agent shows your agent connecting and disconnecting at once, without reloading.

@artem-broccoli
artem-broccoli requested a review from a team as a code owner November 12, 2026 13:35
Base automatically changed from artem/bro-262-never-lose-a-record-change-that-starts-a to main November 15, 2026 06:23
…ent-shows-connect-and-disconnect-at

# Conflicts:
#	docs/architecture.md
#	packages/api/drizzle/0038_processes.sql
#	packages/api/importRules.json
#	packages/api/src/core/processes/app/eventRunService.ts
#	packages/api/src/core/processes/app/processService.ts
#	packages/api/src/core/processes/app/startRunsOnEvents.int.test.ts
#	packages/api/src/core/processes/app/startRunsOnEventsAtScale.int.test.ts
#	packages/api/src/core/processes/app/workingCalendars.ts
#	packages/api/src/core/processes/db/processRunsTable.ts
#	packages/api/src/core/processes/domain/eventTrigger.test.ts
#	packages/api/src/core/processes/domain/eventTrigger.ts
#	packages/api/src/core/processes/domain/index.ts
#	packages/api/src/core/tasks/app/createTask.int.test.ts
#	packages/api/src/core/tasks/app/createTasks.ts
#	packages/api/src/core/tasks/db/taskRepository.ts
#	packages/api/src/modules/processes/app/dueRunService.ts
#	packages/api/src/modules/processes/app/registrations.ts
#	packages/api/src/modules/processes/app/runStarter.ts
#	packages/api/src/modules/processes/db/index.ts
#	packages/api/src/modules/processes/db/processRepository.ts
#	packages/api/src/modules/processes/domain/processDefinition.test.ts
#	packages/api/src/modules/processes/domain/processDefinition.ts
#	packages/api/src/modules/processes/domain/processRun.ts
#	packages/api/src/modules/processes/index.ts
#	packages/api/src/modules/processes/module.md
#	packages/api/src/modules/tasks/app/index.ts
#	packages/api/src/modules/tasks/app/registrations.ts
#	packages/api/src/modules/tasks/app/taskService.ts
#	packages/api/test/support/domainEvents.ts
#	packages/api/test/support/index.ts
#	packages/api/test/support/processService.ts
#	packages/api/test/support/seedProcess.ts
#	packages/api/test/support/seedTask.ts
#	packages/api/test/support/taskService.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