Skip to content

feat: make short worker callback deadlines configurable - #1371

Merged
willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:feat/relay-1005-configurable-callback-deadlines
Oct 16, 2026
Merged

willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:feat/relay-1005-configurable-callback-deadlines

Conversation

@willkill07

@willkill07 willkill07 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Overview

Allow worker plugins to set deadlines for short callbacks instead of always using the fixed 30-second limit. Plugins can define a default and overrides by callback registration name in relay-plugin.toml.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Add optional load.callback_timeouts.default_ms and load.callback_timeouts.by_name settings. Values must be positive integer milliseconds. A matching name takes precedence over the plugin default, followed by the existing 30-second default.
  • Capture settings at activation and apply them to short callbacks, including conditional middleware guardrails. Preserve timeout cancellation and host-state cleanup. Tool and LLM execution intercepts remain under caller control; other worker RPCs keep their existing limits.
  • Preserve the settings in plugin records. Explain configuration, precedence, and reactivation in the worker documentation, using short sentences and plain language.

Compatibility: existing manifests keep their current behavior, and the worker protocol is unchanged. Rust callers that construct DynamicPluginManifestWorkerLoad or DynamicPluginWorkerLoadContract with struct literals must add the new callback_timeouts field (use None for the existing behavior).

Validation:

  • Focused manifest and callback tests passed, including deadlines above and below 30 seconds, name precedence, cancellation, cleanup, and execution callbacks that ignore short-callback limits.
  • just test-rust: 5,944 passed (one on retry), with two CLI logging tests failing under inherited logging settings. Both failures passed on a targeted rerun with logging overrides removed and isolated configuration, as used by the suite.
  • Staged uv run pre-commit run: passed, including formatting, Clippy, cargo check, documentation links, and dependency checks.
  • Documentation link and site checks passed. The published-redirect comparison was skipped because FDR returned HTTP 403.
  • No separate language-binding suites were run: the change is in worker-host configuration and does not change the worker protocol or binding APIs.

Where should the reviewer start?

Start with WorkerCallbackTimeouts in crates/core/src/plugin/dynamic/manifest.rs, then follow deadline selection in WorkerPluginCallback::invoke_async in crates/core/src/plugin/dynamic/worker.rs. The tests in crates/core/tests/unit/dynamic_worker_tests.rs exercise the timeout and cancellation behavior.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • New Features
    • Worker callbacks now have a 30-second default deadline, with optional default and per-callback timeout settings in relay-plugin.toml.
    • Tool and LLM execution callbacks can wait for long-running downstream calls without a host-imposed deadline, while remaining cancellable.
    • When a deadline expires, Relay requests cancellation and releases associated host state; callbacks retain their usual error or fallback behavior.
  • Documentation
    • Added guidance on configuring callback deadlines, timeout behavior, and which callbacks are excluded.

@willkill07
willkill07 requested review from a team as code owners October 16, 2026 04:23
@github-actions github-actions Bot added size:M PR is medium Feature a new feature breaking PR introduces a breaking change lang:rust PR changes/introduces Rust code labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 476b46c2-ff28-4011-9acc-8661d9336d4c
📥 Commits

Reviewing files that changed from the base of the PR and between 9b3b8b9 and 83ae45f.

📒 Files selected for processing: 4
  • crates/core/src/plugin/dynamic/manifest.rs
  • crates/core/src/plugin/dynamic/worker.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/plugin_dynamic_tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 6 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 1
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 1
CONTRIBUTING.md — configured
📓 Path-based instructions: 3
Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

⚙️ CodeRabbit configuration file

Files:

  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/tests/unit/plugin_dynamic_tests.rs
Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.

⚙️ CodeRabbit configuration file

Files:

  • crates/core/src/plugin/dynamic/manifest.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/src/plugin/dynamic/worker.rs
  • crates/core/tests/unit/plugin_dynamic_tests.rs
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance See `CONTRIBUTING.md` and `docs/contribute/testing-and-docs.mdx` for contributor details, and `.agents/skills/README.md` for the maintainer skill boundary.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • crates/core/src/plugin/dynamic/manifest.rs
  • crates/core/tests/unit/dynamic_worker_tests.rs
  • crates/core/src/plugin/dynamic/worker.rs
  • crates/core/tests/unit/plugin_dynamic_tests.rs
🔇 Additional comments: 1
crates/core/src/plugin/dynamic/manifest.rs: 1

44-44: 🗄️ Data Integrity & Integration

The custom schema includes callback_timeouts.

DynamicPluginManifestLoadSchema::Worker uses DynamicPluginManifestWorkerLoad, whose callback_timeouts field derives schemars::JsonSchema. The generated schema therefore exposes the field.

Walkthrough

Worker load manifests now support optional callback timeout settings. Eligible worker callbacks apply per-name or default deadlines. Tool and LLM execution intercepts remain without an RPC deadline.

Changes

Worker callback deadlines

Layer / File(s) Summary
Manifest timeout settings
crates/core/src/plugin/dynamic.rs, crates/core/src/plugin/dynamic/manifest.rs, crates/core/tests/unit/plugin_dynamic_tests.rs
Worker load contracts and manifests carry optional timeout defaults and per-callback overrides. Parsing rejects invalid values and names, and conversion preserves the settings for worker loads. Tests cover parsing, serialization, conversion, and invalid configurations.
Runtime deadline selection
crates/core/src/plugin/dynamic/worker.rs, crates/core/tests/unit/dynamic_worker_tests.rs, docs/build-plugins/package-discoverable-plugins.mdx, docs/build-plugins/workers/middleware-and-continuations.mdx
Worker callbacks select a name override, configured default, or 30-second fallback. Tool and LLM execution intercepts remain without an RPC deadline. Tests check timeout and cancellation behavior; documentation describes configuration and callback behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Manifest as relay-plugin.toml
  participant Instance as WorkerPluginInstance
  participant Callback as WorkerPluginCallback
  participant Host as Host RPC
  Manifest->>Instance: Provide callback timeout settings
  Instance->>Callback: Pass resolved timeout configuration
  Callback->>Host: Invoke callback with selected deadline
  Host-->>Callback: Deadline expires
  Callback->>Host: Request invocation cancellation and clear scope state
Loading
Merge Risk: ⚪ Minimal · up to 83ae4

No actionable merge-blocking risk is established. Configured callback deadlines and documented per-name overrides appear consistent; the PR is ready for normal checks.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

Failed Failed checks: 1 error

Check name Status Explanation Resolution
Title check Error The title follows Conventional Commits syntax and accurately describes the change, but the pull request adds a public struct field that requires Rust callers using struct literals to update their code… Change the title to feat!: make short worker callback deadlines configurable. Do not add a trailing period; keep the title under 72 characters.
Passed Passed checks: 4 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 80.56% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 5 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is complete and relevant. It includes the required Overview, Details, reviewer guidance, related issue, validation results, compatibility information, and contribution checks.
Full details: Title check

Explanation

The title follows Conventional Commits syntax and accurately describes the change, but the pull request adds a public struct field that requires Rust callers using struct literals to update their code. This is a breaking change, so the title must include !.

Resolution

Change the title to feat!: make short worker callback deadlines configurable. Do not add a trailing period; keep the title under 72 characters.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@willkill07 willkill07 self-assigned this Oct 16, 2026
@willkill07 willkill07 added this to the 0.11 milestone Oct 16, 2026
@github-actions

Copy link
Copy Markdown

@willkill07 willkill07 changed the title feat!: make short worker callback deadlines configurable feat: make short worker callback deadlines configurable Oct 16, 2026
@willkill07
willkill07 merged commit 42932af into NVIDIA:main Oct 16, 2026
98 checks passed
@willkill07 willkill07 removed the breaking PR introduces a breaking change label Oct 16, 2026
@willkill07
willkill07 deleted the feat/relay-1005-configurable-callback-deadlines branch October 30, 2026 14:46

This branch was previously deployed

1 inactive deployment
fern — 83ae45fa Deployed Oct 16, 2026 by willkill07 via Clean up docs preview #5882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants