[GH-ISSUE #1324] Slurp: "Image prompt rewrite unusable" logged for usable answers and for AI budget skips #676

Closed
opened 2026-10-20 17:29:39 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Gunterlie on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1324

Originally assigned to: @Gunterlie on GitHub.

Report

A Slurp player reports that the Engine log shows [slurp] Image prompt rewrite unusable (...) again and again. The model answer looks valid to the player, apart from the ```json fence around it. The player does not knowingly use "Enhance image prompts".

Cause

Two faults in the "Enhance image prompts" rewrite path (packages/slurp2, slp-image-prompt-rewrite.ts and its three callers).

  1. Strict parser. The rewrite answer goes through a plain JSON.parse. The code fence is removed correctly, but an answer with a line break inside the prompt text, a trailing comma, or text around the object fails to parse. The result counts as "no prompt". Every other Slurp model call uses Engine's tolerant parseGameJsonish.
  2. A budget skip is logged as a failure. "Enhance image prompts" is on by default. When the AI budget mode is Off, the "Enhance image prompts" budget row is off, or its daily limit (60) is reached, the rewrite is skipped on purpose. The caller still treats the rewrite as attempted, logs the warning for each picture, and cuts the draft to 1,500 characters.

Expected

  • A usable rewrite answer is accepted. An answer that is cut off still falls back to the draft.
  • A budget skip behaves as with enhancing switched off: the full draft, no warning.

Not covered

  • An unescaped quotation mark inside the prompt text still fails to parse.
  • The player also reports other errors in the log. No log lines are available yet, so their cause is unknown. No recent Slurp release changed a prompt output schema.
Originally created by @Gunterlie on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1324 Originally assigned to: @Gunterlie on GitHub. ## Report A Slurp player reports that the Engine log shows `[slurp] Image prompt rewrite unusable (...)` again and again. The model answer looks valid to the player, apart from the ```` ```json ```` fence around it. The player does not knowingly use "Enhance image prompts". ## Cause Two faults in the "Enhance image prompts" rewrite path (`packages/slurp2`, `slp-image-prompt-rewrite.ts` and its three callers). 1. **Strict parser.** The rewrite answer goes through a plain `JSON.parse`. The code fence is removed correctly, but an answer with a line break inside the prompt text, a trailing comma, or text around the object fails to parse. The result counts as "no prompt". Every other Slurp model call uses Engine's tolerant `parseGameJsonish`. 2. **A budget skip is logged as a failure.** "Enhance image prompts" is on by default. When the AI budget mode is Off, the "Enhance image prompts" budget row is off, or its daily limit (60) is reached, the rewrite is skipped on purpose. The caller still treats the rewrite as attempted, logs the warning for each picture, and cuts the draft to 1,500 characters. ## Expected - A usable rewrite answer is accepted. An answer that is cut off still falls back to the draft. - A budget skip behaves as with enhancing switched off: the full draft, no warning. ## Not covered - An unescaped quotation mark inside the prompt text still fails to parse. - The player also reports other errors in the log. No log lines are available yet, so their cause is unknown. No recent Slurp release changed a prompt output schema.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#676
No description provided.