Skip to content

fix: preserve entity executor stack traces from protobuf setValue()#324

Open
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/bug/fix-entity-executor-stacktrace-lost
Open

fix: preserve entity executor stack traces from protobuf setValue()#324
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/bug/fix-entity-executor-stacktrace-lost

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

Fixes #248.

The entity executor misused the protobuf setValue() return value, causing captured stack traces to be silently dropped from failure details. This preserves the original stack trace.


Opens the existing fix branch copilot-finds/bug/fix-entity-executor-stacktrace-lost as a PR (automated triage of active [copilot-finds] issues that had a ready fix branch but no open PR).

The entity executor's error handling code incorrectly used a chained call
pattern (new StringValue().setValue(error.stack)) to set the stack trace
on failure details. In google-protobuf, setValue() returns void, not the
StringValue instance, so setStacktrace() received undefined — silently
discarding the stack trace for all entity operation failures.

Fix: construct the StringValue separately and pass it to setStacktrace(),
matching the correct pattern used elsewhere in the codebase (pb-helper.util.ts).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 16:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes loss of stack traces in entity operation failure details by correcting how protobuf StringValue.setValue() is used in the entity executor. This improves debuggability of entity failures by ensuring the original error stack is preserved in TaskFailureDetails.

Changes:

  • Fix TaskEntityShim failure handling to set TaskFailureDetails.stacktrace using a properly constructed StringValue.
  • Add a regression test that asserts stack traces are present for Error-based entity failures (and absent for non-Error throws).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/durabletask-js/src/worker/entity-executor.ts Fixes protobuf wrapper misuse so captured error stack traces are actually stored in failure details.
packages/durabletask-js/test/entity-executor.spec.ts Adds coverage to prevent regression of stack trace loss in entity failure details.

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.

[copilot-finds] Bug: Entity executor silently loses stack traces due to protobuf setValue() return value misuse

3 participants