Skip to content

feat(den): let Workbot chats watch MCP events that are only polled - #7829

Open
reachjalil wants to merge 1 commit into
devfrom
feat/workbot-polled-mcp-events
Open

reachjalil wants to merge 1 commit into
devfrom
feat/workbot-polled-mcp-events

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

Workbot chats can now watch events from a connected MCP server that only offers them by polling.

What problem does it solve?

Some servers publish events without calling back: the client has to ask for what is new. Workbot only handled servers that deliver by webhook, so those events could not be watched from a hosted chat at all.

What was the situation before?

Event the server offers Before After
By webhook Listed and watchable Unchanged
By webhook and by polling Watched by webhook Unchanged
By polling only Not listed; subscribing was refused Listed; a watch polls the server and each new event starts a turn in the chat

How is this implemented?

  • mcp-events/subscriptions.ts: a poll-only event is listed, and subscribing takes one events/poll to set the starting cursor instead of registering a callback.
  • mcp-events/poller.ts: the event worker claims a due watch, polls it and queues each new event through the existing receipt queue, so dedupe, the 100 event limit and delivery to the hosted turn are shared with webhooks.
  • A truncated poll reports a gap, five failed polls end the watch with a notice, and losing access to the connection stops it. Polls run every 30 seconds to 5 minutes, as the server asks.
  • Migration 0223 adds delivery, next_poll_at and poll_failures to mcp_event_subscription. Existing rows default to webhook.
  • @openwork/mcp-enterprise-client accepts events/poll and sends its routing headers.

What else changed?

  • list_mcp_events no longer says "webhook" in its description.
  • The audit registry note for mcp_event.subscribe names polling.

Release note

Workbot can now watch events from connected MCP servers that only support polling.

Evidence

  • ee/apps/den-api/test/api/mcp-thread-events.api.test.ts: a poll-only event could not be watched → a watch registers no callback, delivers each new event to the same chat once, reports a gap and ends with a notice.
  • That test needs MySQL and was not run locally; the Den API check on this PR runs it.

Workbot could watch an event from a connected MCP server only when the
server delivered it by webhook. Events a server offers by polling alone
(delivery: poll in the MCP Events extension) were hidden from
list_mcp_events and refused by subscribe_mcp_event.

A watch on such an event now registers no callback. Den takes a first
events/poll to set the starting cursor, stores the watch with
delivery = poll, and the event worker polls it every 30 seconds to 5
minutes as the server asks. Each new event goes through the same
receipt queue as a webhook delivery, so dedupe, the 100 event limit and
the hosted turn are unchanged. A truncated poll reports a gap, five
failed polls end the watch with a notice, and losing access to the
connection stops it. Webhook stays the choice when a server offers both.

Migration 0223 adds delivery, next_poll_at and poll_failures to
mcp_event_subscription; existing rows default to webhook.

Signed-off-by: Jalil <reachjalil@gmail.com>
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
openwork-den Ready Ready Preview Nov 28, 2026 1:29am UTC
2 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 28, 2026 1:29am UTC
openwork-landing Skipped Skipped v0 Nov 28, 2026 1:29am UTC

Request Review

This branch was successfully deployed

1 active and 2 inactive deployments
Preview – openwork-den — 16f71508 Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-landing — 16f71508 Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-app — 16f71508 Deployed Nov 28, 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.

1 participant