Skip to content

AI Staging: JSON decoding error 'Failed to decode action envelope' with starter prompt #5

Description

@aixxo

When using AI Staging with the starter prompt, the app fails with the following error:

Failed to decode action envelope: DecodingError.dataCorrupted: Data was corrupted. Debug description: The given data was not valid JSON.. Underlying error: Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character 's' after top-level value around line 1, column 5." UserInfo={NSJSONSerializationErrorIndex=4, NSDebugDescription=Unexpected character 's' after top-level value around line 1, column 5.}

Steps to reproduce:

  1. Open BetterStage
  2. Go to AI Staging
  3. Use the default/starter prompt
  4. Trigger the action

Observed behavior:
The action envelope returned by the model fails JSON decoding — the underlying NSJSONSerializationErrorIndex=4 / "Unexpected character 's' after top-level value around line 1, column 5" suggests the AI response is not valid JSON (e.g. it may contain a stray non-JSON token such as the start of a second value or trailing text right after the first JSON value ends).

Expected behavior:
AI Staging should either produce valid JSON reliably, or handle/report malformed model output gracefully instead of erroring out on the raw decode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions