Skip to content

Add experimental Session Store SDK adapters - #431

Draft
annzhang-db wants to merge 2 commits into
databricks:mainfrom
annzhang-db:codex/conversations-base-url
Draft

Add experimental Session Store SDK adapters#431
annzhang-db wants to merge 2 commits into
databricks:mainfrom
annzhang-db:codex/conversations-base-url

Conversation

@annzhang-db

@annzhang-db annzhang-db commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This draft prototypes how third-party agent SDKs can use the proposed Databricks Session Store REST API.

  • adds a shared async REST client with Databricks authentication, pagination, LiteSwap routing, and Session/SessionEvent operations
  • adds databricks_openai.agents.DatabricksSession, implementing the OpenAI Agents SDK Session protocol
  • adds DatabricksClaudeSessionStore, implementing Claude Agent SDK transcript mirroring, listing, deletion, and subagent transcript discovery
  • supports a separate Conversations API base URL for the Databricks OpenAI client
  • documents branch installation and runnable OpenAI/Claude integration shapes

Why this is a draft

The REST resource names, endpoint prefix, and idempotency contract are still being finalized. The public classes are marked experimental so we can use this branch in Databricks Apps while continuing to make breaking prototype changes.

API design findings

  • OpenAI maps directly to list, append, pop, and clear operations.
  • Claude storage identity is (project_key, session_id, optional subpath); the adapter includes the project hash in the physical Databricks session ID to avoid cross-project collisions.
  • Claude subagent subpath values map naturally to child Sessions.
  • Claude retries UUID-bearing transcript entries. The prototype performs best-effort read-before-append deduplication, but atomic retry safety still requires a caller idempotency key per event or equivalent conditional append semantics.

How do you know it works?

The new tests cover authenticated request construction, URL encoding, pagination, errors, all event mutations, OpenAI item mapping and protocol conformance, Claude UUID deduplication, project isolation, subagent child sessions, listing, and cascade deletion.

  • Core suite: 104 passed, 54 skipped, 1 environment-bound credential test deselected.
  • OpenAI unit suite: 179 passed, 1 skipped, 2 environment-bound credential tests deselected.
  • Ruff formatting and lint pass for the core and OpenAI packages.
  • Targeted type checks pass; full package checks report only pre-existing unused-ignore warnings.
  • A live LiteSwap smoke test successfully created, appended, listed, popped, cleared, and deleted a session.
  • Live adapter smoke tests round-tripped an OpenAI item and verified Claude UUID deduplication, project listing, and subagent discovery.

@annzhang-db
annzhang-db force-pushed the codex/conversations-base-url branch 2 times, most recently from 352be3d to 97120ff Compare June 5, 2026 01:12
@property
def conversations(self) -> Conversations:
if not hasattr(self, "_databricks_conversations_client"):
self._databricks_conversations_client = OpenAI(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use DatabricksOpenAI here right so workspace client authorization flows through?

@annzhang-db
annzhang-db force-pushed the codex/conversations-base-url branch from 97120ff to 8e186a9 Compare June 5, 2026 01:43
@annzhang-db annzhang-db changed the title Support separate Conversations API base URL Add experimental Session Store SDK adapters Aug 6, 2026
@annzhang-db
annzhang-db marked this pull request as draft August 6, 2026 01:40
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.

2 participants