MaxCode: Add MergeAgent for file discovery, import-graph analysis and merging#24
Open
MaxCode: Add MergeAgent for file discovery, import-graph analysis and merging#24
Conversation
Introduces MergeAgent, a pure-logic agent (no LLM calls) that encapsulates the file discovery, infrastructure filtering, import-graph analysis, topological sorting, and file merging logic previously embedded in the demo script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This was referenced Apr 22, 2026
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.
Summary
Introduces MergeAgent (
agents/migration/merge_agent.py), a pure-logic agent (no LLM calls) that encapsulates the complete pre-conversion file preparation pipeline. This logic was previously embedded directly in the demo scriptstep3_merge.py(~600 lines) and is now a reusable component thatPrimaryAgentcan call programmatically.What MergeAgent does
import/from ... importstatements to build a dependency graph between filesmerged_model.pyand optionalmerged_utils.pyFiles
agents/migration/merge_agent.pyMergeResultdataclass (740 lines)examples/demo/step3_merge.pyMergeAgent.run()(127 lines)examples/demo/merged_utils.pyDesign decisions
model_codeandutility_codeso the conversion agent can handle them separatelyMergeResultprovides structured access to merged code, included file lists, and the dependency graphTest plan
step3_merge.pyon a cloned demo repo and verify merged output contains all model componentsSplit from #17 — PR 2 of 8