agentic-ai / enact

A framework for generative software.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change response.invokable to be a recursive set of field updates.

lcrh opened this issue · comments

Currently, calling set_from on a resource will try and set resources directly to their corresponding target value, or if the type does not match, it will allocate a new object.

Generally, this logic does not perfectly track python semantics: A caller may explicitly initialize a new resource object and later check via ID whether it is the same. We also don't handle the case perfectly where new objects are allocated based on old objects and their ID is relevant. E.g., consider the case where nodes in a binary tree are swapped.

This means that code can execute differently during replay if it cares about the identities of specific dataclasses.

We can potentially add better support for directly tracking aliased updates to resources, which would mean replacing the 'invokable' response object by some form of update tracking.