fix: prevent LLM from overriding pi's default model in subagents#20
Open
Jehu wants to merge 1 commit into
Open
fix: prevent LLM from overriding pi's default model in subagents#20Jehu wants to merge 1 commit into
Jehu wants to merge 1 commit into
Conversation
…pi's default model When the 'model' and 'default_model' parameters had no description, the LLM would often guess a model (e.g. 'sonnet') and pass it to spawn_teammate, causing resolveModelWithProvider() to resolve it to anthropic/sonnet via PROVIDER_PRIORITY — overriding pi's configured default model (e.g. zai/glm-5.1). Added explicit descriptions instructing the LLM to omit these parameters unless the user explicitly requests a specific model, so that pi's default model is preserved. Affected tools: team_create, spawn_teammate, create_predefined_team
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.
Problem
When spawning teammates, the LLM (team lead) often passes
model: "sonnet"(or similar) tospawn_teammate— even when the user never specified a model. This happens because themodelparameter had no description instructing the LLM to omit it when not explicitly requested.Root Cause
spawn_teammate,team_create, andcreate_predefined_teamhadmodel/default_modelparameters with no description — the LLM had no guidance on when (not) to set them.resolveModelWithProvider("sonnet")resolves viaPROVIDER_PRIORITYtoanthropic/sonnet(anthropic is the first API-key provider in the list).pi --model anthropic/sonnet, overriding pi's configured default model (e.g.zai/glm-5.1).Fix
Added explicit descriptions to all three
model/default_modelparameters:This ensures the LLM only passes a model when the user explicitly asks for one — otherwise pi's own default is preserved.
Affected Tools
team_create(default_model)spawn_teammate(model)create_predefined_team(default_model)Testing
All 129 existing tests pass.