feat(mma): complete Phase 6 and finalize Comprehensive GUI UX track
- Implement Live Worker Streaming: wire ai_client.comms_log_callback to Tier 3 streams - Add Parallel DAG Execution using asyncio.gather for non-dependent tickets - Implement Automatic Retry with Model Escalation (Flash-Lite -> Flash -> Pro) - Add Tier Model Configuration UI to MMA Dashboard with project TOML persistence - Fix FPS reporting in PerformanceMonitor to prevent transient 0.0 values - Update Ticket model with retry_count and dictionary-like access - Stabilize Gemini CLI integration tests and handle script approval events in simulations - Finalize and verify all 6 phases of the implementation plan
This commit is contained in:
@@ -60,38 +60,49 @@ def main() -> None:
|
||||
}), flush=True)
|
||||
return
|
||||
|
||||
# If the prompt contains tool results, provide final answer
|
||||
if '"role": "tool"' in prompt or '"tool_call_id"' in prompt:
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "I have processed the tool results and here is the final answer."
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "result",
|
||||
"status": "success",
|
||||
"stats": {"total_tokens": 100, "input_tokens": 80, "output_tokens": 20},
|
||||
"session_id": "mock-session-final"
|
||||
}), flush=True)
|
||||
return
|
||||
|
||||
# Default flow: emit a tool call to test multi-round looping
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "I need to check the directory first."
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "tool_use",
|
||||
"name": "list_directory",
|
||||
"id": "mock-call-1",
|
||||
"args": {"dir_path": "."}
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "result",
|
||||
"status": "success",
|
||||
"stats": {"total_tokens": 10, "input_tokens": 10, "output_tokens": 0},
|
||||
"session_id": "mock-session-default"
|
||||
}), flush=True)
|
||||
# Check for multi-round integration test triggers
|
||||
is_resume = '--resume' in " ".join(sys.argv) or 'role: tool' in prompt or 'tool_call_id' in prompt
|
||||
if is_resume or 'Perform multi-round tool test' in prompt or 'Please read test.txt' in prompt or 'Deny me' in prompt:
|
||||
if not is_resume:
|
||||
# First round: emit tool call
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "I need to check the directory first."
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "tool_use",
|
||||
"name": "run_powershell",
|
||||
"id": "mock-call-1",
|
||||
"args": {"script": "Get-ChildItem"}
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "result",
|
||||
"status": "success",
|
||||
"stats": {"total_tokens": 10, "input_tokens": 10, "output_tokens": 0},
|
||||
"session_id": "mock-session-default"
|
||||
}), flush=True)
|
||||
return
|
||||
else:
|
||||
# Second round
|
||||
if "USER REJECTED" in prompt:
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "Tool execution was denied. I cannot proceed."
|
||||
}), flush=True)
|
||||
else:
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "I have processed the tool results and here is the final answer."
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "result",
|
||||
"status": "success",
|
||||
"stats": {"total_tokens": 100, "input_tokens": 80, "output_tokens": 20},
|
||||
"session_id": "mock-session-final"
|
||||
}), flush=True)
|
||||
return
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user