Skip to content

feat: implicit resume via effectiveConversationId for chat/gemini routes#432

Merged
icebear0828 merged 2 commits intodevfrom
feat/implicit-resume-derived-key
May 2, 2026
Merged

feat: implicit resume via effectiveConversationId for chat/gemini routes#432
icebear0828 merged 2 commits intodevfrom
feat/implicit-resume-derived-key

Conversation

@icebear0828
Copy link
Copy Markdown
Owner

Summary

  • Introduces effectiveConversationId fallback chain (clientConversationIdderivedConversationIdpromptCacheKey) in proxy-handler.ts.
  • Uses effectiveConversationId for both chainConversationId and the implicitPrevRespId lookup condition to ensure seamless implicit resume even without explicit client-provided session IDs.
  • Forwards req.user from the OpenAI schema as clientConversationId in chat.ts.
  • Extracts x-conversation-id and x-session-id headers as clientConversationId in gemini.ts.
  • Adds a comprehensive test suite implicit-resume-from-derived-key.test.ts to validate multi-turn session affinity logic.

Test plan

  • Run npx vitest run tests/unit/routes/implicit-resume-from-derived-key.test.ts (all 4 tests pass)
  • Run the full test suite npx vitest run (1649 tests pass)

- proxy-handler.ts: introduce effectiveConversationId fallback chain
  (clientConversationId → derivedConversationId → promptCacheKey) for
  both chainConversationId and implicitPrevRespId lookup
- chat.ts: forward req.user as clientConversationId
- gemini.ts: extract x-conversation-id/x-session-id as clientConversationId
- Add implicit-resume-from-derived-key.test.ts
@icebear0828 icebear0828 merged commit 027f5c5 into dev May 2, 2026
1 check passed
@icebear0828 icebear0828 deleted the feat/implicit-resume-derived-key branch May 2, 2026 02:46
icebear0828 added a commit that referenced this pull request May 5, 2026
…tes (#432)

* feat: implicit resume via effectiveConversationId for chat/gemini routes

- proxy-handler.ts: introduce effectiveConversationId fallback chain
  (clientConversationId → derivedConversationId → promptCacheKey) for
  both chainConversationId and implicitPrevRespId lookup
- chat.ts: forward req.user as clientConversationId
- gemini.ts: extract x-conversation-id/x-session-id as clientConversationId
- Add implicit-resume-from-derived-key.test.ts

* fix: resolve empty string collision and missing ProxyRequest imports

---------

Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant