Skip to content

Conversation

@Aaron1011
Copy link
Member

The 'spawn_by_name' method requires the task to exist in the registry, so we can validate the parameters by attempting to deserialize into the parameter type.

This lets us catch some errors before we try to insert the task into the database

The 'spawn_by_name' method requires the task to exist
in the registry, so we can validate the parameters by attempting
to deserialize into the parameter type.

This lets us catch some errors before we try to insert the task
into the database
@cursor
Copy link

cursor bot commented Jan 14, 2026

PR Summary

Adds pre-spawn parameter validation for dynamic spawns.

  • spawn_by_name now routes to spawn_by_name_with, which validates the task is registered and calls validate_params before enqueueing
  • Introduces ErasedTask::validate_params (implemented to deserialize into T::Params) and uses it to fail early on invalid JSON
  • Adds DurableError::InvalidTaskParams to report validation failures with task name and message
  • Updates tests: new invalid-params case for spawn_by_name; edge-case tests switched to spawn_by_name_unchecked to bypass validation

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

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.

4 participants