Skip to content

Bug Report -- Copilot Studio / Custom Prompt Test -- Invalid JSON Error #421

@nurkmez2

Description

@nurkmez2

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

  1. Open Copilot Studio.

  2. Go to Tools → Prompts.

  3. Create a new Custom Prompt.

  4. Enter normal instructions (e.g., "Please summarize the given text in
    simple language...").

  5. Add one text input.

  6. Click Test.

  7. 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

Image Image Image

(Add your screenshots here.)


Additional context


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions