Add wait_for_signal callback support across examples - #10
Merged
Conversation
Reflects the new external signal callback API added to the PlanVault
runtime (POST /api/v1/projects/{projectId}/callbacks/{tokenId}):
- README: document the wait_for_signal flow, three new SSE event types
(awaiting_signal, signal_received, signal_timed_out), auth scheme,
idempotency codes, and response status codes.
- react-chat: handle awaiting_signal/signal_received/signal_timed_out
SSE events; add delivery UI with secret input, JSON payload editor,
and POST .../callbacks/{tokenId} call.
- bash-e2e: detect awaiting_signal in history poll; auto-deliver when
PLANVAULT_SIGNAL_SECRET is set, otherwise print example curl command.
Co-authored-by: Cursor <cursoragent@cursor.com>
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
wait_for_signalexternal signal flow — endpointPOST /api/v1/projects/{projectId}/callbacks/{tokenId}, auth scheme (Bearer {tokenId}:{secret}), three new SSE event types (awaiting_signal,signal_received,signal_timed_out), all response codes (SIGNAL_ALREADY_DELIVERED,SIGNAL_PAYLOAD_CONFLICT,SIGNAL_EXPIRED), andGET .../historypersistence.frontend/react-chat: handles the three new SSE events; shows a card when the session is paused (awaiting_signal) with token details, a secret input, a JSON payload editor, and a button that callsPOST .../callbacks/{tokenId}; clears onsignal_received/signal_timed_out.scripts/bash-e2e: polls history forawaiting_signalalongside the existingconfirm_plan_requiredcheck; auto-delivers the signal whenPLANVAULT_SIGNAL_SECRETis set, otherwise prints a ready-to-runcurlcommand.Test plan
vitest runinfrontend/react-chat— existing tests pass (no test-visible logic changed)wait_for_signal, confirm the new card appears onawaiting_signalSSE event and clears onsignal_receivedbash scripts/bash-e2e/script.shagainst a project/scenario withoutwait_for_signal— behaviour unchanged (new branches not taken)awaiting_signal; withoutPLANVAULT_SIGNAL_SECRETconfirm the helpercurlcommand is printed; with it set confirm the signal is auto-delivered and the session reachesdone