refactor: pass store via AgentContext, eliminate duplicate store instances #340
Reference in New Issue
Block a user
Delete Branch "refactor/pass-store-via-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Agents now receive
storeviactx.storeinstead of creating their own.Why
Previously agent-kit and uwf-agent-hermes each created separate
createFsStore()instances pointing to the same directory — separate in-memory caches, fragile.Changes
AgentContextgainsstore: Storecontext.tspasses store into ctxuwf-agent-hermesusesctx.storemock-agent.tsusesctx.storecreateAgentStore/resolveStorageRootfrom public exportsRefs #337
LGTM ✅ store 通过 ctx 传递,不再重复创建。类型也从 Awaited<ReturnType<...>> 简化为直接 Store/AgentStore,可读性好多了。