Repository navigation
fix(engine): run node teardown when pipelines are cancelled - #2396
Conversation
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: rocketride-org/rocketride-server/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (12)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change exposes native cancellation to Python, propagates cancellation from Python sources, ensures task teardown after execution failures, and updates the webhook source and documentation to support cancellation-aware cleanup. ChangesCancellation-aware teardown
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Chat and Webhook cancellations now reach cleanup, and failed executions still run task teardown; no merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 10 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
Tenki's idle timeout never paused anything. Its changelog of 2026-09-18 removed the --idle-timeout option as having "never had any effect", and SDK 1.4.0 warns that idle_timeout_minutes is deprecated and ignored and no longer sends it; 1.0.6, the pinned version, sent it and the service ignored it. The node's idle_timeout_minutes field, its "pauses the session, which stops compute billing" wording, and the README's cost guidance were therefore wrong: an unused session bills until it is closed or reaches max_duration. The field is removed from the schema, the create call and the docs. A pipeline saved with it still starts: the key is simply not read, which a regression test pins. The recovery path for a paused session stays, since a session can still be paused by hand or by Tenki when a workspace runs out of credit; only its docstring changes. max_duration_minutes now defaults to 15 instead of 60. With no idle pause, it is the only Tenki-side bound on what a session the pipeline never closed can bill: after an engine crash on any engine, and on terminate and idle-TTL expiry for chat- and webhook-sourced pipelines on engines before #2396 (merged to develop on 2026-09-22; this branch's base predates it). The README and IGlobal docstring now say exactly that, instead of "teardown never runs". Validation bounds (1 to 1440) are unchanged, and the example pipeline keeps its explicit 30. The SDK pin stays at 1.0.6. Not touched: the generated README block and CHANGELOG.md.
…use retention Tenki pauses a session at max_duration rather than ending it (measured), and since #2396 the engine runs teardown for chat and webhook pipelines too. A 15 minute default no longer bought much cost safety, and every pause cuts a running command off and costs about a minute to resume. The default goes back to 60 minutes. A command allowed to run as long as the session lives can never finish, so the node now warns at startup, and in the editor's config check, when exec_timeout_secs is not shorter than max_duration. New setting pause_retention_hours, default 24, sent as pause_retention: without it Tenki keeps a paused session's state for seven days. Tenki refuses 0 and accepted every value tried from one minute to a year (measured 2026-10-09), so the field takes 1 to 8760 hours.
The README said engines with #2396 run node teardown for every source. #2396 runs teardown when a pipeline is cancelled, and its own notes say a long-running Python source must return from scanObjects on cancellation for that to happen (chat, webhook, dropper and tools do). Teardown was measured here for chat- and webhook-sourced pipelines, on terminate and on idle-TTL expiry, so the sentence now says that.
Summary
endGlobalnever runs for chat/webhook-sourced pipelines, so nodes cannot release external resources #2300: Chat/Webhook pipelines now observe engine cancellation, allowing connected nodes'endGlobal()cleanup to run on explicit termination and idle-TTL expiry.Type
Bug fix. Adds
rocketlib.isCancelled()for long-running Python sources. The existing five-second graceful-stop deadline and forced-kill fallback remain in place.Testing
./builder testpasses — the full monorepo suite was not run; targeted checks below passed.Validation on macOS arm64:
beginGlobal()and oneendGlobal()on both explicit termination and idle-TTL expiry, without sending requests or using vendor resources. Explicit termination completed in 0.289 s and 0.369 s; TTL cleanup ran at the normal 60-second monitor cycle. All four task processes exited.git diff --check,./builder docs:check, and./builder docs:buildpassed.develop: addressed the initial test-docstring finding; the second full review completed with zero findings.Checklist
Linked Issue
Fixes #2300
Summary by CodeRabbit
New Features
Bug Fixes
Documentation