dev: make ai return an action rather than calling it directly, less intertwined