From cc29e99ac161942cfe30a109a1e99c995f5818c3 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Fri, 27 Nov 2026 11:07:56 -0600 Subject: [PATCH 1/2] feat(native-sdk): LlmCall.messages(...) to send a conversation history llm() could only send one user message (prompt, as userInput), so workflow code had no way to give the model a multi-turn conversation. messages(...) sets the LLM_CHAT_COMPLETE input the server already accepts: a list of {role, message}, oldest first. With messages the server ignores userInput. Co-Authored-By: Claude Opus 5.5 --- .../org/conductoross/conductor/sdk/LlmCall.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/conductor-client/src/main/java/org/conductoross/conductor/sdk/LlmCall.java b/conductor-client/src/main/java/org/conductoross/conductor/sdk/LlmCall.java index da43364a8..4fe472632 100644 --- a/conductor-client/src/main/java/org/conductoross/conductor/sdk/LlmCall.java +++ b/conductor-client/src/main/java/org/conductoross/conductor/sdk/LlmCall.java @@ -13,10 +13,12 @@ package org.conductoross.conductor.sdk; import java.time.Duration; +import java.util.List; import org.conductoross.conductor.sdk.internal.Command; import org.conductoross.conductor.sdk.internal.Engine; import org.conductoross.conductor.sdk.internal.Entries; +import org.conductoross.conductor.sdk.internal.Json; /** A chat completion executed by the server (LLM_CHAT_COMPLETE). Models are {@code provider/model}. */ public final class LlmCall { @@ -64,6 +66,17 @@ public LlmCall prompt(String prompt) { return this; } + /** + * The conversation so far, oldest first: each message an object with {@code role} ({@code + * user}, {@code assistant} or {@code system}) and {@code message}, as the server's {@code + * ChatMessage}. With messages the server ignores {@link #prompt}: the last message is the one + * the model answers. + */ + public LlmCall messages(List messages) { + command.input.put("messages", Json.plain(messages)); + return this; + } + /** * Asks the model and returns its answer as {@code type}: a {@code String} for text, or a record * or class for a JSON answer, which the server then requires (an answer that is not JSON fails From bd74a8df13240c5ec84ef66db79673499fdffe13 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Fri, 27 Nov 2026 11:29:29 -0600 Subject: [PATCH 2/2] fix(native-sdk): name an awaitCondition WAIT "condition" whatever its ref The WAIT for awaitCondition took its numbered reference as its name (condition, condition_2, ...). The UI folds a Java loop's passes by call site, type and name, so in a loop each wait was drawn as a new step while the loop's other calls folded into one. It is now named "condition", as sleep() is "sleep" and as CodeReader names it; the reference is unchanged. Co-Authored-By: Claude Opus 5.5 --- .../org/conductoross/conductor/sdk/internal/Replayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conductor-client/src/main/java/org/conductoross/conductor/sdk/internal/Replayer.java b/conductor-client/src/main/java/org/conductoross/conductor/sdk/internal/Replayer.java index 6347fef89..8520b1c1f 100644 --- a/conductor-client/src/main/java/org/conductoross/conductor/sdk/internal/Replayer.java +++ b/conductor-client/src/main/java/org/conductoross/conductor/sdk/internal/Replayer.java @@ -1260,7 +1260,9 @@ public boolean awaitCondition(BooleanSupplier condition, Duration timeout) { if (mode != Mode.ACTIVE) { throw diverged("the code waits for a condition as " + ref + " but the recorded execution has no such wait"); } - Command wait = new Command(Command.Kind.WAIT, ref); + // named "condition" whatever its reference, as sleep is "sleep": the UI folds a Java + // loop's passes by call site and name, so a name numbered like the ref never repeats + Command wait = new Command(Command.Kind.WAIT, "condition"); wait.input.put("duration", Entries.duration(timeout)); emit(Entries.continuation(Entries.of(wait, ref, id), counter + 1)); pendingConditions.put(ref, condition);