feat(orchestration): manage detached task runtimes#75
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds ChangesDetached task runtime
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant DetachedTaskRegistry
participant DetachedTaskExecutor
participant SteeringRegistry
Caller->>DetachedTaskRegistry: register detached task
DetachedTaskRegistry->>DetachedTaskExecutor: retain runtime handles
Caller->>DetachedTaskRegistry: wait or request steering
DetachedTaskRegistry->>SteeringRegistry: resolve or deregister steering
DetachedTaskExecutor-->>DetachedTaskRegistry: publish status
Caller->>DetachedTaskRegistry: cancel task
DetachedTaskRegistry->>DetachedTaskExecutor: cancel token then abort
DetachedTaskRegistry-->>Caller: return status or cancellation metadata
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e6a63952b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/graph/orchestration/runtime.rs`:
- Around line 170-182: Propagate a distinct lock-poisoned error consistently
across DetachedTaskRegistry instead of mapping it to Unknown or silently
returning empty/zero results. Reuse the existing self.lock() helper from
register() in wait(), ensure_live_owned, ensure_live, take_and_cancel, len,
snapshots, sweep_terminal, and cancel_where, preserving each method’s normal
behavior when the mutex is healthy.
- Around line 162-211: Update the `wait` method’s `Ok(Err(error))` branch to
remove the task entry via `self.remove(task_id)` before returning
`StatusChannelClosed`. Preserve the existing error propagation and
terminal/timeout behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9b63bcd7-59af-46d5-9a6a-7f3885326ebe
📒 Files selected for processing (6)
docs/modules/graph/subagents-recursion.mddocs/sdk-gaps.mdsrc/graph/orchestration/mod.rssrc/graph/orchestration/runtime.rssrc/graph/orchestration/test.rssrc/graph/orchestration/types.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0915e678a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
DetachedTaskRegistry<Metadata, Status>beside the durable orchestrationTaskStoreThe registry intentionally does not duplicate durable state. Applications continue to transition the matching
TaskStorerecord and reconcile store records with no live runtime after restart.Validation
cargo fmt --checkcargo test graph::orchestration::test::detached_registry(4 passed)cargo clippy --all-targets --all-features -- -D warningsSummary by CodeRabbit
New Features
Documentation