I am testing the Vaadin Copilot AI feature on Windows 11 with Vaadin Flow and asking it to execute the following command:
Create an empty LocationView class with one button on the screen named 'Test'.
And in response, I get an error:
Error parsing JSON: Unable to write file - JSON chunk that failed
Details:
2025-04-02T02:17:19.100+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Parsed JSON: StreamResponse[status=VALIDATION, message=Validation finished, exception=, changes={}, code=1]
2025-04-02T02:17:19.757+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Parsed JSON: StreamResponse[status=PRE_PROCESS, message=Flow Source modified, exception=, changes={}, code=2]
2025-04-02T02:17:20.478+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Parsed JSON: StreamResponse[status=EMBEDDING_CONTEXT, message=Embedding context retrieval finished, exception=, changes={}, code=2]
2025-04-02T02:17:22.617+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Parsed JSON: StreamResponse[status=AI_CALL, message=AI call finished, exception=, changes={}, code=2]
2025-04-02T02:17:22.618+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Parsed JSON: StreamResponse[status=POST_PROCESS, message=Post-process finished, exception=, changes={src\main\java\ai\example\base\ui\view\LocationView.java=package ai.example.base.ui.view;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
@Route("location")
public class LocationView extends VerticalLayout {
public LocationView() {
Button testButton = new Button("Test");
add(testButton);
}
}
}, code=2]
2025-04-02T02:17:22.619+03:00 INFO 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : PostProcess finished
2025-04-02T02:17:22.620+03:00 ERROR 32644 --- [ctor-http-nio-7] com.vaadin.copilot.ai.AICommandHandler : Error parsing JSON: Unable to write file (src\main\java\ai\example\base\ui\view\LocationView.java) with data from copilot server response - JSON chunk that failed: {"status":"POST_PROCESS","message":"Post-process finished","exception":"","changes":{"src\\main\\java\\ai\\example\\base\\ui\\view\\LocationView.java":"package ai.example.base.ui.view;\n\nimport com.vaadin.flow.component.button.Button;\nimport com.vaadin.flow.component.orderedlayout.VerticalLayout;\nimport com.vaadin.flow.router.Route;\n\n@Route(\"location\")\npublic class LocationView extends VerticalLayout {\n\n public LocationView() {\n Button testButton = new Button(\"Test\");\n add(testButton);\n }\n}\n"},"code":2}
What am I doing wrong, and what could be the reason for this?