Skip to content

Conversation

@yuandrew
Copy link
Contributor

@yuandrew yuandrew commented Oct 29, 2025

What was changed

  • Plumb the ability to enable/disable worker heartbeating to TS lang layer
  • plumb plugin names to Core, to show in worker heartbeats
  • specify WorkerTaskTypes based on if workflows/activities/nexus handlers are registered to the worker
  • bumped sdk-core to 45b1d7e

Why?

New feature!

Checklist

  1. Closes [Feature Request] Enable Worker Heartbeating #1810

  2. How was this tested:

Manually tested that heartbeats with a simple plugin from the worker and client both show up in plugins section of the worker heartbeat.

Also tested setting workerHeartbeatInterval: null disables heartbeating for the worker

  1. Any docs updates needed?

Note

Adds configurable worker heartbeats, introduces explicit worker task type configuration, plumbs plugin names to Core, and updates bindings/tests accordingly.

  • Runtime/Telemetry (core-bridge):
    • Accept worker_heartbeat_interval_millis from JS and set RuntimeOptions.heartbeat_interval.
    • RuntimeOptions::try_into returns (telemetry, metrics, logging, worker_heartbeat_interval_millis).
  • Worker config (core-bridge):
    • Replace enable_non_local_activities with task_types (enable_workflows, enable_local_activities, enable_remote_activities, enable_nexus).
    • Send plugins to Core as PluginInfo { name, version: "" }.
    • Map new Core errors: WorkflowNotEnabled, ActivityNotEnabled, NexusNotEnabled to UnexpectedError.
  • TypeScript bindings (native.ts):
    • newRuntime takes runtimeOptions; RuntimeOptions adds workerHeartbeatIntervalMillis.
    • WorkerOptions adds taskTypes and plugins: string[].
  • Worker (TS):
    • Runtime options now include workerHeartbeatInterval (ms or null) and passed as workerHeartbeatIntervalMillis.
    • Use runtimeOptions instead of telemetryOptions when creating the native runtime and metrics meter.
    • Compute taskTypes from registered workflows/activities/nexus; include plugins names in native options.
  • Tests:
    • Update bridge configs for new runtime/worker options.
    • Add test verifying local activities work when non-local activities are disabled.

Written by Cursor Bugbot for commit 826a363. This will update automatically on new commits. Configure here.

@yuandrew yuandrew changed the title Enable Worker heartbeating Enable Worker heartbeating, plumb plugin names to core, update Core to 45b1d7e Nov 27, 2025
@yuandrew yuandrew marked this pull request as ready for review November 27, 2025 02:05
@yuandrew yuandrew requested a review from a team as a code owner November 27, 2025 02:05
Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only required change is fixing up tests. Rest are light suggestions or questions.

}
}
CompleteWfError::WorkflowNotEnabled => {
BridgeError::UnexpectedError(format!("{err}"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinions on this 🤷

Suggested change
BridgeError::UnexpectedError(format!("{err}"))
BridgeError::UnexpectedError(err.to_string())

.into_iter()
.map(|name| PluginInfo {
name,
version: String::new(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my own knowledge, is version from the past or not yet implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I don't know. haha. The API was originally implemented with version, but not sure what the intent was. Will follow up on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Enable Worker Heartbeating

2 participants