microsoft / microsoft/agent-framework-durable-extension

.NET: Add opt-in HITL response merge to preserve pre-suspension executor input

Open
#78 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement workflows
Dominant language
Python
Stars
16
Forks
10
Avg merge
3d 9h
Merged PRs (30d)
9

Description

Summary

Follow-up to #76.

The current durable HITL response path forwards exactly the response payload supplied by the caller. That behavior is understood and can remain the default. However, with partial approval payloads, downstream executors receive a newly deserialized partial TInput, so fields that existed before suspension can be reset unless the caller resends the full object or the workflow reconstructs it from shared state.

This proposes an opt-in merge/overlay behavior for durable HITL resume: preserve the pre-suspension executor input and overlay only the fields supplied by the approval response.

Example

Original executor input:

{
  "id": "ABC-123",
  "inputnumber": "42",
  "isapproved": false
}

Approval response:

{
  "isapproved": true
}

Current downstream payload:

{
  "id": "",
  "inputnumber": "",
  "isapproved": true
}

Proposed opt-in merged payload:

{
  "id": "ABC-123",
  "inputnumber": "42",
  "isapproved": true
}

Desired behavior

The approval response should update only the subset of state it owns, while the durable resume path preserves the semantic executor input that existed before suspension.

A useful invariant is:

Executor receives TInput X
→ workflow suspends for HITL
→ approval response updates owned fields
→ workflow resumes
→ all non-approval-owned fields of X are preserved

Possible API shapes

To preserve backward compatibility, this could be exposed as one of:

an opt-in RequestPort merge/overlay mode;

an explicit response merge policy;

a helper that restores the original request and applies the partial approval response before forwarding downstream.


The existing behavior of forwarding exactly what the caller sends can remain the default.

Why this helps

For larger workflow inputs, requiring every HITL caller to resend many unrelated fields couples the approval transport to the full executor state shape.

Shared state with a stable key is a valid workaround, but an explicit merge policy would make the resume contract clearer and reduce repeated reconstruction logic.

Scope

This is an enhancement proposal, not a claim that the current behavior is incorrect.

It follows the maintainer discussion in #76, where automatic merging of partial responses with the original request was identified as a possible improvement.

Related: #76

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the durable HITL resume path and RequestPort behavior described here, then compare the current default forwarding contract with the proposal from #76. Done means an explicitly opt-in merge policy preserves pre-suspension fields while applying supplied approval fields without changing default behavior; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Domain
backend, backend-api-design, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.