Skip to content

feat(sessions): support specifying session_id when creating session#1074

Open
likzn wants to merge 1 commit intovolcengine:mainfrom
likzn:feat/add-session-id-to-create-session
Open

feat(sessions): support specifying session_id when creating session#1074
likzn wants to merge 1 commit intovolcengine:mainfrom
likzn:feat/add-session-id-to-create-session

Conversation

@likzn
Copy link
Copy Markdown

@likzn likzn commented Mar 29, 2026

Summary

Support specifying a custom session_id when creating a session. Previously, create_session() did not accept a session_id parameter. Now you can pass a specified ID to create a session, consistent with the behavior of get_session(session_id, auto_create=True).

Reference issue: #1065

Type of Change

  • New feature (feat)

Testing

  • Unit tests pass (pytest tests/api_test/sessions/test_create_session.py -v)
  • Manual testing completed (verified via API tests)

Related Issues

Checklist

  • Code follows project style guidelines
  • Tests added for new functionality
  • Documentation updated (if needed)
  • All tests pass

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

@likzn
Copy link
Copy Markdown
Author

likzn commented Mar 29, 2026

@qin-ctx hello,有空帮看眼

@qin-ctx
Copy link
Copy Markdown
Collaborator

qin-ctx commented Mar 30, 2026

@likzn 我在想要不要保留 create_session,因为我在 get_session 里已经实现了 auto_create 的逻辑。如果 create_session 仍然保留,那就需要严格检查该 sessio_id 是全新的,没有被使用。

@qin-ctx qin-ctx self-assigned this Mar 30, 2026
@likzn
Copy link
Copy Markdown
Author

likzn commented Mar 30, 2026

@likzn 我在想要不要保留 create_session,因为我在 get_session 里已经实现了 auto_create 的逻辑。如果 create_session 仍然保留,那就需要严格检查该 sessio_id 是全新的,没有被使用。

我理解为了向前兼容性是不是应该继续保留,理论上自定义id的方法放在create看起来更合适,晚点我补充下id的校验

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Docs]: 创建 session 文档有误,不支持传入 session_id

3 participants