Replace smart model resolution with explicit model selection#21
Open
watzon wants to merge 4 commits into
Open
Conversation
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.
Summary
This PR replaces smart model resolution in
pi-teamswith a stricter, more explicit model-selection workflow.The main changes are:
list_available_modelsso the orchestrator can see real, currently available models from the pi runtimeprovider/modelvalues when a model is explicitly provided for new teams or new teammatesctx.modelRegistry.getAvailable()in-process instead of shelling out topi --list-modelsWhy
I ran into problems immediately while trying to use
pi-teamsin a normal workflow.In particular, ambiguous model names like
gpt-5could end up resolving to providers the user did not intend, including providers that may cost money or fail due to missing auth. That made the old smart-resolution behavior feel too magical for a workflow that directly affects cost, reliability, and user expectations.This change tries to make the workflow better across the board by making model choice:
Final behavior
For newly created teams / newly spawned teammates:
list_available_modelsprovider/modelgpt-5orhaikuare rejected when explicitly providedIf no explicit model is provided:
team_createuses the current active modelspawn_teammateuses the team default model, or else the current active modelcreate_predefined_teamuses the current active model when no explicitdefault_modelis providedFor pre-existing team configurations:
Important note
I want to be explicit that this PR includes a fairly opinionated workflow change, and I made a number of product/design decisions here without prior discussion.
Please treat this as a contribution you can adopt, adapt, partially use, or decline entirely.
If this direction does not fit the project, that is completely fine — in that case I will simply maintain the behavior I need in my own fork.
Notes on implementation
ctx.modelRegistry.getAvailable()defaultProvider,defaultModel,enabledModels) and optionalpi-teamsconfig orderingValidation
npm testlist_available_modelsreturns real runtime modelsChangelog