-
Notifications
You must be signed in to change notification settings - Fork 435
Description
Bug Report -- Copilot Studio / Custom Prompt Test -- Invalid JSON Error
What tool are you using?
Copilot Studio -- Tools → Prompts (Custom Prompt) test environment.
Describe the bug
When testing a Custom Prompt inside Copilot Studio, the test window
always throws the following error:
Unexpected token 'D', "Die mit diesem Prozess verbundene Prozessaktion..." is not valid JSON
This happens even though:
- The output type is set to Text
- The prompt does not contain JSON
- The input is plain text
- The model is expected to return normal natural-language text, not
JSON
Because of this, the Custom Prompt test environment becomes
unusable, since every test attempt fails with a JSON parsing error.
To Reproduce
-
Open Copilot Studio.
-
Go to Tools → Prompts.
-
Create a new Custom Prompt.
-
Enter normal instructions (e.g., "Please summarize the given text in
simple language..."). -
Add one text input.
-
Click Test.
-
The test response shows the error:
Unexpected token 'D' ... is not valid JSON
Expected behavior
The Custom Prompt tester should:
- Allow plain text responses from the model\
- Only validate JSON when the output mode is explicitly set to
JSON - Not parse the model response as JSON when the output mode is
Text
Actual behavior
The tester appears to force JSON validation on every model output.
When the model responds with a normal sentence such as:
Die mit diesem Prozess verbundene Prozessaktion "QuickTest" ist nicht aktiviert.
the UI tries to parse this as JSON and fails, producing:
Unexpected token 'D' is not valid JSON
This indicates that the response is being treated as JSON even though
the output type is configured as Text.
Screenshots
(Add your screenshots here.)
Additional context
-
The behavior is very similar to the issue described here:
[The same issue ]( https://community.powerplatform.com/forums/thread/details/?threadid=64469956-8482-f011-b4cc-7c1e52488a63) -
It looks like the Custom Prompt tester attempts to interpret every
response as JSON, regardless of the selected output format.
Suspected root cause
The testing tool likely performs automatic JSON parsing before rendering
the response.
When the response begins with plain text (for example, the German
sentence above), the JSON parser throws an error because the response is
not valid JSON.
This parsing step should be skipped when:
- Output type = Text