fix(sdk,core,build): SDK hardening pass#3670
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
WalkthroughThis PR removes the secureExec build extension from package exports and type mappings. It expands default non-retryable HTTP statuses for stream retries to include 400, 404, 409, 410, and 422. Chat handover now fails fast if X-Trigger-Chat-Access-Token is missing, dispose() aborts and clears active session streams, and AbortSignal.any usage in session streaming is replaced with explicit capability detection and a fallback that propagates caller abort reasons. Minor docs and call-argument fixes are included. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Summary
Five hardening fixes across
@trigger.dev/sdk,@trigger.dev/core, and@trigger.dev/build.tasks.triggerAndSubscribenow forwards callerrequestOptions(custom API keys, per-request overrides) to the underlyingapiClient.triggerTaskcall instead of silently dropping them.SSEStreamSubscriptionno longer retries permanent client errors forever. The defaultnonRetryableStatuseswidens from[404, 410]to[400, 404, 409, 410, 422], so a malformed session-stream request fails fast instead of busy-looping under bounded backoff.AbortSignalon Node 18, whereAbortSignal.anyis unavailable. Caller-driven cancellation now propagates on every supported runtime.TriggerChatTransportthrows immediately when achat.handoverresponse is missingX-Trigger-Chat-Access-Token, instead of silently downgrading every subsequent turn back to the handover path.dispose()aborts every activesession.outsubscription before tearing the coordinator down, so unmount/navigation no longer leaves SSE readers in flight.@trigger.dev/build/extensions/secureExecbuild extension. It will return alongside the sandbox feature it was built to support.Test plan
pnpm run build --filter @trigger.dev/sdk --filter @trigger.dev/core --filter @trigger.dev/buildpnpm --filter @trigger.dev/sdk test --run(183 tests, including chat / chat-server / sessions / handover)pnpm --filter @trigger.dev/core test --runchat.handoverwhose response stripsX-Trigger-Chat-Access-Token, and confirm the transport throws synchronously rather than degrading.session.outSSE connection closes immediately.