Skip to content

SessionManager: align fork identifier with prompt cache fork hints #23

@riatzukiza

Description

@riatzukiza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort-mediumMedium effort issues - 4-12 hours of workpriority-mediumMedium priority issues - important features or significant improvementssession-managementIssues related to SessionManager, prompt cache keys, and fork handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions