Recover stalled integration tasks durably#2287
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Here's a visual recap of what changed: Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…queue-liveness # Conflicts: # packages/core/src/deploy/build.spec.ts # packages/core/src/deploy/build.ts
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
Reviewed the latest PR state with four parallel agents, including the new upstream A2A fake-timer test stabilization and the durable dispatch/recovery implementation. The recovery path continues to use atomic compare-and-set claims, subject-bound HMAC authentication, persisted dispatch scopes, tenant-aware task processing, and explicit deployment/runtime gating. No new confirmed production, security, concurrency, retry/replay, or backward-compatibility issues were identified.
One review pass questioned the absence of per-organization predicates in the workspace-wide recovery sweep. This sweep is intentionally a workspace-level internal operation over all eligible persisted tasks; each task remains processed with its own owner/org context, while the global rollout scope is configuration rather than an end-user authorization boundary. No cross-tenant data exposure or unauthorized user-controlled access path was demonstrated.
The additional test-only change is limited to relaxing a fake-timer deadline for loaded CI and does not alter runtime behavior. Focused reviewers reported 169–328 affected tests passing; unrelated auth log-count flakes were not attributable to this PR.
Risk classification remains High due to durable processing, recovery, authentication, and deployment behavior.
🧪 Browser testing: Skipped — PR only modifies core/server/deployment behavior and tests; no user-facing browser UI impact.

Problem
Slack integration work is first persisted in SQL, then handed to a fresh serverless function for processing. On Netlify, the webhook function can finish and freeze before that self-dispatch leaves the process. The task row survives, but its only recovery loop was process-local, so the request could remain stranded and the user would never receive a Slack reply.
Approach
Keep SQL as the source of truth and add a durable way to wake persisted work on Netlify. When explicitly enabled for a selected integration scope, the initial handoff uses an acknowledged background function and a separate one-minute scheduler recovers eligible stale tasks. The existing portable self-dispatch remains the default and fallback, so other hosts do not depend on Netlify-specific behavior.
This changes task dispatch and recovery only. It preserves same-thread serialization and the existing delivery-only retry boundary: once an agent or Content mutation succeeds, retrying a failed Slack response must not repeat that mutation.
What changed
mainby giving it the same loaded-CI wall-clock allowance as its sibling; runtime behavior is unchanged.Safety and operations
AGENT_INTEGRATION_DURABLE_DISPATCHis default-off at build and runtime.AGENT_INTEGRATION_DURABLE_DISPATCH_SCOPEScan limit enablement by platform, thread, or channel. With the feature disabled, the existing portable path remains unchanged.A2A_SECRETis missing, generated recovery functions log the configuration problem and return 204 instead of failing every minute.Verification
main, 328 focused tests across nine dispatch, recovery, task-store, plugin, deployment-generation, and authentication files passed.Browser QA was skipped because this PR does not change browser UI behavior. The production Slack acceptance story has not yet been run because the feature remains disabled.
Review focus
Follow-ups