Skip to content

Preserve handoff agent references during conversion - #85

Merged
brianstrauch merged 5 commits into
temporalio:mainfrom
AniruddhS24:aniruddh/preserve-handoff-agent-reference
Oct 20, 2026
Merged

brianstrauch merged 5 commits into
temporalio:mainfrom
AniruddhS24:aniruddh/preserve-handoff-agent-reference

Conversation

@AniruddhS24

@AniruddhS24 AniruddhS24 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Preserve the target agent reference (_agent_ref) when copying a Handoff during Temporal model conversion.

Why?

dataclasses.replace drops this init=False field, so the Agents SDK cannot find the target agent when restoring a run or its tool-use history. This can cause resume failures or incorrectly require another tool call after tools have already been used.

Checklist

  1. Closes: N/A; this is a small bug fix with no existing issue.
  2. How was this tested: make sync, make lint, make test (306 passed), and make build passed. Regression coverage checks object and direct-agent handoffs in normal and streaming resumes; both object-handoff cases fail before the fix and pass afterward.
  3. Any docs updates needed? No; this preserves internal handoff metadata without changing the public API.

@CLAassistant

CLAassistant commented Oct 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@AniruddhS24
AniruddhS24 marked this pull request as ready for review October 14, 2026 19:26
@AniruddhS24
AniruddhS24 requested a review from a team as a code owner October 14, 2026 19:26

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One P2 regression found in run-state restoration.

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two P2 regressions reproduced in normal and streaming runs. All four reproductions pass on the PR's base and fail on this commit.

@AniruddhS24

Copy link
Copy Markdown
Contributor Author

@brianstrauch Both P2 regressions are fixed in df0eb1e and the review threads are resolved. Could you take another look? Added normal/streaming regressions for shared handoff and agent-as-tool targets, nested tool approval/resume, and callback changes to instructions/tools. All 318 tests, lint/type checks, and the package build pass locally. GitHub denied this account permission to submit a formal review request, so requesting re-review here.

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One remaining P2 regression reproduced in normal and streaming runs. Both reproductions pass on the PR base and fail on df0eb1e. The existing 318 plugin tests and make lint pass.

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@brianstrauch
brianstrauch enabled auto-merge (squash) October 20, 2026 23:32
@brianstrauch
brianstrauch merged commit b66c137 into temporalio:main Oct 20, 2026
15 checks passed
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