Skip to content

Fix pickling and copying deferred hook exceptions - #368

Merged
anbuzin merged 1 commit into
mainfrom
fix-hook-exception-pickle
Nov 18, 2026
Merged

anbuzin merged 1 commit into
mainfrom
fix-hook-exception-pickle

Conversation

@anbuzin

@anbuzin anbuzin commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Pickle and copy tried to rebuild HookDeferredException with the hook ID, but the constructor needs the whole HookPart. We now pass the part, so both work and keep .hook.

The default exception reducer reconstructs from args, which holds the
hook id. The constructor needs the HookPart instead, so unpickling and
copying raised AttributeError.

Serialize the hook and instance state explicitly. Keep the exception
arguments and text unchanged, and test pickle, shallow copy, deep copy,
and exception notes.
@anbuzin anbuzin added the fix Bug fix label Nov 17, 2026
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ai-python Ready Ready Preview, v0 Nov 17, 2026 11:53pm UTC

@anbuzin
anbuzin merged commit 39847a4 into main Nov 18, 2026
14 checks passed
@anbuzin
anbuzin deleted the fix-hook-exception-pickle branch November 18, 2026 18:54

This branch was successfully deployed

1 active deployment
Preview — 7200b260 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants