weiqingy opened a new issue, #545: URL: https://github.com/apache/flink-agents/issues/545
### Search before asking - [x] I searched in the [issues](https://github.com/apache/flink-agents/issues) and found nothing similar. ### Description ## What is currently not ideal? `ActionExecutionOperator` is a 1,131-line "God class" that manages 15 state objects across 6 unrelated concerns: event routing, Python bridge management, durable execution, state management, context management, and action lifecycle coordination. This makes it difficult to: - Test individual concerns in isolation - Reason about state ownership and lifecycle - Safely add future features (multi-agent, better async) without risk of regressions ## How should it be fixed or improved? Decompose `ActionExecutionOperator` into 5 package-private manager classes, each owning a single concern: | New Class | Responsibility | |-----------|---------------| | `PythonBridgeManager` | Python interpreter, PythonActionExecutor, resource adapters lifecycle | | `DurableExecutionManager` | ActionStateStore, action state persistence, recovery, checkpoint pruning (implements `ActionStatePersister`) | | `ActionTaskContextManager` | Runner context creation, 4 transient maps, context transfer across async invocations | | `EventRouter` | Event wrapping/routing, notification (EventLogger + EventListeners), watermark management via SegmentedQueue | | `OperatorStateManager` | 7 Flink state objects initialization, sequence number management, snapshot helpers | After extraction, `ActionExecutionOperator` shrinks to ~250-300 lines of pure coordination logic. ### Constraints - All new classes are **package-private** — no public API changes - Flink state descriptor names/types unchanged — **savepoint compatible** - New managers are `transient`, initialized in `open()` — same serialization pattern - All existing tests must pass unchanged (reflection paths in tests updated to reach through managers) ### Verification - `mvn test -pl runtime` — all existing operator tests pass - `./tools/lint.sh -c` — formatting compliance - `./tools/ut.sh -j` — full Java test suite ### Are you willing to submit a PR? - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
