feat(mma): Finalize Orchestrator Integration and fix all regressions

This commit is contained in:
2026-02-27 18:31:14 -05:00
parent 8438f69197
commit 3b2d82ed0d
27 changed files with 706 additions and 297 deletions

View File

@@ -68,13 +68,13 @@ def get_model_for_role(role: str) -> str:
if role == 'tier1-orchestrator' or role == 'tier1':
return 'gemini-3.1-pro-preview'
elif role == 'tier2-tech-lead' or role == 'tier2':
return 'gemini-3-flash-preview'
return 'gemini-2.5-flash-lite'
elif role == 'tier3-worker' or role == 'tier3':
return 'gemini-3-flash-preview'
return 'gemini-2.5-flash-lite'
elif role == 'tier4-qa' or role == 'tier4':
return 'gemini-2.5-flash-lite'
else:
return 'gemini-3-flash-preview'
return 'gemini-2.5-flash-lite'
def get_role_documents(role: str) -> list[str]:
if role == 'tier1-orchestrator' or role == 'tier1':
@@ -176,12 +176,17 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
if role in ['tier3', 'tier3-worker']:
system_directive = "STRICT SYSTEM DIRECTIVE: You are a stateless Tier 3 Worker (Contributor). " \
"Your goal is to implement specific code changes or tests based on the provided task. " \
"You have access to tools for reading and writing files, and run_shell_command for TDD verification. " \
"You have access to tools for reading and writing files (e.g., read_file, write_file, replace). " \
"CRITICAL: You CANNOT execute PowerShell scripts or run shell commands directly. " \
"If you need to verify code or run tests, output the full PowerShell script inside a " \
"markdown code block (e.g., ```powershell) and state that it needs to be executed. " \
"Follow TDD and return success status or code changes. No pleasantries, no conversational filler."
elif role in ['tier4', 'tier4-qa']:
system_directive = "STRICT SYSTEM DIRECTIVE: You are a stateless Tier 4 QA Agent. " \
"Your goal is to analyze errors, summarize logs, or verify tests. " \
"You have access to tools for reading files, exploring the codebase, and run_shell_command for diagnostics. " \
"You have access to tools for reading files and exploring the codebase. " \
"CRITICAL: You CANNOT execute PowerShell scripts or run shell commands directly. " \
"If you need to run diagnostics, output the PowerShell script and request execution. " \
"ONLY output the requested analysis. No pleasantries."
else:
system_directive = f"STRICT SYSTEM DIRECTIVE: You are a stateless {role}. " \
@@ -203,9 +208,11 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
# Use subprocess with input to pipe the prompt via stdin, avoiding WinError 206.
# We use -p 'mma_task' to ensure non-interactive (headless) mode and valid parsing.
# Whitelist tools to ensure they are available to the model in headless mode.
allowed_tools = "read_file,write_file,replace,list_directory,glob,grep_search,search_files,get_file_summary"
ps_command = (
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "
f"gemini -p 'mma_task' --allow-shell --output-format json --model {model}"
f"gemini -p 'mma_task' --allowed-tools {allowed_tools} --output-format json --model {model}"
)
cmd = ['powershell.exe', '-NoProfile', '-Command', ps_command]

View File

@@ -5,7 +5,7 @@ param(
[ValidateSet("Worker", "QA", "Utility")]
[string]$Role = "Utility",
[string]$Model = "flash",
[string]$Model = "flash-lite",
[switch]$ShowContext
)