chore(mma): Clean up mma_exec.py and robustify visual simulation mocking
This commit is contained in:
@@ -10,6 +10,7 @@ import datetime
|
||||
|
||||
LOG_FILE: str = 'logs/mma_delegation.log'
|
||||
|
||||
|
||||
def generate_skeleton(code: str) -> str:
|
||||
"""
|
||||
Parses Python code and replaces function/method bodies with '...',
|
||||
@@ -126,42 +127,9 @@ def get_dependencies(filepath: str) -> list[str]:
|
||||
print(f"Error getting dependencies for {filepath}: {e}")
|
||||
return []
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
# Mock Response Definitions
|
||||
MOCK_PLANNING_RESPONSE = {
|
||||
"status": "success",
|
||||
"message": "Mock response for planning task.",
|
||||
"data": {
|
||||
"task_type": "planning",
|
||||
"details": "Mocked plan generated."
|
||||
}
|
||||
}
|
||||
|
||||
MOCK_GENERIC_RESPONSE = {
|
||||
"status": "success",
|
||||
"message": "Mock response from the agent.",
|
||||
"data": {
|
||||
"task_type": "generic_mock",
|
||||
"details": "This is a generic mock response."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def execute_agent(role: str, prompt: str, docs: list[str], debug: bool = False, failure_count: int = 0) -> str:
|
||||
model = get_model_for_role(role, failure_count)
|
||||
|
||||
# --- NEW MOCK HANDLING LOGIC ---
|
||||
if model == 'mock':
|
||||
# The 'prompt' argument here represents the user's task/command text.
|
||||
if "Epic Initialization" in prompt or "Sprint Planning" in prompt:
|
||||
return json.dumps(MOCK_PLANNING_RESPONSE)
|
||||
else:
|
||||
return json.dumps(MOCK_GENERIC_RESPONSE)
|
||||
# --- END NEW MOCK HANDLING LOGIC ---
|
||||
|
||||
# Advanced Context: Dependency skeletons for Tier 3
|
||||
injected_context = ""
|
||||
# Whitelist of modules that sub-agents have "unfettered" (full) access to.
|
||||
|
||||
Reference in New Issue
Block a user