Refactor/simplify agent compiler - #1443
Draft
kowser-orkes wants to merge 6 commits into
Draft
Conversation
added 6 commits
July 30, 2026 23:48
Move simplifySchema/simplifyNode/inlineRefs/resolveNode/pythonDictRepr — pure JSON-Schema-to-text converters with no AgentConfig dependency and a single call site in buildLlmTask — into their own package-private class. pythonDictRepr becomes private (no caller found outside its own recursion). No test files touched.
Move ensureUniqueRefNames + its dedup/update/replace helpers — a general-purpose WorkflowTask ref-renaming algorithm called from compile()'s shared post-processing step for every dispatch path, not just graph-structure compilation — into their own package-private class. No test files touched.
Move the LangGraph-to-Conductor sub-compiler (compileGraphStructure, buildLlmNodeTasks, buildSubgraphNodeTasks, findJoinPoint, allocRef, buildForkMergeTask) into its own package-private class, mirroring MultiAgentCompiler's existing (AgentCompiler) constructor pattern. findJoinPoint/allocRef/buildForkMergeTask tighten from package-private to private — nothing else called them. WORKFLOW_INPUTS widens from private to package-private (also used by createWorkflow and compileFrameworkPassthrough). applyRetryPolicy stays on AgentCompiler (test-pinned) and is called qualified. No test files touched.
Extract four blocks copy-pasted across the three compile paths into shared private methods: wireRetryParticipants (3 call sites), buildContextInjectTask + injectContextIntoUserMessage (2), compileOutputGuardrails (3), resolveToolDiscovery + ToolDiscoveryOutcome (2). Verified with the full test suite after each individual extraction. No behavior change, no test files touched.
…ureCompiler GRAALJS_EVALUATOR_TYPE (shared, wire contract with the JS engine), DEFAULT_MAX_TURNS, REQUIRED_TOOLS_MAX_ITERATIONS on AgentCompiler; DEFAULT_MAX_TOKENS declared independently in both classes (a tunable default that happens to coincide today, not a shared invariant). Mirrors the existing DEFAULT_THINKING_BUDGET_TOKENS pattern. No test files touched.
Replace raw "SIMPLE"/"INLINE"/"SWITCH"/"JOIN"/"FORK_JOIN"/ "FORK_JOIN_DYNAMIC"/"SUB_WORKFLOW"/"SET_VARIABLE"/"DO_WHILE" literals with conductor-common's existing TaskType.TASK_TYPE_* constants in AgentCompiler.java and GraphStructureCompiler.java. "LLM_CHAT_COMPLETE" left as a literal — no matching TaskType constant exists for it. ToolCompiler.java/MultiAgentCompiler.java have the same gap but are out of scope here. No test files touched.
kowser-orkes
force-pushed
the
refactor/simplify-agent-compiler
branch
from
July 31, 2026 06:48
8c2d077 to
4aa2df3
Compare
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.
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Changes in this PR
Describe the new behavior from this PR, and why it's needed
Issue #
Alternatives considered
Describe alternative implementation you have considered