Skip to content

Conversation

@Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Jan 26, 2026

This should result in Sentry displaying a link from the task execution trace (where 'await_event' is called) back to the trace that performed the 'emit_event' call

Note that this is a breaking change, as we now wrap the user's payload in a struct when reading/writing to the database. Going forward, we'll be able to add new (optional) fields to this wrapper struct without breaking existing durable deployments


Note

Introduces a structured event payload wrapper to support metadata (e.g., trace context) and links between traces.

  • Adds DurableEventPayload { inner, metadata }; updates await_event/join to parse wrapper and return inner, and to link telemetry spans from metadata
  • Client emit_event now wraps user payload, injects trace context into metadata, and sends wrapper to SQL
  • SQL: emit_event validates payload keys (only inner, metadata); cleanup_task_terminal emits child completion events wrapped in the new format
  • Types: AwaitEventResult.payload is now Option<DurableEventPayload>; re-exports include DurableEventPayload
  • Errors: new EmitEventFailed variant for context-level emission failures
  • Migration added to update functions and enforce payload structure; tests updated to use the wrapper

Breaking change: event payloads in e_* and checkpoints are now the wrapper object rather than raw JSON.

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

This should result in Sentry displaying a link from the task
execution trace (where 'await_event' is called) back to the trace
that performed the 'emit_event' call

Note that this is a *breaking change*, as we now wrap the user's payload
in a struct when reading/writing to the database. Going forward, we'll
be able to add new (optional) fields to this wrapper struct without
breaking existing durable deployments
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@Aaron1011
Copy link
Member Author

@virajmehta I opted to always store a json object that looks like {"inner": <obj>, "metadata": <object>}, including for the built-in durable events. This was much simpler than modifying all of the locking code to handle multiple columns.

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.

3 participants