You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add session.setModel() for mid-session model switching (#621)
* Add session.setModel() across all 4 languages
Allows changing the model mid-session without destroying it.
The new model takes effect for the next message while preserving
conversation history.
Node.js: session.setModel(model: string): Promise<void>
Python: session.set_model(model: str) -> None
Go: session.SetModel(ctx, model string) error
.NET: session.SetModelAsync(model, cancellationToken): Task
All send the 'session.setModel' JSON-RPC method with
{ sessionId, model } params.
Tests added for all 4 languages:
- Node.js: mocked sendRequest verifies correct RPC params (25/25 pass)
- Python: mocked request verifies sessionId + model (unit test)
- Go: JSON marshaling test for request type (pass)
- .NET: e2e test creating session, calling SetModelAsync
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Refactor setModel to be thin wrappers around session.Rpc.Model.SwitchTo()
Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
* Fix ESLint error, update .NET test to verify model_change event, add skipped Go test
Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
* Fix Prettier formatting in client.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
0 commit comments