[PR #391] [MERGED] fix(slurp): name the reason when creator setup fails #948

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/391
Author: @Gunterlie
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @Gunterlie

Base: staging ← Head: cold-start-slurp


📝 Commits (4)

  • dd7e8a0 fix(slurp): name the reason when creator setup fails
  • 91d416c fix(slurp): name the empty model answer at every parse site
  • e9e22e4 build(slurp): release 1.0.5
  • 1df40eb fix(slurp): tie each setup reason to its creator

📊 Changes

22 files changed (+471 additions, -209 deletions)

View changed files

📝 artifacts/slurp-1.0.5.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v3/catalog.json (+8 -8)
📝 packages/slurp/client.js (+11 -11)
📝 packages/slurp/manifest.json (+5 -5)
📝 packages/slurp/server.mjs (+149 -149)
📝 packages/slurp/src/engine/packages/client/src/components/slurp/SlurpOnboardingPanel.tsx (+54 -9)
📝 packages/slurp/src/engine/packages/client/src/hooks/use-slurp.ts (+1 -0)
📝 packages/slurp/src/engine/packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/slurp/src/engine/packages/server/src/routes/slurp.routes.ts (+34 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-ambient-profile-generation.service.ts (+4 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-fan-activity.service.ts (+4 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-generation.service.ts (+2 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-invited-post-draft.service.ts (+2 -1)
➕ packages/slurp/src/engine/packages/server/src/services/slurp/slurp-model-answer.ts (+15 -0)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-public-profiles.service.ts (+2 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-reply-generation.service.ts (+2 -1)
📝 packages/slurp/src/engine/packages/server/src/services/slurp/slurp-stage-profile-draft.service.ts (+8 -2)
📝 scripts/build-feature-packages.mjs (+1 -1)

...and 2 more files

📄 Description

Pull request

TL;DR — Slurp's onboarding wizard could fail with no explanation and no retry. Empty model answers now fail with a readable message at every Slurp parse site, every bulk skip and failure carries a reason, and the completion screen shows those reasons plus a working retry. Ships as slurp 1.0.5.

Linked issue

Closes #390

Why this change

A user hit "0 creators joined, but 2 could not finish setting up or writing a first post" with nothing actionable on screen. Three separate defects stacked up:

  • An empty provider answer reached JSON.parse("") and surfaced as SyntaxError: Unexpected end of JSON input, which names neither the cause nor a fix.
  • The bulk-create route recorded which accounts were skipped or failed, but never why, so the wizard could only show a count.
  • A run that created nothing was reported through the shared failed state, whose copy blames first-post generation — even though no generation ran. The retry button is bound to generation outcomes, so it never rendered, despite the copy promising it.

What changed

Package slurp, source under packages/slurp/src/engine:

  • slurp-model-answer.ts (new) — one requireModelAnswer(content, what) guard that rejects an empty model answer with a message naming the failing work and the fix.
  • Seven parse sites now use it — stage profile draft, creator post, creator reply, fan activity, Ambient profiles, public profiles, invited post draft.
  • slurp-stage-profile-draft.service.ts — the repair retry no longer echoes an empty assistant turn, which several providers reject. That is why both attempts failed identically in the reported log.
  • slurp.routes.ts — noteReason on every skip and failure path in POST /noodler/accounts/bulk; the response gains reasons: string[], deduplicated. Skips get plain text ("Already a Slurp creator from an earlier run", "The source character or persona no longer exists in Noodle", the leak-guard rejection, the write failure); failures carry the real error message.
  • SlurpOnboardingPanel.tsx — new local creationFailed completion state, so a run that created nothing is reported as a setup failure; the reasons render as a list under the detail text in any completion state; retry is offered for setup failures; the failure count falls back to the selected count when the request itself is lost.
  • use-slurp.ts, locales/en.json — response type and two new keys.
  • tests/slurp-onboarding-failure-reasons.regression.ts (new) — exercises the guard for real, and walks services/slurp so a newly added parse site fails the suite until it is guarded.
  • scripts/build-feature-packages.mjs — Slurp version 1.0.4 → 1.0.5.
  • Generated: client.js, server.mjs, manifest.json, artifacts/slurp-1.0.5.zip (replacing 1.0.4), and all three catalog lanes.

Package and security impact

  • Affected package IDs: slurp (1.0.4 → 1.0.5)
  • Engine compatibility impact: none. Minimum stays v2.4.3, below v4.0.0; lane routing unchanged.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: none. No schema or stored-settings change.
  • Reason strings are server-side English and may include provider error text. They surface only in the onboarding wizard, in the same place the caught error message already appeared. Localizations for de/ko/pl are absent, matching every other wizard key today.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated, all passing against the final 1.0.5 build:

  • npm run test:noodle:regressions, including the new regression
  • node scripts/validate-catalog.mjs
  • node scripts/test-catalog-lanes.mjs
  • node scripts/validate-package-locales.mjs

The new regression calls requireModelAnswer directly: three empty inputs throw with the expected message, a valid answer passes through unchanged. It then asserts that the set of files in services/slurp containing a parseGameJsonish( call matches its covered list, and that each call routes through the guard.

Not performed, and deliberately left unticked above: the package was not installed or updated through a running Engine, and the empty-response path was not exercised against a live provider. The change was built and validated from source only.

Bundle note: the payload was rebuilt against a staging Engine checkout. An earlier rebuild against a different local Engine checkout produced a ~64 KB smaller client.js because that checkout carries a different React copy in node_modules; that build was discarded.

Documentation impact

  • No documentation changes needed

Follow-up, not in this PR

The real root cause is one level down, in Engine's parseGameJsonish, where the final fallback rethrows the raw parse error. One guard there would cover all seven Slurp callers and every Engine caller. That file is not package-owned, so it needs an Engine PR; slurp-model-answer.ts carries a comment recording the duplication and the upgrade path.

Summary by CodeRabbit

  • New Features

    • Slurp onboarding now distinguishes account-creation failures and displays specific server-provided reasons.
    • Added retry support and clearer failure details, including affected creator counts.
    • Bulk account creation now reports deduplicated reasons for skipped and failed accounts.
  • Bug Fixes

    • Improved handling of empty or malformed generated responses across profile, post, reply, and activity generation.
    • Prevented empty assistant messages during retry flows.
    • Updated Slurp package metadata to version 1.0.5.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/391 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/16/2026 **Status:** ✅ Merged **Merged:** 8/16/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `cold-start-slurp` --- ### 📝 Commits (4) - [`dd7e8a0`](https://github.com/Pasta-Devs/Marinara-Agents/commit/dd7e8a0bdd58ab6361087ea9ceb468e86a480ccb) fix(slurp): name the reason when creator setup fails - [`91d416c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/91d416c9003fdd58fcc41cf0ff06c8e22ede59b0) fix(slurp): name the empty model answer at every parse site - [`e9e22e4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e9e22e460094639b65253b852c92b0684a770335) build(slurp): release 1.0.5 - [`1df40eb`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1df40eb82d4ca35938b435ff64250ebf601ef8e1) fix(slurp): tie each setup reason to its creator ### 📊 Changes **22 files changed** (+471 additions, -209 deletions) <details> <summary>View changed files</summary> 📝 `artifacts/slurp-1.0.5.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `packages/slurp/client.js` (+11 -11) 📝 `packages/slurp/manifest.json` (+5 -5) 📝 `packages/slurp/server.mjs` (+149 -149) 📝 `packages/slurp/src/engine/packages/client/src/components/slurp/SlurpOnboardingPanel.tsx` (+54 -9) 📝 `packages/slurp/src/engine/packages/client/src/hooks/use-slurp.ts` (+1 -0) 📝 `packages/slurp/src/engine/packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/slurp/src/engine/packages/server/src/routes/slurp.routes.ts` (+34 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-ambient-profile-generation.service.ts` (+4 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-fan-activity.service.ts` (+4 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-generation.service.ts` (+2 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-invited-post-draft.service.ts` (+2 -1) ➕ `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-model-answer.ts` (+15 -0) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-public-profiles.service.ts` (+2 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-reply-generation.service.ts` (+2 -1) 📝 `packages/slurp/src/engine/packages/server/src/services/slurp/slurp-stage-profile-draft.service.ts` (+8 -2) 📝 `scripts/build-feature-packages.mjs` (+1 -1) _...and 2 more files_ </details> ### 📄 Description # Pull request **TL;DR** — Slurp's onboarding wizard could fail with no explanation and no retry. Empty model answers now fail with a readable message at every Slurp parse site, every bulk skip and failure carries a reason, and the completion screen shows those reasons plus a working retry. Ships as `slurp` 1.0.5. ## Linked issue Closes #390 ## Why this change A user hit "0 creators joined, but 2 could not finish setting up or writing a first post" with nothing actionable on screen. Three separate defects stacked up: - An empty provider answer reached `JSON.parse("")` and surfaced as `SyntaxError: Unexpected end of JSON input`, which names neither the cause nor a fix. - The bulk-create route recorded which accounts were skipped or failed, but never why, so the wizard could only show a count. - A run that created nothing was reported through the shared `failed` state, whose copy blames first-post generation — even though no generation ran. The retry button is bound to generation outcomes, so it never rendered, despite the copy promising it. ## What changed Package `slurp`, source under `packages/slurp/src/engine`: - **`slurp-model-answer.ts`** (new) — one `requireModelAnswer(content, what)` guard that rejects an empty model answer with a message naming the failing work and the fix. - **Seven parse sites now use it** — stage profile draft, creator post, creator reply, fan activity, Ambient profiles, public profiles, invited post draft. - **`slurp-stage-profile-draft.service.ts`** — the repair retry no longer echoes an empty assistant turn, which several providers reject. That is why both attempts failed identically in the reported log. - **`slurp.routes.ts`** — `noteReason` on every skip and failure path in `POST /noodler/accounts/bulk`; the response gains `reasons: string[]`, deduplicated. Skips get plain text ("Already a Slurp creator from an earlier run", "The source character or persona no longer exists in Noodle", the leak-guard rejection, the write failure); failures carry the real error message. - **`SlurpOnboardingPanel.tsx`** — new local `creationFailed` completion state, so a run that created nothing is reported as a setup failure; the reasons render as a list under the detail text in any completion state; retry is offered for setup failures; the failure count falls back to the selected count when the request itself is lost. - **`use-slurp.ts`**, **`locales/en.json`** — response type and two new keys. - **`tests/slurp-onboarding-failure-reasons.regression.ts`** (new) — exercises the guard for real, and walks `services/slurp` so a newly added parse site fails the suite until it is guarded. - **`scripts/build-feature-packages.mjs`** — Slurp version 1.0.4 → 1.0.5. - Generated: `client.js`, `server.mjs`, `manifest.json`, `artifacts/slurp-1.0.5.zip` (replacing 1.0.4), and all three catalog lanes. ## Package and security impact - Affected package IDs: `slurp` (1.0.4 → 1.0.5) - Engine compatibility impact: none. Minimum stays v2.4.3, below v4.0.0; lane routing unchanged. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: none. No schema or stored-settings change. - Reason strings are server-side English and may include provider error text. They surface only in the onboarding wizard, in the same place the caught error message already appeared. Localizations for de/ko/pl are absent, matching every other wizard key today. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated, all passing against the final 1.0.5 build: - `npm run test:noodle:regressions`, including the new regression - `node scripts/validate-catalog.mjs` - `node scripts/test-catalog-lanes.mjs` - `node scripts/validate-package-locales.mjs` The new regression calls `requireModelAnswer` directly: three empty inputs throw with the expected message, a valid answer passes through unchanged. It then asserts that the set of files in `services/slurp` containing a `parseGameJsonish(` call matches its covered list, and that each call routes through the guard. Not performed, and deliberately left unticked above: the package was not installed or updated through a running Engine, and the empty-response path was not exercised against a live provider. The change was built and validated from source only. Bundle note: the payload was rebuilt against a staging Engine checkout. An earlier rebuild against a different local Engine checkout produced a ~64 KB smaller `client.js` because that checkout carries a different React copy in `node_modules`; that build was discarded. ## Documentation impact - [x] No documentation changes needed ## Follow-up, not in this PR The real root cause is one level down, in Engine's `parseGameJsonish`, where the final fallback rethrows the raw parse error. One guard there would cover all seven Slurp callers and every Engine caller. That file is not package-owned, so it needs an Engine PR; `slurp-model-answer.ts` carries a comment recording the duplication and the upgrade path. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Slurp onboarding now distinguishes account-creation failures and displays specific server-provided reasons. - Added retry support and clearer failure details, including affected creator counts. - Bulk account creation now reports deduplicated reasons for skipped and failed accounts. - **Bug Fixes** - Improved handling of empty or malformed generated responses across profile, post, reply, and activity generation. - Prevented empty assistant messages during retry flows. - Updated Slurp package metadata to version 1.0.5. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:32:35 +07:00
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#948
No description provided.