mma execution fix

This commit is contained in:
2026-02-25 22:26:59 -05:00
parent d82c7686f7
commit 74dcd89ec5

View File

@@ -134,11 +134,17 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
except Exception as e: except Exception as e:
print(f"Error generating skeleton for {dep_file}: {e}") print(f"Error generating skeleton for {dep_file}: {e}")
command_text = f"Use the mma-{role} skill. {injected_context}{prompt}" # MMA Protocol: Tier 3 and 4 are stateless and tool-less.
system_directive = f"STRICT SYSTEM DIRECTIVE: You are a stateless {role}. " \
"DO NOT USE ANY TOOLS (no write_file, no run_shell_command, etc.). " \
"ONLY output the requested text, code, or diff. No pleasantries."
command_text = f"{system_directive}\n\nUse the mma-{role} skill. {injected_context}{prompt}"
for doc in docs: for doc in docs:
command_text += f" @{doc}" command_text += f" @{doc}"
cmd = ['gemini', '-p', command_text, '--output-format', 'json', '--model', model] # Use --approval-mode plan to ensure the agent is in read-only mode.
cmd = ['gemini', '-p', command_text, '--output-format', 'json', '--model', model, '--approval-mode', 'plan']
try: try:
process = subprocess.run(cmd, capture_output=True, text=True, shell=True) process = subprocess.run(cmd, capture_output=True, text=True, shell=True)
if not process.stdout and process.stderr: if not process.stdout and process.stderr: