Go to file
Lucio Lelii 653184eeae fix: recover from empty-plan JSON and default missing required config fields
Two robustness fixes found by testing the assistant live with the default
planning model (qwen3:14b), which produced a trivial single-block flow.

1. Empty-plan recovery. A reasoning model under Ollama's format=json can
   return a degenerate "{}" (it cannot emit its <think> block under the JSON
   grammar). invokeStructuredProvider accepted "{}" as a valid structured
   response, so the plan came back empty and validateAndNormalizePlan applied
   its single-LLMBlock fallback - masking the failure as a trivial flow. A
   degenerate JSON body ("{}", "[]", "") is now treated like a blank response
   and falls through to the non-json generate call, where such models emit the
   real content (parsed by the balanced-brace extractor). The single-block
   fallback stays as a genuine last resort. Fixes the trivial-flow symptom for
   reasoning planning models without a config change.

2. Missing required text field. When the model omits a required free-text
   config field (observed: MCPAgentChatBlockConfiguration.goalDescription),
   deserialization failed with a hard 502. buildBlock now fills any required,
   non-enum, non-structural string field the model left blank with a default
   derived from the block's purpose (ensureRequiredTextDefaults), so an
   omission degrades to a sensible default instead of a 502.

Tests: draftRecoversRealPlanWhenJsonModeReturnsEmptyObject (generateJson
returns "{}", generate returns the real 2-block plan -> flow has 2 blocks, not
the fallback); draftDefaultsMissingRequiredTextFieldInsteadOf502 (MCPAgentChat
with no goalDescription -> valid, goalDescription defaulted to the purpose).
Full assistant suite green; only the known Loop-container timing flake fails
under full-suite load (passes in isolation).
2026-08-03 11:05:58 +02:00
.mvn/wrapper upgrade to springboot 4 2026-05-05 19:22:53 +02:00
src fix: recover from empty-plan JSON and default missing required config fields 2026-08-03 11:05:58 +02:00
.gitattributes first commit 2025-03-27 11:38:06 +01:00
.gitignore Improve assistant model routing and diagnostics 2026-05-20 12:27:09 +02:00
Dockerfile Update Dockerfile for Java 25 2026-04-17 14:11:02 +02:00
mvnw first commit 2025-03-27 11:38:06 +01:00
mvnw.cmd first commit 2025-03-27 11:38:06 +01:00
ollama-preloaded-docker image for test with ollama added 2025-09-29 17:00:57 +02:00
pom.xml fix: add missing Flyway autoconfiguration and shorten an overlong flow description 2026-07-22 15:24:51 +02:00