Add durable asset storage contracts - #1957
arnabnandy7 wants to merge 1 commit into
Conversation
igordayen
left a comment
There was a problem hiding this comment.
@arnabnandy7 - few comments to consider, thank you
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
2c0d942 to
11bd812
Compare
|
@arnabnandy7, thanks for addressing inquiries.
However, align these two things:
Recommendation for PR author: Add a NoOpAssetStore or document that addDurablyReturnedAssets must only be And more.... Package: AssetStore doesn't belong in com.embabel.chat root The root com.embabel.chat package is domain types — Asset, Conversation, Message, AssetTracker, etc. The PR adds AssetStore to the root domain package, mixing an extension point with domain types. Two options
MaterializableAsset and DurableAsset are domain types (they extend Asset) and belong in the root. Only the Visibility: FileSystemAssetStore should be internal All support implementations (InMemoryAssetTracker, InMemoryConversation, EventPublishingConversation) are But FileSystemAssetStore is different in one way: it's an opinionated default implementation that ships Summary of what to raise in the review:
|
Summary
Adds the repository-side foundation for durable conversation assets.
MaterializableAssetfor assets whose content can be copied before their original location expires.DurableAssetas portable metadata containing an opaque storage URI and content hash.AssetStoreSPI for storing, opening, and deleting durable asset content.AssetTrackerhelpers that materialize tool-returned assets before tracking them.ScriptArtifacta materializable, ephemeral asset so sandbox-produced files can participate in the standard asset flow.The implementation reuses
AssetAddingToolfor tool-result conversion and tracking.Motivation
AssistantMessageandConversationcan track assets, but tracking alone does not preserve temporary files or restore their metadata after a process restart.Script artifacts are especially affected because their paths refer to temporary execution directories. Applications currently need custom plumbing to copy those files before cleanup.
This change establishes the core contracts and capture flow required for durable storage. Conversation-store persistence and rehydration will be handled separately in
embabel-chat-store.Example
When the wrapped tool returns a
MaterializableAsset, its content is stored first and the resultingDurableAssetis added to the tracker.Verification
AssetStoreTest: 2 tests passedScriptArtifactTest: 2 tests passedFollow-up
Update
embabel-chat-storeto persistDurableAssetmetadata with assistant messages and restore those assets when conversations are loaded.Closes #1821