Skip to content

Conversation

@pakrym-oai
Copy link
Collaborator

@pakrym-oai pakrym-oai commented Jan 12, 2026

Maintain a long-running session.

Remove OnceLock-backed ModelClientSession from TurnContext and create a new session per turn/compact run. Pass the session explicitly into try_run_turn and use it for streaming, avoiding shared mutable state.
}

#[derive(Debug, Clone)]
pub struct ModelClientSession {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have identical structs ModelClientSession and ModelClient?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ModelClientSession will have more per-session state in the future (like websocket) connection in addition to the more generic state of the client.

Adds an extremely minimal websocket-based client for Responses API.

This PR doesn't implement many things (like long running sessions, model
etags, usage) etc.

It's mostly setting up a place to iterate.
@pakrym-oai pakrym-oai enabled auto-merge (squash) January 13, 2026 01:12
@pakrym-oai pakrym-oai merged commit 490c1c1 into main Jan 13, 2026
32 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/add-model-client-sessions branch January 13, 2026 01:15
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants