fix(mma): Assign dedicated models per tier in execute_agent

This commit is contained in:
2026-02-25 19:51:00 -05:00
parent 00fbf5c44e
commit be2a77cc79
2 changed files with 35 additions and 11 deletions

View File

@@ -2,26 +2,36 @@ import argparse
import subprocess
import json
def get_model_for_role(role: str) -> str:
"""Returns the specific model to use for a given tier role."""
if role == 'tier1-orchestrator' or role == 'tier1':
return 'gemini-3.1-pro-preview'
elif role == 'tier2-tech-lead' or role == 'tier2':
return 'gemini-3.0-flash-preview'
else:
return 'gemini-2.5-flash-lite'
def get_role_documents(role: str) -> list[str]:
if role == 'tier1':
if role == 'tier1-orchestrator' or role == 'tier1':
return ['conductor/product.md', 'conductor/product-guidelines.md']
elif role == 'tier2':
elif role == 'tier2-tech-lead' or role == 'tier2':
return ['conductor/tech-stack.md', 'conductor/workflow.md']
elif role == 'tier3':
elif role == 'tier3-worker' or role == 'tier3':
return ['conductor/workflow.md']
return []
def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
model = get_model_for_role(role)
command_text = f"Activate the mma-{role} skill. {prompt}"
for doc in docs:
command_text += f" @{doc}"
cmd = ['gemini', '-p', command_text, '--output-format', 'json', '--model', 'gemini-2.5-flash-lite']
cmd = ['gemini', '-p', command_text, '--output-format', 'json', '--model', model]
try:
process = subprocess.run(cmd, capture_output=True, text=True, shell=True)
if not process.stdout and process.stderr:
return f"Error: {process.stderr}"
stdout = process.stdout
start_index = stdout.find('{')
if start_index != -1:
@@ -39,7 +49,7 @@ def create_parser():
parser = argparse.ArgumentParser(description="MMA Execution Script")
parser.add_argument(
"--role",
choices=['tier1', 'tier2', 'tier3', 'tier4'],
choices=['tier1', 'tier2', 'tier3', 'tier4', 'tier1-orchestrator', 'tier2-tech-lead', 'tier3-worker', 'tier4-qa'],
required=True,
help="The tier role to execute"
)