Research in on-orbit processing enables edge AI deployment over satellite optical networks. However, these operations induce frequent battery discharge cycles, particularly depth-of-discharge (DoD) events, which accelerate degradation and curtail satellite longevity. To address this, we propose green task-aware routing planning (GreenRP), a task-aware routing framework that achieves sustainable edge AI through dynamic task offloading and discharge-resilient path orchestration. GreenRP employs a novel battery aging model explicitly coupling DoD effects with laser inter-satellite link dynamics under AI workloads, enhancing system sustainability. Comprehensive evaluation on a 1152-satellite constellation demonstrates that GreenRP extends network lifetime by 176% over shortest-path routing while meeting latency and completion rate targets. This work enables reliable edge AI via sustainable satellite resource utilization.