feat(conductor): inherit model selection when spawning subagents#489
Open
Kailigithub wants to merge 1 commit into
Open
feat(conductor): inherit model selection when spawning subagents#489Kailigithub wants to merge 1 commit into
Kailigithub wants to merge 1 commit into
Conversation
…awning subagents When a subagent is spawned via the conductor, it now inherits the conductor agent's current model selection (llm_no) instead of always defaulting to model index 0. This ensures subagents use the same model as the main session, which is the expected behavior when the user has switched models via /llms. If the conductor agent hasn't been initialized yet, the subagent falls back to the default model (index 0). Closes lsdefine#456
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
Subagents spawned by the conductor now inherit the conductor agent's current model selection instead of always defaulting to model index 0.
Problem
When the user switches models via
/llmsin the conductor session, spawned subagents still used model 0 (the default). This causes inconsistency between the conductor and subagent capabilities, costs, and fallback strategies.Solution
Added a 3-line check in
start_subagent(): if the conductor agent is initialized, callagent.next_llm(conductor_agent.llm_no)on the new subagent before starting its runner thread.The guard
if conductor_agent is not Noneensures backward compatibility — if subagents are created before the conductor agent is ready, they still fall back to model 0.Testing
python3 -m py_compile frontends/conductor.py— passesconductor_agent.llm_nois an integer attribute onGenericAgentinstances,next_llm()accepts integersCloses #456