feat: replace polling with WS subscriptions + wire workflow approvals#435
Closed
wesbillman wants to merge 1 commit intomainfrom
Closed
feat: replace polling with WS subscriptions + wire workflow approvals#435wesbillman wants to merge 1 commit intomainfrom
wesbillman wants to merge 1 commit intomainfrom
Conversation
… (WF-08) Replace REST polling with WebSocket subscriptions across the desktop app for real-time reactivity. Wire the workflow approval infrastructure so runs suspend at approval gates instead of failing. Desktop subscriptions: - Forum posts/threads: subscribeLive for kinds 45001/45003 (was 15s/10s poll) - Workflows: subscribeLive for kind 46010 (was 1s/10s poll) - Pulse timeline: subscribeLive for contact note events (was 30s poll) - Channels list: reduced backstop to 5min (live updates already wired) - Agents/personas/teams: removed polling, CRUD mutations invalidate cache - Home feed: kept at 30s poll (relay scoping prevents global subscriptions) Shared useReactiveSubscription hook extracts common subscribe/reconnect/ cleanup lifecycle across forum, workflow, and pulse hooks. WF-08 workflow approvals: - executor.rs: create_approval() called with token, expiry, approver spec - lib.rs: finalize_run sets WaitingApproval instead of Failed stub - Trace entry pushed for suspended steps (UI can render approval card) - Approver spec validated at creation (rejects unresolvable role specs) - e2e test: full round-trip trigger → waiting_approval → grant → completed Docs: added "Subscriptions, Not Polling" principle to AGENTS.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
closing for now, will revisit soon. |
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.
Summary
useReactiveSubscriptionhook to eliminate subscription boilerplateDesktop polling → subscriptions
subscribeLivekinds 45001/45003 + 60s backstopsubscribeLivekind 46010 + 10s backstopsubscribeLivecontact note events + 120s backstopNote: Presence polling is handled separately in #434.
WF-08 workflow approvals
executor.rs:create_approval()called with token, expiry, approver speclib.rs:finalize_runsetsWaitingApprovalinstead ofFailedstubwaiting_approval→ grant →completedKnown limitations (pre-existing, documented)
WaitingApproval)Test plan
npm run build)cargo build --workspace)cargo test -p sprout-workflow)#[ignore], now enabled)🤖 Generated with Claude Code