feat(webapp): gracefully shut down the v3 engine behind a flag#4017
feat(webapp): gracefully shut down the v3 engine behind a flag#4017ericallam wants to merge 1 commit into
Conversation
Adds DEPRECATE_V3_ENABLED (default off). When on, triggers that resolve to v3 are rejected with a message pointing at the v4 migration guide, the legacy dev websocket is closed, the v3 shared-queue consumer won't start, and the v3 run-lifecycle background jobs (heartbeat timeout, TTL expiry, retry, resume, delayed-run enqueue, scheduled fires) become no-ops so abandoned v3 runs stop generating database load. Every gate also checks the run or project is v3, so v4 is unaffected.
|
|
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 (13)
📜 Recent review details⏰ Context from checks skipped due to timeout. (12)
🧰 Additional context used📓 Path-based instructions (8)**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{packages/core,apps/webapp}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.ts📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)
Files:
apps/webapp/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)
Files:
apps/webapp/**/*.server.ts📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
**/*.{js,ts,tsx,jsx,css,json,md}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/webapp/{app/v3/services/triggerTask.server.ts,app/v3/services/batchTriggerV3.server.ts}📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
🧠 Learnings (17)📚 Learning: 2026-03-10T17:56:20.938ZApplied to files:
📚 Learning: 2026-03-22T13:26:12.060ZApplied to files:
📚 Learning: 2026-03-22T19:24:14.403ZApplied to files:
📚 Learning: 2026-05-18T08:21:27.694ZApplied to files:
📚 Learning: 2026-05-18T08:21:27.694ZApplied to files:
📚 Learning: 2026-06-13T19:53:13.759ZApplied to files:
📚 Learning: 2026-06-17T17:13:49.929ZApplied to files:
📚 Learning: 2026-03-29T19:16:28.864ZApplied to files:
📚 Learning: 2026-06-09T16:27:26.195ZApplied to files:
📚 Learning: 2026-05-05T09:38:02.512ZApplied to files:
📚 Learning: 2026-05-12T21:04:05.815ZApplied to files:
📚 Learning: 2026-05-14T08:21:07.614ZApplied to files:
📚 Learning: 2026-06-04T18:16:35.386ZApplied to files:
📚 Learning: 2026-06-09T17:58:04.699ZApplied to files:
📚 Learning: 2026-05-14T14:54:39.095ZApplied to files:
📚 Learning: 2026-05-20T17:21:18.543ZApplied to files:
📚 Learning: 2026-06-01T11:37:08.569ZApplied to files:
🔇 Additional comments (13)
WalkthroughA new 🚥 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
Adds a single env flag,
DEPRECATE_V3_ENABLED(default off), that gracefully winds down the v3 engine (RunEngineVersion.V1). While it's off nothing changes, so self-hosted instances still on v3 keep working. When it's on:triggerAndWait, which all funnel through one place.trigger devwebsocket used by v3 CLIs is closed with an upgrade message (v4 CLIs use a different dev transport).This builds on the existing deploy deprecation flag, which already rejects v3 CLI deploys.
Design
Enforcement is read through one helper,
isV3Disabled(). Every gate combines it with a per-run or per-project engine check (isV3Disabled() && engine === "V1"), so a v4 run that happens to reach a shared service behaves exactly as before. v4 (V2) is never affected.The flag is a hard switch, not a drain: when it's on, in-flight v3 runs are abandoned in place rather than failed or expired, which is the intended behaviour for the final shutdown.