Skip to content

feat: add reusable session cloning endpoint#380

Open
anahaaaa wants to merge 1 commit into
imDarshanGK:mainfrom
anahaaaa:feature/session-clone-endpoint
Open

feat: add reusable session cloning endpoint#380
anahaaaa wants to merge 1 commit into
imDarshanGK:mainfrom
anahaaaa:feature/session-clone-endpoint

Conversation

@anahaaaa

Copy link
Copy Markdown

Description

Adds a reusable session cloning endpoint to duplicate an existing chat session.

Closes #295

Changes

  • Added POST /api/sessions/{session_id}/clone

  • Creates a new session with:

    • A new unique session ID
    • The original session's model
    • The original session title with " (Copy)" appended
  • Copies all chat messages from the source session into the cloned session

  • Returns the newly created session

  • Added tests for:

    • Successful session cloning
    • Handling non-existent sessions (404)

Example

Source session:

  • Title: Original Chat

  • Messages:

    • User: Hello
    • Assistant: Hi there

Cloned session:

  • Title: Original Chat (Copy)

  • Messages:

    • User: Hello
    • Assistant: Hi there

Verification

  • Added automated test coverage for clone functionality.
  • All existing tests pass successfully (41 passed).

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

@anahaaaa is attempting to deploy a commit to the Darshan's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Add a reusable session cloning endpoint

1 participant