Reproducer
Run a Relayflow with agent steps, no explicit RELAY_API_KEY, and Relaycast enabled. The runner POSTs a fresh workspace, then interrupt with SIGINT after broker startup (normal completion follows the same finally path).
Observed
The runner finally block clears relayApiKey and relayApiKeyAutoCreated but never calls authenticated DELETE /v1/workspaces/:id. On SIGINT the only workspace key is lost with the process, leaving a persistent remote workspace that cannot be reconciled by the caller. Local broker state can be stopped and quarantined, but the remote workspace is no longer deletable by exact ID/key.
Expected
Create workflow-owned workspaces with a bounded TTL, persist exact workspace ID plus key in private run state until teardown, and in finally call authenticated exact-ID DELETE. Treat a lost DELETE response via an independent GET/404 tombstone check. Preserve caller-supplied workspaces and keys. Add normal-completion, failed-startup, SIGINT, repeated-delete, and teardown-failure tests.
Evidence
The current @relayflows/core 1.1.4 ensureRelaycastApiKey path creates through POST /v1/workspaces. Its runWorkflowCore finally path only clears the in-memory key. A controlled interrupted run b28d097566df40a62f9b7175 stopped all local processes, but the remote workspace key was not retained for cleanup.
Reproducer
Run a Relayflow with agent steps, no explicit RELAY_API_KEY, and Relaycast enabled. The runner POSTs a fresh workspace, then interrupt with SIGINT after broker startup (normal completion follows the same finally path).
Observed
The runner finally block clears relayApiKey and relayApiKeyAutoCreated but never calls authenticated DELETE /v1/workspaces/:id. On SIGINT the only workspace key is lost with the process, leaving a persistent remote workspace that cannot be reconciled by the caller. Local broker state can be stopped and quarantined, but the remote workspace is no longer deletable by exact ID/key.
Expected
Create workflow-owned workspaces with a bounded TTL, persist exact workspace ID plus key in private run state until teardown, and in finally call authenticated exact-ID DELETE. Treat a lost DELETE response via an independent GET/404 tombstone check. Preserve caller-supplied workspaces and keys. Add normal-completion, failed-startup, SIGINT, repeated-delete, and teardown-failure tests.
Evidence
The current @relayflows/core 1.1.4 ensureRelaycastApiKey path creates through POST /v1/workspaces. Its runWorkflowCore finally path only clears the in-memory key. A controlled interrupted run b28d097566df40a62f9b7175 stopped all local processes, but the remote workspace key was not retained for cleanup.