Skip to content

feat(session): respect explicit session ids in session create with duplicate detection#29358

Open
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:feat/session-custom-id
Open

feat(session): respect explicit session ids in session create with duplicate detection#29358
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:feat/session-custom-id

Conversation

@sjawhar
Copy link
Copy Markdown

@sjawhar sjawhar commented May 26, 2026

Issue for this PR

Closes #17344

Re-submission of #21571 (closed by automated cleanup), rebased onto current dev. The previous PR could not be reopened because the branch has been force-pushed since closure.

Type of change

  • Bug fix
  • New feature

What does this PR do?

Allows callers to specify an explicit session ID at create time (matching the request in #17344), with proper duplicate detection: returns a DuplicateIDError (HTTP 409 via the API) instead of silently overwriting or generating a new ID.

How did you verify your code works?

test/session/session.test.ts covers the custom-ID round-trip and duplicate detection paths. SDK regenerated to expose the new error type. bun typecheck passes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.

[FEATURE]: Allow custom session ID when starting Opencode (e.g., --session my-project)

1 participant