From f8cb6bd5acd98f6b6ce93879b027e2afdc237ecc Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Sat, 26 Sep 2026 17:09:38 +0200 Subject: [PATCH] Drop "Use default" beside a choice between alternatives Where a file comes from (INPUT or GLOBAL) and where an MCP server comes from (CATALOG or CUSTOM) are two options to pick between, not a value to go back to. A new row still starts on INPUT or CATALOG, and blank still reads as it; only the button goes. It stays on the model parameters, where clearing a knob really does hand it back to the model's own default. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../configurations/MCPAgentBlockConfiguration.java | 6 ++---- .../configurations/MCPAgentChatBlockConfiguration.java | 6 ++---- .../manager/blocks/configurations/UploadInput.java | 8 +++----- .../blocks/configurations/LLMBlockSchemaTest.java | 10 ++++++++++ .../manager/controllers/BlocksControllerTest.java | 7 ++++--- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/MCPAgentBlockConfiguration.java b/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/MCPAgentBlockConfiguration.java index d11114f..c82476f 100644 --- a/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/MCPAgentBlockConfiguration.java +++ b/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/MCPAgentBlockConfiguration.java @@ -18,7 +18,6 @@ import it.cnr.isti.workflow.manager.configurations.annotations.DynamicSchema; import it.cnr.isti.workflow.manager.configurations.annotations.AcceptsVariablePlaceholder; import it.cnr.isti.workflow.manager.configurations.annotations.ConfigurableAsInput; import it.cnr.isti.workflow.manager.configurations.annotations.UiContextKeys; -import it.cnr.isti.workflow.manager.configurations.annotations.DefaultsWhenEmpty; import it.cnr.isti.workflow.manager.configurations.annotations.SchemaAllowedValues; import it.cnr.isti.workflow.manager.configurations.annotations.UiEnabledWhen; import it.cnr.isti.workflow.manager.configurations.annotations.UiOptionalGroup; @@ -158,10 +157,9 @@ public class MCPAgentBlockConfiguration extends BlockConfiguration !name.equals("type")).toList()); } + + @Test + void whereAFileComesFromIsAChoiceNotADefaultToGoBackTo() { + JsonNode schema = schemaProducer.generateSchemaNode(LLMBlockConfiguration.class); + + JsonNode source = schema.get("definitions").get("UploadInput").get("properties").get("source"); + + assertEquals("INPUT", source.get("default").asText(), "a new row starts on INPUT"); + assertEquals(false, source.has("x-ui-defaults-when-empty"), "no Use default beside a choice of two"); + } } diff --git a/src/test/java/it/cnr/isti/workflow/manager/controllers/BlocksControllerTest.java b/src/test/java/it/cnr/isti/workflow/manager/controllers/BlocksControllerTest.java index aade55e..6a7f083 100644 --- a/src/test/java/it/cnr/isti/workflow/manager/controllers/BlocksControllerTest.java +++ b/src/test/java/it/cnr/isti/workflow/manager/controllers/BlocksControllerTest.java @@ -611,9 +611,9 @@ public class BlocksControllerTest { assertEquals(UiContextKeys.FLOW_ID, sharedSessionRef.path("x-retriever-depends-on").get(0).asText()); - // The binding's sourceType has a default in Java (effectiveSourceType(): blank means - // CATALOG) and now declares it, so the editor can say which default an empty field is - // using instead of only that it is using one. + // A new binding starts on CATALOG (effectiveSourceType(): blank means CATALOG too). It is + // one of two alternatives, not a default to go back to, so the editor offers no "Use + // default" beside it. // The binding is a nested record, so it lives in the definitions and mcpServers.items is a // $ref to it - the same shape the other nested-record assertions in this class walk. JsonNode definitions = schema.has("definitions") ? schema.path("definitions") : schema.path("$defs"); @@ -622,6 +622,7 @@ public class BlocksControllerTest { assertEquals("CATALOG", sourceType.path("default").asText()); assertEquals("CATALOG", sourceType.path("enum").get(0).asText()); assertEquals("CUSTOM", sourceType.path("enum").get(1).asText()); + assertFalse(sourceType.has("x-ui-defaults-when-empty")); assertTrue(sharedSessionRef.path("x-retriever-requires-auth").asBoolean()); }