fix(server): make AgentConfig.synthesize nullable Boolean (unblocks Suite16)#242
Merged
Conversation
The PAC/PAE commit (acbde7d) accidentally removed: * ``AgentConfig.synthesize`` (the field that gated the final-LLM synthesis step on HANDOFF / ROUTER / SWARM strategies, added by PR #189); * The ``if (config.isSynthesize()) tasks.add(finalLlm);`` guards at the three call sites in MultiAgentCompiler. Result: ``synthesize=false`` was silently ignored — the SDKs serialized the flag but the server's Jackson dropped it on deserialise (no field), and the workflow always emitted the ``_final`` LLM_CHAT_COMPLETE task. The Java ``Suite16Synthesize`` e2e suite caught this once it started running in CI (3 / 4 tests failing). Restore in three pieces: * ``AgentConfig.synthesize`` — modelled as nullable ``Boolean`` (not primitive + Builder.Default) so ``@JsonInclude(NON_NULL)`` keeps the field out of serialized output when callers leave it unset. The Java SDK's ``Suite16Synthesize`` test asserts the agentDef metadata MUST NOT contain ``synthesize`` when the flag is at its default — a primitive-with-default would always have emitted it as ``true`` and failed that contract. * ``AgentConfig.isSynthesize()`` — manual getter treating ``null`` as ``true`` so existing compiler call sites read the right default. * ``MultiAgentCompiler`` — restore the ``isSynthesize()`` guards at all three sites (handoff at ~390, router at ~981, swarm at ~1271) so ``synthesize=false`` skips the ``_final`` task and routes ``${workflow.variables.conversation}`` directly to the workflow's ``result`` output instead of the missing ``_final.output.result``. * ``./gradlew test`` (server) → 570 / 570 pass. * ``./gradlew test -Pe2e --tests Suite16Synthesize`` (sdk/java) → 4 / 4 pass against PR #238 server.
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
Cherry-picks the relevant slice of PR #238's commit
6fb791a4to unblockjava-e2e > Suite16Synthesize > test_handoff_default_has_final_taskon main.What's wrong on main
AgentConfig.synthesizeis a primitivebooleanwith@Builder.Default = true. Lombok generates a getter that always returns a value, and Jackson with@JsonInclude(NON_NULL)can't omit a primitive — so the field always serializes:even when the caller never set it.
Suite16Synthesize.test_handoff_default_has_final_task(Suite16Synthesize.java:89) asserts:→ fails on every run.
Fix
Change the field to
private Boolean synthesize;(nullable, no@Builder.Default) and add an explicitisSynthesize()that treatsnullastrue.@JsonInclude(NON_NULL)now keeps the field out of serialized output when callers leave it unset; explicitsynthesize=falsestill round-trips throughagentDef.All three
MultiAgentCompilercall sites already consumeconfig.isSynthesize()— behavior preserved.Test plan
./gradlew test(server) → BUILD SUCCESSFUL../gradlew test -Pe2e(sdk/java) on a server jar built from this branch → 178 / 178 pass (was 177 / 178 withSuite16Synthesize.test_handoff_default_has_final_taskfailing).Same fix has been on PR #238 since
6fb791a4; pulling it forward here so main's java-e2e gate is green now, rather than waiting for the bigger PAC/PAE branch to land.