[PR #7631] [MERGED] fix(avatars): Make 3D model uses the shared Cancel and background cleanup; Tripo docs under Get a 3D model #7846

Closed
opened 2026-10-24 04:08:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7631
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/tripo-vrm-shared-cancel


📝 Commits (4)

  • 8b5e235 feat(avatars): VRM models use the shared Cancel and cutout from #7623, and the Tripo docs sit under Get a 3D model (#7620)
  • b0e59f9 Merge remote-tracking branch 'origin/staging' into fix/tripo-vrm-shared-cancel
  • 08e18ac refactor(avatars): define the VRM model job like the mesh job, so the diff stays small
  • da8a521 test(avatars): clear the keep-alive intervals even when an assertion fails

📊 Changes

7 files changed (+113 additions, -63 deletions)

View changed files

📝 docs/agents/avatars.md (+28 -26)
📝 e2e/avatar-vrm-generation.e2e.ts (+8 -0)
📝 packages/client/src/features/avatars/generation/use-avatar-generation.ts (+13 -11)
📝 packages/server/src/routes/avatar-generation.routes.ts (+4 -2)
📝 packages/server/src/services/avatars/generation/tripo-vrm.ts (+13 -16)
📝 scripts/regressions/avatar-generation-cancel.regression.ts (+4 -1)
📝 scripts/regressions/avatar-vrm-generation.regression.ts (+43 -7)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No linked issue: requested by the maintainer on 2026-10-14 (follow-up to #7622, which merged before this commit was pushed).

Why this change

  • #7622 (Make 3D model with Tripo) was built before #7623 (Cancel on the server, shared background cleanup) and #7620 (the "Get a 3D model" guide) landed. All three are on staging now, so the Tripo maker should use what they added.
  • Without the shared Cancel, a proxy between the browser and the server could keep a cancelled Tripo run polling on the server.
  • The Tripo docs also belong under the guide's Get a 3D model, where people look for ways to get a model.

What changed

  • Cancel in Make 3D model also posts to POST /api/avatar-generation/cancel with kind: "vrm", as the PNGTuber and mesh makers do. The VRM job runs on withAvatarGenerationJob's signal, so either a closed stream or that request stops it waiting for Tripo. As before, a Tripo task that already started may still finish and use its credits; the setup already says so.
  • The cancel route takes "vrm". In avatar-generation-cancel.regression.ts, the example of a refused kind was "vrm", which is now a real job kind. It is now "live2d", so the test still proves that unknown kinds are refused. A new check proves that "vrm" is answered ({ cancelled: false } when nothing is running).
  • The sprite goes through avatarCutout, the avatars' shared background cleanup from #7623. It uses the configured remover and the built-in cleaner as a fallback. Before, the maker called the flat-background cleaner directly.
  • The VRM job is defined like the mesh job (const job = …; return withAvatarGenerationJob(…, job, options.signal)), so the diff stays small.
  • Docs: Make a 3D model with Tripo is now a subsection of Get a 3D model in docs/agents/avatars.md. The section's first paragraph points to it. "With a flat background removed" now reads "with its background removed", because the cleanup is the shared one.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run by the agent (results):

  • node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-: 16/16 passed. avatar-vrm-generation now also covers two cases:
    • Cancel through cancelAvatarGenerationJob(owner, "vrm") stops a run while it waits for Tripo. No more polling happens after that, and the avatar is free again.
    • The route answers /cancel with kind: "vrm".
  • Playwright on desktop-chromium, mobile-chromium and mobile-webkit:
    • avatar-vrm-generation and avatar-generation: 12 passed. The VRM e2e now checks that Cancel sends { owner, kind: "vrm" } to the server.
    • Earlier on this commit, before the job refactor: avatar-setup, avatar-2d and avatar-generation plus avatar-vrm-generation, 57 passed.
  • pnpm check: passed (exit 0).
  • Local CodeRabbit:
    • First pass: 1 finding (clear the keep-alive intervals in finally). Fixed.
    • A separate local review of #7622's last commit (9f8d11463), which merged while GitHub's CodeRabbit review was still in progress: 0 findings.

Manual verification notes

  • Manually verify behind a reverse proxy, if you use one: start Make 3D model, press Cancel, and check in the server log (debug mode) that the Tripo task polls stop.
  • Manually verify that a sprite with a solid background still gives a clean model. The cleanup now uses the same remover as the 2D avatars.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/agents/avatars.md changed: the Tripo section moved under Get a 3D model. #7624 already covers translating it; I updated that issue to say where the section now is.

UI evidence (if applicable)

None: nothing visible changes.

Summary by CodeRabbit

  • Bug Fixes

    • Stopping a Tripo 3D model generation now cancels the active job, and starting another generation waits for the cancellation to complete.
    • Tripo model generation now applies image cleanup to both transparent and nontransparent source sprites.
  • Documentation

    • Updated the avatar guide with Tripo setup steps, credit costs, model limitations, cancellation and failure guidance, data handling, and usage terms.

🔄 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-Engine/pull/7631 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/tripo-vrm-shared-cancel` --- ### 📝 Commits (4) - [`8b5e235`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b5e235b14d86b4d68f09ae1084d5593d80548cb) feat(avatars): VRM models use the shared Cancel and cutout from #7623, and the Tripo docs sit under Get a 3D model (#7620) - [`b0e59f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b0e59f93fdcbcc52c53cdc4b8ef06d3d42a94e8a) Merge remote-tracking branch 'origin/staging' into fix/tripo-vrm-shared-cancel - [`08e18ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/08e18ac5825660c9c9b8c74fd661413f6288b4d7) refactor(avatars): define the VRM model job like the mesh job, so the diff stays small - [`da8a521`](https://github.com/Pasta-Devs/Marinara-Engine/commit/da8a5211cb3c5313e426deb399add6962ac69b34) test(avatars): clear the keep-alive intervals even when an assertion fails ### 📊 Changes **7 files changed** (+113 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+28 -26) 📝 `e2e/avatar-vrm-generation.e2e.ts` (+8 -0) 📝 `packages/client/src/features/avatars/generation/use-avatar-generation.ts` (+13 -11) 📝 `packages/server/src/routes/avatar-generation.routes.ts` (+4 -2) 📝 `packages/server/src/services/avatars/generation/tripo-vrm.ts` (+13 -16) 📝 `scripts/regressions/avatar-generation-cancel.regression.ts` (+4 -1) 📝 `scripts/regressions/avatar-vrm-generation.regression.ts` (+43 -7) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No linked issue: requested by the maintainer on 2026-10-14 (follow-up to #7622, which merged before this commit was pushed). ## Why this change - #7622 (Make 3D model with Tripo) was built before #7623 (Cancel on the server, shared background cleanup) and #7620 (the "Get a 3D model" guide) landed. All three are on `staging` now, so the Tripo maker should use what they added. - Without the shared Cancel, a proxy between the browser and the server could keep a cancelled Tripo run polling on the server. - The Tripo docs also belong under the guide's **Get a 3D model**, where people look for ways to get a model. ## What changed - **Cancel** in **Make 3D model** also posts to `POST /api/avatar-generation/cancel` with `kind: "vrm"`, as the PNGTuber and mesh makers do. The VRM job runs on `withAvatarGenerationJob`'s signal, so either a closed stream or that request stops it waiting for Tripo. As before, a Tripo task that already started may still finish and use its credits; the setup already says so. - The cancel route takes `"vrm"`. In `avatar-generation-cancel.regression.ts`, the example of a refused kind was `"vrm"`, which is now a real job kind. It is now `"live2d"`, so the test still proves that unknown kinds are refused. A new check proves that `"vrm"` is answered (`{ cancelled: false }` when nothing is running). - The sprite goes through `avatarCutout`, the avatars' shared background cleanup from #7623. It uses the configured remover and the built-in cleaner as a fallback. Before, the maker called the flat-background cleaner directly. - The VRM job is defined like the mesh job (`const job = …; return withAvatarGenerationJob(…, job, options.signal)`), so the diff stays small. - Docs: **Make a 3D model with Tripo** is now a subsection of **Get a 3D model** in `docs/agents/avatars.md`. The section's first paragraph points to it. "With a flat background removed" now reads "with its background removed", because the cleanup is the shared one. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run by the agent (results): - `node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-`: 16/16 passed. `avatar-vrm-generation` now also covers two cases: - Cancel through `cancelAvatarGenerationJob(owner, "vrm")` stops a run while it waits for Tripo. No more polling happens after that, and the avatar is free again. - The route answers `/cancel` with `kind: "vrm"`. - Playwright on desktop-chromium, mobile-chromium and mobile-webkit: - `avatar-vrm-generation` and `avatar-generation`: 12 passed. The VRM e2e now checks that Cancel sends `{ owner, kind: "vrm" }` to the server. - Earlier on this commit, before the job refactor: `avatar-setup`, `avatar-2d` and `avatar-generation` plus `avatar-vrm-generation`, 57 passed. - `pnpm check`: passed (exit 0). - Local CodeRabbit: - First pass: 1 finding (clear the keep-alive intervals in `finally`). Fixed. - A separate local review of #7622's last commit (`9f8d11463`), which merged while GitHub's CodeRabbit review was still in progress: 0 findings. ### Manual verification notes - Manually verify behind a reverse proxy, if you use one: start **Make 3D model**, press **Cancel**, and check in the server log (debug mode) that the Tripo task polls stop. - Manually verify that a sprite with a solid background still gives a clean model. The cleanup now uses the same remover as the 2D avatars. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/agents/avatars.md` changed: the Tripo section moved under **Get a 3D model**. #7624 already covers translating it; I updated that issue to say where the section now is. ## UI evidence (if applicable) None: nothing visible changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Stopping a Tripo 3D model generation now cancels the active job, and starting another generation waits for the cancellation to complete. * Tripo model generation now applies image cleanup to both transparent and nontransparent source sprites. * **Documentation** * Updated the avatar guide with Tripo setup steps, credit costs, model limitations, cancellation and failure guidance, data handling, and usage terms. <!-- 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-24 04:08:05 +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-Engine#7846
No description provided.