Repository navigation
feat(den): let Workbot chats watch MCP events that are only polled - #7829
Open
reachjalil wants to merge 1 commit into
Open
reachjalil wants to merge 1 commit into
reachjalil wants to merge 1 commit into
Conversation
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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?
How is this implemented?
mcp-events/subscriptions.ts: a poll-only event is listed, and subscribing takes oneevents/pollto 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.0223addsdelivery,next_poll_atandpoll_failurestomcp_event_subscription. Existing rows default towebhook.@openwork/mcp-enterprise-clientacceptsevents/polland sends its routing headers.What else changed?
list_mcp_eventsno longer says "webhook" in its description.mcp_event.subscribenames 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.