-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Problem
In TaskHubGrpcWorker._executeActivityInternal(), when an activity throws an exception, the ActivityResponse sent back to the sidecar is missing the instanceId field. The success path correctly sets it (line 768), but the error path (lines 782-785) omits it.
File: packages/durabletask-js/src/worker/task-hub-grpc-worker.ts, line 782
// Success path (correct):
res = new pb.ActivityResponse();
res.setInstanceid(instanceId); // ✅ Present
// Error path (before fix):
res = new pb.ActivityResponse();
// ❌ Missing: res.setInstanceid(instanceId);
res.setTaskid(req.getTaskid());
res.setCompletiontoken(completionToken);
res.setFailuredetails(failureDetails);Root Cause
The error handling catch block constructs a new ActivityResponse but was not ported symmetrically with the success path. The instanceId field was simply omitted. The .NET SDK always sets InstanceId on the ActivityResponse regardless of success or failure.
Fix Available
Branch copilot-finds/bug/fix-activity-response-missing-instanceid contains the fix (one-line addition) and 3 new tests. A PR could not be created due to GitHub Actions token permissions.