Commit Graph
20603 Commits
Author SHA1 Message Date
SoftFever b3dcf0ac7d Ask before a plugin calls OrcaSlicer's tools
Any plugin could call OrcaSlicer's tools through orca.host.tools without a permission, so it could change your project, run post-processing scripts and answer permission prompts. It now needs the OrcaSlicer tools permission or full access, which it can declare as it loads or is asked for the first time it calls, like its other permissions. The Plugins dialog's Permissions tab has a switch for it, and turning it off ends what the plugin's calls left in force.
2026-11-26 02:56:29 +08:00
SoftFever 6609ca0503 Make calls say whether they ask, and show Prepare after an agent's new project
Calls into the plater, object list and tabs now say in words whether they ask a
person or run without prompts, instead of passing bare true/false flags. An
agent's project_new now does what New Project does: it shows the Prepare tab and
tells plugins about the new project.
2026-11-26 01:04:13 +08:00
SoftFever 529752ad0c Make the MCP server doc an architecture overview
The server doc walked through every command, repeating what the tool reference and each command's own description already say. It now covers the components, how they fit together and the design rules every command follows, and points to the tool reference for what each command does. Caller-facing facts that only the server doc held are now in the tool reference.
2026-11-25 22:23:41 +08:00
SoftFever f047c606d9 List long widget labels whole and keep each MCP fact in one place
widget_list cut a widget's label at 120 bytes, so a long path or tooltip came back truncated, and a test that
read it back failed on a machine with a longer folder; labels now come back whole. Adding or renaming a command
or a sweep test no longer means updating hand-kept lists, copied test helpers or the same text in several docs,
and the runner's own test now fails when a sweep test has no entry in the index.
2026-11-25 19:10:57 +08:00
SoftFever 9b57301b9e Fix the Speed Dial and other web pages sometimes freezing on Windows
Opening the Speed Dial occasionally left it, the Home page and every other
web page in OrcaSlicer unresponsive, with one CPU core kept busy, until the
app was restarted. The Flushing volumes dialog and the printer camera view
no longer risk the same freeze. The Speed Dial's search field still takes
the keyboard focus on every open, and the Flushing volumes dialog still
falls back to English text when a translation cannot be shown.
2026-11-25 17:12:13 +08:00
SoftFever e4538b5262 Name the Design commands by their place, like the other MCP tools
Thirty-four Design commands were bare verbs (extrude, fillet, measure), so an
agent could not tell from a name where a command acts or find a place's
commands together. Every Design command now starts with its place: design_,
sketch_, solid_, surface_, construct_, body_ or feature_. Replacing objects when
committing a design to the plate deletes them as Prepare's Delete does, and the
guide to making a feature reachable covers Design commands.
2026-11-25 13:38:40 +08:00
SoftFever 18eb4f8459 Organize the MCP tool code by place and the Design commands by heading
Each place an agent finds commands under (Objects, Plates, View and windows and so on) now has one source file
under Mcp/Tools/, and the Design tab's commands have one file per Design heading, so a developer finds a command
where tool_list lists it and adds a new one beside its neighbours. A unit test fails when a command is added in
another place's file. No change to what agents or people see: the command catalog is byte-identical.
2026-11-24 23:50:10 +08:00
SoftFever 6a601166e4 Report a dialog closed when an answer ends it on a busy machine
On a busy machine, dialog_answer could reply without closed: true for a dialog its answer ended, such as a web
dialog cancelled while its page was still busy, although the dialog closed a moment later. An agent was then told
the dialog was still open. The reply now says closed for every dialog an answer ends, message boxes included,
however busy the app is.
2026-11-24 23:27:16 +08:00
SoftFever 7cfbda4c62 Stop the Speed Dial offering settings of extruders the printer lacks
After a printer with several extruders, selecting one with fewer left the extra extruders' settings in the Speed
Dial and the settings search, such as Retraction Length under Extruder 3 on a single-extruder printer. They now
list only the extruders the selected printer has.
2026-11-24 23:27:16 +08:00
SoftFever b4408536f1 Fix sweep tests failing with a current_path error in a shared app
When the test that launched a job's app passed, the sweep deleted that test's folder while the app was still
running in it. Later tests in that app then failed on the first preset reload with "boost::filesystem::current_path:
No such file or directory", as test_printers, test_settings and test_speed_dial_open did. The job's app now runs in
a folder of the job's own.

The settings reads now place a printer's extruder settings on its Extruder page on every printer. After a printer
with several extruders, they could put a setting on a page such as "Extruder 3" that the selected printer does not
have, and leave it out of the page it is on, which made test_presets fail when it ran after test_printers.

The sweep can also run every app on a private Xvfb display with --xvfb, for a machine without a desktop, and with
--headless or --xvfb the tests that start their own apps stay off the desktop too. Where Openbox is installed, Xvfb
runs it as the window manager, so drop-down lists and popups stay open as on a desktop and the whole sweep passes
there. Apps launched side by side each get a display of their own, and test_slice_preview no longer fails where the
3D view draws slowly, as on Xvfb.

A test that fails beside the others and then passes alone no longer runs alone in every later sweep: each sweep
runs it among the others again, so a failure that returns is seen, and --forget, which undid that, is gone. Only
the tests sweep.json marks exclusive run alone from the start.
2026-11-24 23:27:15 +08:00
SoftFever 5eefef82fc Add the Agent Activity pane
A new pane, opened from View > Agent Activity or the Speed Dial, lists live what an AI agent and other
automation (Action Replay, Run Script, the command line, plugins) do in OrcaSlicer while it is open: each
call with its source, what it changed, failures with their reason, the steps of a run and the dialogs a
rule answered. Opening a call shows its request and response with passwords, keys and typed text masked,
so a person can watch and check what an agent is doing to their project.
2026-11-24 16:38:50 +08:00
SoftFever eae8929b41 Warn in Action Replay when a step replaces a post-processing script
A replay could swap one of your post-processing scripts for its own by
setting a single entry of the list, and the step showed no warning. It now
carries the "Can run a program" tag, as setting the whole list does.
2026-11-24 14:24:47 +08:00
SoftFever bff0641b28 Stop a calibration when its save prompt is cancelled
Choosing Cancel when a calibration asked to save the open project still
created the calibration on top of that project, so the project's pauses and
color changes ended up in the calibration's G-code. Only the flow rate tests
stopped. Cancel leaves the project as it was for every calibration.
2026-11-24 02:34:07 +08:00
SoftFever 2b52191901 Warn in Action Replay when a step can run a program
A replay someone sends you can hold a Python script or set a post-processing
script, and either runs a program on your computer when the replay plays. The
window listed those steps with no warning. They carry a "Can run a program"
tag, as a step that writes a file or sends to a printer carries its own, and a
step that makes its call through tool_call shows the tags of that call.
2026-11-24 02:34:07 +08:00
SoftFever efc29fdb80 Give a polygon drawn on the axes the same constraints on every platform
A square drawn on the axes through sketch_draw was locked level on x64 but could be
left free to rotate on arm64, so its constraints and degrees of freedom depended on
the CPU, and the test of them failed on macOS arm64 and Windows arm64. A polygon's
side that lies on an axis is now pinned Horizontal or Vertical on every platform, as
the Polygon tool pins it, so such a square has all four sides pinned.
2026-11-23 20:02:09 +08:00
SoftFever 82d1f6adfa Fix the CI failures from the first build and test run of the MCP branch
The Flatpak build failed to compile the MCP bridge, clang-tidy flagged four missing
includes, and several new tests failed only on CI: plugin and script tests on Windows
runners with a non-UTF-8 code page, and two tests that raced on slower machines.
2026-11-23 19:10:16 +08:00
SoftFever df459143cc Merge branch 'main' into feature/mcp 2026-11-23 13:29:29 +08:00
yw4z a31c95e273 Fix: custom G-codes and wipe tower for plate not moved after using move plate to front and undo (#17569)
Custom G-codes and wipe tower positions are stored by plate index, and reordering plates left them at the old index.

- Moving a plate reorders `wipe_tower_x` and `wipe_tower_y` with it.
- `PartPlateList::remap_custom_gcodes()` re-keys `plates_custom_gcodes` by plate ID after a plate move, a plate deletion and an undo/redo jump. Entries of a plate that an undo removes are kept and restored when the plate comes back.
- Undo/redo restores every changed wipe tower position instead of only the first.
2026-11-22 19:35:38 -06:00
Lam Wei Lun ec6e124658 Fix main window opening fullscreen instead of maximized on X11 (#17585)
Restore a maximized main window without resizing it on X11

Mutter/Muffin turn a client resize of an undecorated window to exactly the
monitor rect into a fullscreen window, so the main frame came up fullscreen
instead of maximized when the panel reserved no strut (#17191). On X11, skip
SetSize when the saved state is maximized and skip window_pos_sanitize for
maximized or fullscreen windows. Windows and macOS keep the resize, which
sets the normal size Restore Down returns to.

persist_window_geometry also ignored the window name and stored the non-modal
settings dialog under window_mainframe. Use the window's own name.
2026-11-22 18:14:35 -06:00
Arthur Porto 6d563f72c2 Keep arranged objects clear of a compacted prime tower (#17304)
With "No sparse layers" on, Arrange and Fill bed keep objects as far from the compacted prime tower as the slicer's clearance check needs. Objects stay the toolhead radius away, or 4 mm when none of the objects being placed is taller than nozzle_height. Objects taller than the rod clearance are also kept out of the tower's Y span, and the final alignment of the pile is skipped in that case. Placing a newly added object keeps the full toolhead radius.

With the option off, arranging is unchanged.

Fixes #17566
2026-11-22 16:43:49 -06:00
TheLegendTubaGuy f611c3b488 Fix "Line width too small" when the layer height equals the nozzle diameter (#17643)
Skin and skeleton line widths are only validated for Locked Zag regions, the only pattern that prints them. A bridge as wide as the layer is tall is accepted without thick bridges.

Flow::with_cross_section() gave a line shrunk into a round strand a quarter of the cross-section it asked for, using the radius as its diameter. This changes G-code for bridges, overhang walls and support bottom interfaces without thick bridges whenever the bridge flow ratio is low enough to shrink the line to the layer height.
2026-11-22 16:37:27 -06:00
SoftFever e6250eca57 Let MCP commands name objects, parts and instances by id
An agent that read an object's id in object_list could only pass it as a guard beside the index, and the index moves
whenever objects are deleted, split or reordered; an id passed as an index was refused without saying what it was.
Every command that names an object, a part or an instance now takes its index or its id, both together still a
guard, and object_list gives each instance's id too. An id given as an index is refused with what that id names, and
recorded replays keep naming targets by index, so they still run in a new session.
2026-11-23 00:06:23 +08:00
Valerii Bokhan 0a2cdfc1a3 Fix overhang speeds measured against a stale layer after skipped layers (#16861) 2026-11-22 11:41:01 -03:00
SoftFever 6122352058 Shorten the longest MCP tool descriptions
The ten largest definitions in the tool list repeated much of what their parameters already say. They now
say it once, taking about 4.9 KB off the tool list an agent reads at the start of every session, with
nothing they described left out.
2026-11-22 22:36:37 +08:00
SoftFever 3283fa0016 Mark names as code in the MCP tool descriptions
Agents can tell an argument or a reply field from an English word in every tool description. The
server instructions say what the Speed Dial is, a call held by a dialog says how to run it without
asking next time, and object_add_text and object_add_svg say what they reply.
2026-11-22 22:01:16 +08:00
SoftFever d3f57df99f Shrink the MCP tool list
Agents load less text before their first call: the object and part id guards are explained once
in the server instructions instead of in every schema that takes one, and each tool's title is
sent once.
2026-11-22 21:59:35 +08:00
SoftFever f9c0411c0c Keep MCP replies short and free of float noise
Agents now read an object's position as 60.001 rather than 60.001007080078125, and a Design
command's zero as 0 rather than 4.4e-16, without the wrapper and ok flag that said nothing; a
client that computes with the numbers can still ask for them whole. object_list gives a short row
per object unless asked for detail, so a plate of a hundred objects fits a client's reply limit,
and app_log returns 50 lines by default.
2026-11-22 21:57:47 +08:00
SoftFever bca0a9857f Say in the server instructions that values_from belongs to a parameter 2026-11-22 20:01:01 +08:00
SoftFever 8bb0196353 Tell agents which catalog filters are optional and that values_from may name several tools 2026-11-22 19:57:16 +08:00
SoftFever 122f106aee Tell agents in the server instructions how to find what to call
An agent connecting to the MCP server now reads, right after the workflow, how each catalog is found
by listing: commands place by place and the rest through tool_list, a command's manual before calling
it through tool_call, settings by page, Speed Dial actions by section and the Python API by module.
2026-11-22 19:52:06 +08:00
SoftFever a629d3590f Say where tool_describe keeps a schema part it cannot show 2026-11-22 19:48:47 +08:00
SoftFever 37e136acac Keep tool_describe from calling an object open when a plugin schema may close it
A plugin schema can close an object through a keyword the manual keeps raw, such as allOf. The manual
then no longer says the object, or the call, takes other keys, and leaves the attached schema to say
what it accepts.
2026-11-22 19:33:47 +08:00
SoftFever b1500e4aae Say in tool_describe's manuals which objects take keys they don't list
Every object in a manual now says whether it takes keys besides its properties, at any depth, as the top
level already did. A plugin schema whose properties can't be read now comes with the raw schema instead of
looking like one that takes no arguments.
2026-11-22 19:25:15 +08:00
SoftFever 5026ada896 Point tool_describe's manuals to more values' sources, and keep plugin rules
An agent reading a manual now learns where a filament's purge mode, a calibration's shaper type, a
hole's point, printer_install's models and dialog_answer's dialog come from, and sees that a plugin
operation can reach outside the app. What a plugin's schema says that the manual can't show, such as a
required argument with no property, now comes with the raw schema, and a schema that takes any argument
says so instead of looking like one that takes none.
2026-11-22 19:14:39 +08:00
SoftFever 918fc04533 Pass clang-tidy on the MCP list tools and drop the docs' last search wording 2026-11-22 18:38:33 +08:00
SoftFever 7f8af3beeb Browse settings by page with settings_list_pages, and read them by key
settings_get and preferences_get matched an agent's words, so a goal such as "add a brim" found the wrong
settings. Agents now list a settings tab's pages and groups with settings_list_pages, read a page's settings
and what each does with settings_list, and read named settings with settings_get and preferences by tab
with preferences_get.
2026-11-22 18:19:51 +08:00
SoftFever 3c6752abf9 Browse the Python API a module at a time with script_list_api and script_describe_api
script_search_api ranked the API by an agent's words, so a goal phrased in other words found the wrong entries.
Agents now list what a module or class holds with script_list_api and read one entry's whole documentation
with script_describe_api.
2026-11-22 18:08:23 +08:00
SoftFever ee42f3922c List the Speed Dial's actions with action_list, in place of action_search
action_search ranked actions by matching an agent's words, so an action named differently from the request
was missed. action_list lists them by section and title for the agent to choose from, as tool_list does
for commands.
2026-11-22 18:03:47 +08:00
SoftFever b85dbded55 List the commands tools/list leaves out with tool_list, in place of tool_search
tool_search matched words, so an agent that asked for a goal such as "add a brim" or "round the edges"
got unrelated commands. Agents now read tool_list, which lists the Design tab's commands, the menu items
that take no arguments and the plugins' operations with what each does, and a call refused for its
arguments names the tool_describe call that gives that command's parameters.
2026-11-22 17:56:09 +08:00
SoftFever 56d7f9e815 Give agents a manual for any MCP command with tool_describe
An agent could read a command's arguments only as raw JSON Schema, with its conditional rules left to decode and
no word on where an object index or a face id comes from. tool_describe now gives any command's manual, listed or
not: every parameter at every depth with its allowed values, ranges and defaults, the schema's rules as sentences,
the Speed Dial items that run it with their arguments, its examples, and which tool lists a value the schema can't.
2026-11-22 17:35:15 +08:00
SoftFever d51fb9f4ed Show what each command does when tool_search lists a group
Agents listing the Design tab's commands, or any other group, got bare names and had to look each one up to
choose. tool_search {group} now gives each command's first sentence and, in Design, its heading, in the order
the description's index uses. action_search names the Speed Dial's sections section rather than group, so they
are no longer mistaken for tool_search's groups, and a wrong section is refused with the sections there are
instead of returning nothing.
2026-11-22 14:50:46 +08:00
SoftFever 7db95f5c1e Say in a word why an MCP call was refused, and how to get past it
Design commands were refused with numbers such as -32002 or with no code at all; they now say design_busy,
precondition, invalid_argument, rebuild_failed and the like, so an agent can tell a wrong argument from a design
that is not ready, on every route that takes arguments. Refusals worded for a person, such as an open gizmo or a
selected object, carry a hint naming the call that gets past them, and an index too large for the app or written
as 2.0 is no longer misread as another object, plate or instance.
2026-11-22 13:36:38 +08:00
Alexander Vander Kelen a8a597c6d5 Fix LAN Bambu printer losing its connection when the cloud server connects (#17769)
The server-connected handler selects the agent's current machine again every time the cloud
server connects. For a LAN printer this makes the Bambu network plug-in unsubscribe the device,
which drops the LAN session that selecting the printer opened. A connect still in flight fails
with "called UnSubscribeDevice". One that already succeeded stays down with no connect result, so
the printer shows as connected while every command fails with -4 and Print fails with -4030.

Since #17086, OrcaSlicer connects the last LAN Bambu printer at startup, so a LAN user hits this
on most starts. A cloud reconnect later in a session drops the session the same way.

The selection is a cloud subscription, so a LAN printer does not need it. Move the re-select into
DeviceManager::reselect_cloud_machine(), which skips a LAN-mode printer and behaves as before for
any other machine.

Fixes #17766
2026-11-21 13:01:33 -06:00
rblumen f2eb53ebaa Keep the cloud login dialog on screen and make it resizable (#17721)
The Orca Cloud and Bambu Cloud login dialog had a fixed size of 650x840 DIP. At 150% scaling on a 1080p screen it was taller than the work area, so its title bar was off screen and it could not be moved or closed.

The size is now clamped to the work area of the display the main window is on, and after centering the dialog is moved to stay inside that area. The dialog is also resizable, and the webview fills it when it is resized.
2026-11-21 13:00:03 -06:00
SoftFever 15bb082ce2 Refuse misspelt Design arguments and tell agents how to fix refused calls
A misspelt argument to most Design commands was ignored, so the command ran with
its default, such as a helix built with the default pitch. Every Design command now
refuses it and names the arguments it takes. Refusals of a missing object or part,
an unknown setting key, an invalid setting value or a preset that is not installed
now say the valid range, the similar keys, what the setting takes or the command
to use, and plate_add and object_add_handy_model say what they added.
2026-11-22 01:28:26 +08:00
Kiss Lorand 5bf1571bb8 Fix Move gizmo crash when using Object coordinates with multiple instances (#17642)
Selecting several instances of one object with the Move gizmo in Object coordinates, by clicking them or with Ctrl+A, made get_selected_single_intance() index the instance list with -1 and crash. It now returns nullptr when the selection has no single instance, and the gizmo uses the first volume's instance transform instead.
2026-11-21 10:48:14 -06:00
Surfoo 97e2d0a6e6 Notebook: don't hide a page that is also the page being selected #17189 (#17739)
Prepare and Preview share one page window, the Plater. On every switch between them, wx hid that window and showed it again right away. On GNOME Wayland this unmapped and remapped the GL canvases and triggered a mutter subsurface bug, which left a frozen copy of the Prepare view at the top-left of the window (#17189). Notebook no longer hides the page that is being selected, and switches between other tabs are unchanged.
2026-11-21 10:05:50 -06:00
SoftFever fdf335472c Fix --run crashing at exit when a dialog is still open
A --run launch that ended with a dialog open, such as the prompt to restore an unsaved project left by an
earlier session, crashed while closing and returned a crash code instead of the replay's result. It now
closes the dialog first and exits with the replay's code, and it no longer asks about or discards a
person's unsaved project, which their next normal launch still offers to restore.
2026-11-21 23:41:23 +08:00
SoftFever 3ba8743720 Write replay results to the temp folder unless an output folder is given
Replays that name no output folder, whether run from Action Replay, by an agent or with --run, left a
<name>.out folder beside the replay file or filled the data folder. They now write to a new
orca_action_replay/replay-<time> folder in the temp folder, or inside --outputdir when a --run launch names one.
2026-11-21 23:41:14 +08:00
Arthur Porto 4a45621b57 Start a Creality print from the path the printer lists the upload at (#17633)
Upload and Print picked the start command's folder from the model that /info reports, and every
unlisted model got /mnt/UDISK. A Nebula Pad reports the printer it is fitted to, such as
"Ender-3 V2 Neo", and keeps its G-code under /usr/data, so its firmware ignored the start.

Before the start, the host now asks the printer for its G-code file list (reqGcodeFile), as
Creality Print does, and starts the upload from the path listed for it. K1-family firmware answers
retGcodeFileInfo and K2-family firmware retGcodeFileInfo2. A list without the upload is asked for
again until files_reply passes. When the printer doesn't list the upload, the model table decides
as before, and it now includes "Ender-3 V2 Neo".
2026-11-21 09:31:18 -06:00