fix(core): reuse prompt cache for forks

This commit is contained in:
Dax Raad
2026-08-18 11:38:11 -04:00
parent 46378dda50
commit d5e83fefda
+2 -1
View File
@@ -231,7 +231,8 @@ export const layer = Layer.effect(
http: {
headers: SessionModelHeaders.make(session, app),
},
promptCacheKey: SessionPromptCacheKey.make(session.id),
// TODO: Persist cache lineage so nested forks reuse the root session's cache key.
promptCacheKey: SessionPromptCacheKey.make(session.fork?.sessionID ?? session.id),
system: context.system,
messages: boundImages(unsupportedParts(context.messages, resolved.capabilities)),
tools: Array.from(hooked, ([name, tool]) => ({ ...tool, name })),