Replace Literal model type with string in Python SessionConfig#325
Merged
Replace Literal model type with string in Python SessionConfig#325
Conversation
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update SessionConfig model field to optional string with validation
Replace Literal model type with string in Python SessionConfig
Feb 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python SDK's SessionConfig.model type to match the Node.js SDK's flexible approach, allowing any string value instead of hardcoded model names that quickly become stale.
Changes:
- Changed
modelfield type fromLiteralwith specific model names tostr - Added inline documentation directing users to
list_models()for discovering available models
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
friggeri
approved these changes
Feb 2, 2026
|
Great 😁😁 okay |
|
Shitty coins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python SDK's
SessionConfig.modelused a hardcodedLiteraltype that becomes stale as model availability changes. Node.js SDK usesstringwith runtime validation by the CLI server.Changes
python/copilot/types.py: Changedmodelfield fromLiteral["gpt-5", "claude-sonnet-4", "claude-sonnet-4.5", "claude-haiku-4.5"]tostrlist_models()for discovering available modelsImpact
Aligns Python SDK with Node.js SDK's flexible approach. Model validation occurs at session creation time by the CLI server.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.