Skip to content

Refactor/simplify agent compiler - #1443

Draft
kowser-orkes wants to merge 6 commits into
mainfrom
refactor/simplify-agent-compiler
Draft

Refactor/simplify agent compiler#1443
kowser-orkes wants to merge 6 commits into
mainfrom
refactor/simplify-agent-compiler

Conversation

@kowser-orkes

Copy link
Copy Markdown
Contributor

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • WHOSUSING.md
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to 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

Kowser 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
kowser-orkes force-pushed the refactor/simplify-agent-compiler branch from 8c2d077 to 4aa2df3 Compare July 31, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant