[python] Remove the Python local execution path#882
Open
weiqingy wants to merge 8 commits into
Open
Conversation
…kwargs Backfill remote (MiniCluster) coverage for two durable_execute behaviors previously exercised only by the in-process local execution path: propagation of exceptions raised through synchronous durable_execute, and calling durable_execute with keyword arguments. Existing remote tests covered only the async-exception and positional-argument paths. Mirrors the established execute_test.py pattern (FileSource in, StreamingFileSink out, check_result assertion) with matching ground-truth files.
…del get_resource Backfill remote (MiniCluster) coverage, using a deterministic mock chat model, for behavior previously exercised only by the in-process local execution path: the built-in chat_model_action + tool_call_action content flow with correct tool binding, and get_resource(CHAT_MODEL) inside an action with custom ResourceDescriptor field pass-through. The mock stubs only LLM inference, so the framework's built-in actions remain the code under test. Follows the execute_test.py agent/test split and resource convention.
Backfill remote (MiniCluster) MCP coverage — none existed. The test invokes the MCP tool and fetches the MCP prompt directly via get_resource, with no LLM, mirroring the Java MCPCrossLanguageAgent pattern. It self-starts the existing MCP server scripts and gates only on server readiness (no Ollama), asserting the server-computed sum and prompt content for both with-prompts and without-prompts server modes.
…non-Ollama chat providers Backfill the remaining behaviors covered only by the in-process local execution path: the apply(unknown-name) ValueError guard on the remote builder (unit test, no cluster); short-term-memory workflow semantics (same-key visit_count accumulation and auto-generated key for a keyless record) on a real MiniCluster; and chat model coverage for the non-Ollama providers (Tongyi/OpenAI/AzureOpenAI) on the remote path, keeping the original per-provider credential gating.
Prepare removal of the Python local execution path: delete the local-path tests now covered by the remote (MiniCluster) tests added earlier, and migrate the remaining tests and examples onto the remote path. The local classes and their API are left intact here and removed in the following commit so nothing dangles. - Delete local-path tests backfilled by remote equivalents (durable execute, built-in action, get_resource, MCP, chat model, workflow memory) and the local-runner-only tests. - Migrate test_loader registration tests to construct RemoteExecutionEnvironment directly under patch (the unit lane has no built JARs, so the environment factory cannot be used there). - Migrate the RAG and quickstart examples off from_list/to_list to the remote DataStream pattern. - Drop the now-unused tool_invocations_from_events helper and its test. - Rename test_local_runner_cross_language to test_plan_java_function_routing; it now covers only PlanJavaFunction routing.
Remove the in-process local execution path now that all callers are migrated to the remote (Flink) path: - Delete local_runner.py and local_execution_environment.py. - Remove the orphaned from_list/to_list execution-environment API (abstract and remote) and get_tool_request_events. - Require a StreamExecutionEnvironment: get_execution_environment now raises when no environment is provided, instead of falling back to the local path. - Update the ReActAgent docstring example and remove the local-path sections and no-argument snippets from the documentation.
wenjin272
reviewed
Jul 8, 2026
wenjin272
left a comment
Contributor
There was a problem hiding this comment.
Thanks for taking this on @weiqingy. I left one comment about doc.
Besides, LocalMemoryObject now appears to be used only by tests (test_chat_model_action, test_local_memory_object, and test_memory_reference). Since this PR removes the local execution path, could we move it out of flink_agents.runtime and keep it as a test fixture instead? That would avoid leaving a local-runtime-looking class in the production package.
Collaborator
Author
There was a problem hiding this comment.
@wenjin272 Thanks for the review. Both addressed:
configuration.mdLocal-mode example: removed inb495072. It pointed at the run-without-Flink path this PR deletes. That left MiniCluster as the only special case, so I also changed the intro from "the following two cases" to the singular form.LocalMemoryObject: moved toflink_agents.runtime.tests.local_memory_objectind4243f1, so it's no longer in the production runtime package. It's now purely an in-memory test fixture, and the three importers (test_chat_model_action,test_memory_reference,test_local_memory_object) are updated — it now sits alongside its own unit test inruntime/tests.
The Python local execution path is removed in this PR, so the run-without-Flink configuration example no longer applies. Drop the "Local mode" bullet and update the surrounding text, since MiniCluster is now the only special case requiring manual configuration.
With the local execution path removed, LocalMemoryObject is used only as an in-memory test fixture. Relocate it from flink_agents.runtime to flink_agents.runtime.tests so it no longer sits in the production package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue: #829
Purpose of change
Second of two PRs retiring the Python in-process local execution path, per #829. This PR removes the local path itself.
Stacked on #881 (the additive test backfill). Until #881 merges, this PR's diff includes #881's commits; the net-new change here is the removal, in the last two commits — "Remove local-path tests and migrate remaining tests off it" and "Delete the local execution path and require a Flink environment". I'll rebase once #881 lands.
What this removes:
local_runner.pyandlocal_execution_environment.py— the pure-Python, single-process execution path selected when no Flink environment was passed.from_list/to_listtest-only API and the local-onlyget_tool_request_eventshook.get_execution_environmentnow requires aStreamExecutionEnvironmentand raises a clear error when none is provided, instead of falling back to the local path. The RAG and quickstart examples are migrated to the remote DataStream pattern.LocalMemoryObjectis kept as an in-memory test fixture (it is independent of the runner and still used by unit tests).Tests
The Python unit lane and the remote end-to-end suite pass. The local-path tests are removed because equivalent behavior is now exercised on a real Flink MiniCluster by the tests added in #881 (durable-execute sync-exception and kwargs, built-in action content and
get_resource, MCP tool and prompt invocation, workflow short-term-memory semantics, and the apply-by-name guard).API
Yes — this removes public surface: the execution-environment
from_list/to_listmethods,get_tool_request_events, and the no-argumentget_execution_environment()form (a Flink environment is now required). This is a deliberate removal of the non-production local path while the project is in beta.Documentation
doc-neededdoc-not-neededdoc-included