mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Register custom BiRefNet-matting ONNX session in install_feature.py so
rembg.new_session("birefnet-matting") no longer raises ValueError during
on-demand installs. The session was already registered in remove_bg.py
(runtime) and download_models.py (build-time) but was missed in the
install path, causing background-removal bundle installs to always fail.
Send JSON body on install/uninstall POST requests to avoid Fastify 5's
strict content-type parser rejecting body-less POSTs with 415.
Fix error message extraction to preserve structured {"error": ...} JSON
from the Python script and filter out pthread_setaffinity_np noise.
This commit is contained in:
@@ -1966,7 +1966,7 @@ describe("useFeaturesStore", () => {
|
||||
|
||||
await useFeaturesStore.getState().uninstallBundle("ai-rembg");
|
||||
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/uninstall");
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/uninstall", {});
|
||||
});
|
||||
|
||||
it("uninstallBundle sets error on failure", async () => {
|
||||
@@ -2207,8 +2207,8 @@ describe("useFeaturesStore", () => {
|
||||
|
||||
await useFeaturesStore.getState().reinstallBundle("ai-rembg");
|
||||
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/uninstall");
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/install");
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/uninstall", {});
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/install", {});
|
||||
});
|
||||
|
||||
// -- EventSource progress handling ----------------------------------------
|
||||
@@ -2452,7 +2452,7 @@ describe("useFeaturesStore", () => {
|
||||
expect(useFeaturesStore.getState().installAllActive).toBe(false);
|
||||
expect(useFeaturesStore.getState().queued).toEqual([]);
|
||||
// Only not-installed bundle should have been installed
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/install");
|
||||
expect(mockApiPost).toHaveBeenCalledWith("/v1/admin/features/ai-rembg/install", {});
|
||||
});
|
||||
|
||||
it("installAll skips bundles that are already installed", async () => {
|
||||
|
||||
Reference in New Issue
Block a user