Skip to content

Release/v0.5.0 - #469

Merged
lightningpixel merged 157 commits into
mainfrom
release/v0.5.0
Nov 18, 2026
Merged

lightningpixel merged 157 commits into
mainfrom
release/v0.5.0

Conversation

@lightningpixel

Copy link
Copy Markdown
Owner

No description provided.

securitybrahh and others added 30 commits September 8, 2026 02:16
…r alone

Port the CancelEndedJobTests from #341 onto the _job_generators binding
introduced in 10cdc15. Ended jobs/runs are driven through _run_generation
so the test covers the binding being released, then cancelled via
/generate/cancel and /workflow-runs/{id}/cancel; running jobs/runs bound in
_job_generators must still have their worker stopped.
Confirmed by combined CI regression. Remove only an empty target with rmdir; never remove source on copy failure.
agent_chat now returns a StreamingResponse emitting token, thinking,
tool_start, tool_done and done events. ChatPanel consumes the stream so
text appears progressively and tool calls show an in-progress state.

Closes #300
feat(agent): stream chat responses as typed SSE events
…ine Repair

has_nvidia_gpu() only checked that nvidia-smi was on PATH. A leftover
nvidia-smi.exe with no NVIDIA driver/GPU behind it (e.g. an AMD machine) got
the CUDA llama.cpp build, and llama-server fell back to CPU. It now requires
`nvidia-smi -L` to succeed and list a GPU; the result is cached since
/llm/status calls it on every poll.

Machines that already received the wrong build had no way back: the UI only
offers "Install engine" while the engine is missing. Settings > Agent now has
an Engine > Repair action (GET /llm/binary/install?repair=true) that
re-detects the GPU, downloads and extracts the new build into a staging dir,
then swaps it in place of bin/. The working engine is only touched once the
new one is fully extracted, so a failed download keeps it intact.

Fixes #386
- test_auto_orient_does_not_flip_a_mesh_over: trimesh's update_faces keeps
  the cut-away vertices, so the exported bowl still carried the whole
  sphere's vertices and the "center" was measured on the orphan top cap.
  Drop unreferenced vertices; auto_orient itself was correct.
- test_mesh_ops_run_without_undeclared_networkx runs repair_mesh, which
  needs pymeshlab: skip it when pymeshlab is missing, like the other
  repair/inspection tests.
fix(llm): pick CUDA only when an NVIDIA GPU actually answers, add engine Repair
switch_model unloads the previous model on every switch. When you run
TripoSG and then Trellis2 Texture Mesh on the same object, both models get
reloaded for every single asset, which cost me 20-27 s per switch on a
3090 Ti.

This keeps the two loaded side by side. Any other switch, and the LLM
eviction, works exactly as before.

Two assets (cart + soldier, 3000 faces, warm): 197 s -> 110 s.
`dev serve-api` / `dev ensure-server --start` ignored dependenciesDir from
settings.json. If the dependencies live on another drive (mine are on F:),
the venv isn't found and it falls back to whatever Python runs the CLI,
which doesn't have the backend deps.

It now checks dependenciesDir first, and passes the env vars the Electron
bridge sets: PYTHONIOENCODING=utf-8, MODLY_LLM_DIR (agentDir) and
MODLY_NODE_EXECUTABLE (Modly.exe) for the installed app.

Added two tests; the existing ones still pass.
… pair on VRAM

switch_model only unloaded the previous active model. After
TripoSG -> Trellis2 refine -> any other model, TripoSG was no longer
active but stayed loaded beside the new model until unload_all.
switch_model now unloads every loaded model except the target and its
resident partners.

Keeping both models resident also assumed a card with room for both
(~10-11 GB peak). Each pair now declares a minimum total VRAM; below it,
or when no NVIDIA GPU answers, switching behaves as before. The pair is
set to 19.5 GiB (24 GB cards), the configuration the speedup was
measured on. Manifests can't size this: TripoSG declares no vram_gb.
…-resident

Keep TripoSG and the texture model loaded together
… the desktop bridge

The started API inherited PYTHONHOME, PYTHONPATH, VIRTUAL_ENV, CONDA_PREFIX
and the PIP_* variables of whatever shell ran the CLI. From a conda env or
an activated venv, these point Modly's venv interpreter at foreign
site-packages, or keep it from starting at all. They are now removed, the
same list Electron's cleanPythonEnv() strips.

_default_python also tried the api's dev .venv before the app's venv,
the reverse of the PythonBridge. The app's venv (dependenciesDir, then the
default dependencies folder) now comes first, the dev .venv second.
modly-cli: start the API with the same setup as the desktop app
…rors

- Copy into a unique sibling staging folder, then rename onto the verified-empty
  destination; a failed copy is discarded so the source stays intact and a
  retry does not hit "Destination must be empty".
- Drop the post-copy re-validation: it re-ran a pure check on the same inputs.
- Windows: accept a top-level folder on a data drive (D:\Models) and refuse the
  well-known system folders instead; POSIX keeps the two-level minimum.
- Path API follows options.platform everywhere, including the symlink check.
- Return the guard's message over IPC and show it in the move/delete modal.
- Tests: resolve tmpdir() through realpath (macOS /var symlink), run the
  junction test on Windows, cover empty existing destinations and failed copies.
fix(storage): guard recursive deletion and relocation (refs #351)
cancel_job killed the subprocess of whatever generator the job was bound
to. An unpinned /generate job runs on the default executor beside the
pinned worker and binds the same active generator, so cancelling it also
killed the other job's inference. The kill now only happens when no other
live job is bound to that generator; otherwise the cancel event stops it.

Cancelling a job that already ended is now a no-op: it no longer marks the
job cancelled nor sets its event, and returns {"cancelled": false}.

Tests: cover two live jobs sharing one worker through real _run_generation
calls, assert the late-cancel state, drop the cancel_run duplicates, reuse
_FakeRegistry, and keep the expected failure traceback out of the output.
…rker

test(generation): guard that cancelling an ended job leaves the worker alone
A mesh op declared with an `agent` spec (AgentTool) becomes a chat tool,
with no change to agent.py: schema, system prompt entry and execution
through POST /optimize/op/{id} are all derived from the registry.

- Expose inspect_mesh, suggest_fixes, repair_mesh, decimate and smooth.
- decimate_mesh/smooth_mesh are renamed to their registry ids.
- Transforms stay behind the hand-written arrange_mesh (ordered steps).
- Result formatters move to mesh_ops/agent_format.py.

Closes #301
…-registry

Feat/301 agent tools from registry
…c error

When FastAPI died during startup the user only saw "FastAPI process exited
unexpectedly during startup"; the real cause stayed in the log. Now:

- the end of Python's stderr is shown (traceback, missing module, ...);
- a taken port 8765 is detected from uvicorn's errno (the text is in the OS
  language) and the message names the program holding it, e.g. Docker;
- a port reserved by Windows (WinError 10013, Hyper-V/WinNAT range) explains
  how to free it;
- a failed spawn (missing exe, antivirus) is reported right away instead of
  crashing the main process or waiting for the 90 s timeout.

The exit handler also no longer clears a newer process after a restart.

Refs #167
Modly could not start at all when another program (Docker, another app)
held port 8765, and it killed whatever process listened there.

- The bridge picks the port at each start: 8765 if free; an old Modly
  backend on it (recognised by /health) is stopped and the port reused;
  anything else is left alone and the backend takes 8766..8785, then any
  port the OS gives. A restart keeps the current port.
- The port no longer has a fixed value: Electron callers use apiBaseUrl(),
  the API gets MODLY_API_URL (agent router, extensions), and the renderer
  CSP allows any 127.0.0.1 port.
- The port is written to <userData>/api-port while the backend runs; the MCP
  server and modly-cli read it (MODLY_API_URL still wins, 8765 otherwise).
- /health now also returns "service": "modly".

Refs #167
fix(startup): say why the backend failed to start
feat(startup): move the backend to a free port when 8765 is taken
A user picked a drive root as models folder, then changed it again: the
"N models" popup listed their own folders, and "Delete models" removed the
whole drive (#351). The guard on dev already refuses drive roots, but any
other folder (E:\Photos, Documents...) chosen as storage was still deleted
whole.

Modly now tells its entries from the rest:
- a folder it created carries .modly-storage (written when the folder is
  new or empty, and at a move destination), or is the <base>/<kind> folder
  first-run setup makes beside <base>/extensions: all of it is Modly's;
- in any other models folder, only sub-folders named after an installed or
  built-in extension are (never links);
- anything else is never moved or deleted, and the folder itself is removed
  only once it is empty.

The popup lists only Modly's entries (none: no popup) and says how many
other items stay. Choosing a drive root, system folder or an ancestor of
home / app data as storage is refused up front, and settings:set enforces it.

Refs #351
…fety

fix(storage): only move or delete what Modly created
lightningpixel and others added 29 commits November 17, 2026 18:32
The Print page asks the backend how the slicer hand-off would size the
model (GET /export/print-scale) and shows it at exactly that size, so
the plate and OrcaSlicer never disagree: about 50 mm for unit-sized AI
output, its real size once calibrated. The fit check uses the same
size, and a "Provisional size" banner says how to set a real one.
An imported 30 mm STL is now 0.03 m, a speck under the default camera,
and a model of several metres swallowed it. When the model's longest
side leaves the 0.25-10 range, Generate's viewer scales its camera,
clipping planes, zoom limits and grid to it; generated, unit-sized
meshes keep the default view and the user's camera.
…rter

The Mesh Exporter node reads the real-scale marker of its input GLB and,
for a calibrated asset, writes STL, OBJ and PLY in millimetres, like the
API's exports and the slicer hand-off. GLB output and uncalibrated
assets are unchanged.
feat(image-studio): crop, auto-frame and model preview (T-M3)
feat(print): real-world scale and Print page (T-H1, T-N1)
The Queue button sits next to Agent and shows how many runs are running or
waiting. It opens a panel under it with the running, queued and finished runs;
while closed it only polls the newest runs, for the count.
The page code stays in src/areas/print, to be registered again later.
feat(queue): Queue as a top bar panel, Print page out of the sidebar
While Modly ran, any web page open in the browser could call the whole local
API. The backend now refuses requests from web pages (Origin, or a cross-site
Sec-Fetch-Site) unless their origin is in MODLY_ORIGINS, and refuses Host names
that are not localhost, an IP or in MODLY_HOSTS (DNS rebinding). Scripts, CLIs,
the MCP server, OrcaSlicer and extensions send neither header and need no token.

The packaged window's file:// pages send Origin: null, like a sandboxed iframe
on any site, so Electron adds X-Modly-App with a per-launch secret to the
window's API requests; the backend gets it by env and drops it from os.environ.
… Referer

Those tags send no Origin, so a site in MODLY_ORIGINS could not show a file
served by Modly. The guard now goes by the Referer's origin when there is no
Origin; a page can leave it out but not forge it. Browsers drop it from HTTPS
pages to the HTTP API, so the README points those to crossorigin="anonymous".
feat(security): keep web pages off the local API (MODLY_ORIGINS)
http.client returns b"" when a server closes the stream early instead of
raising, so _download_file_streamed renamed a short .part file into place
and the model looked installed while its weights could never load (#389).

Downloads now check the received size against the size Hugging Face lists
for the file (one list_repo_tree call per repo) or the response length, and
resume from the .part file when it falls short. An existing file whose size
does not match is fetched again instead of being skipped.

For models already broken on disk, a load that fails on a truncated
safetensors header or torch archive now reports a short message pointing to
the Models page instead of the raw traceback.
Exporting a textured mesh to OBJ wrote the .obj alone, so the texture was
lost. Like Blender, the user now picks <name>.obj and <name>.mtl and
<name>_texture.png are written beside it; untextured meshes export as
before.

- API: GET /export/obj/files answers the OBJ export as its separate files;
  the Generate page saves OBJ through the main process, which writes them
  side by side.
- Mesh Exporter node: writes the .mtl and the base color texture too, and
  flips V from glTF's top-left UV origin to OBJ's bottom-left one.
- A hint under OBJ says textures go to separate files and GLB keeps
  everything in one.
fix(models): never treat a truncated weight download as complete
fix(export): write the material and texture next to OBJ exports
Image Studio: tool icons and an interactive crop
Generate: play with a 3D Modly logo while a mesh generates
@lightningpixel
lightningpixel merged commit ac9baa5 into main Nov 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants