Follow-up from PR #20 review (CodeRabbit comment on extractForkIdentifier): #20 (comment)
In lib/session/session-manager.ts, extractForkIdentifier currently only looks at forkId, fork_id, branchId, and branch_id when deriving a fork identifier for the session key. derivePromptCacheKeyFromBody in lib/request/request-transformer.ts also considers parentConversationId and parent_conversation_id (and tracks fork hints separately) when building a fork-aware prompt_cache_key.
That means a request that only sets parentConversationId/parent_conversation_id may get a forked prompt_cache_key while the SessionManager session key still uses the bare conversation id.
This issue tracks aligning extractForkIdentifier with the same fork-hint keys used by prompt cache derivation so that:
- Session keys and prompt_cache_key stay in sync across all fork sources.
- Future fork-related behavior (branches, parent conversations) is consistent between the cache and the session layer.
We kept the narrower extractForkIdentifier behavior in PR #20 and are deferring this alignment to a follow-up.
Follow-up from PR #20 review (CodeRabbit comment on extractForkIdentifier): #20 (comment)
In lib/session/session-manager.ts, extractForkIdentifier currently only looks at forkId, fork_id, branchId, and branch_id when deriving a fork identifier for the session key. derivePromptCacheKeyFromBody in lib/request/request-transformer.ts also considers parentConversationId and parent_conversation_id (and tracks fork hints separately) when building a fork-aware prompt_cache_key.
That means a request that only sets parentConversationId/parent_conversation_id may get a forked prompt_cache_key while the SessionManager session key still uses the bare conversation id.
This issue tracks aligning extractForkIdentifier with the same fork-hint keys used by prompt cache derivation so that:
We kept the narrower extractForkIdentifier behavior in PR #20 and are deferring this alignment to a follow-up.