Orca pipeline
12 results today 24 agents on 1 worker Admin

Local AI agents triage open OrcaSlicer bug reports, try to reproduce them and draft fixes; a person reviews every result before anything goes upstream. An independent experiment, read only.

Queue / #17352

#17352Fixing · with vast-tw

Wrong behaviour for setting "Printer: chamber temperature control"

  • Agents took the fix 4 times.

Agent answer

Issue #17352 — reproduced on main (commit f939e2b1e, OrcaSlicer 2.6.0-dev)

What I did (CLI only, no GUI needed — the bug is in gcode generation)

Built a minimal case in repro/: a 25×25×10 mm cube STL, a machine preset json with "support_chamber_temp_control": "0" and a recognizable machine_start_gcode (;MACHINE_START_MARKER), and a filament preset json with "activate_chamber_temp_control": ["1"], "chamber_temperature": ["50"] (the exact state from the issue: capability switched off, filament checkbox hidden but still enabled). Then:

$ORCA_BIN --load-settings repro/machine.json --load-filaments repro/filament.json \
    --slice 0 --outputdir repro/out repro/cube.stl

(Preset jsons need "from": "user" or the CLI exits -5; extra keys use_relative_e_distances=0 / layer_gcode=G92 E0 just satisfy validation for a bare machine config.)

What I saw — the bug

In repro/out/plate_1.gcode:

  • line 25: M191 S50 ;set chamber_temperature and wait for it to be reached — written immediately before ;MACHINE_START_MARKER (machine_start_gcode), matching the issue's excerpt
  • line 8112: M141 S0;set chamber_temperature right after ;MACHINE_END_MARKER
  • the gcode's own config echo proves the printer capability was off during the slice:
    ; support_chamber_temp_control = 0 alongside ; activate_chamber_temp_control = 1 / ; chamber_temperature = 50

Controls (both behave correctly)

  • support_chamber_temp_control=1 + filament flag on → M191 emitted (expected).
  • support_chamber_temp_control=0 + filament flag off → no M191 (expected).

So only the mixed case is wrong: the hidden/stale filament flag alone still drives M191/M141, exactly as the reporter describes (the "only way to avoid it is to re-enable the printer checkbox, uncheck the filament one, then disable again" workaround).

Root cause

  • src/libslic3r/GCode.cpp:4022-4027: activate_chamber_temp_control / max_chamber_temp are computed solely from the per-extruder filament settings m_config.activate_chamber_temp_control / m_config.chamber_temperature.
  • src/libslic3r/GCode.cpp:4413-4416 writes m_writer.set_chamber_temperature(max, wait=true) → M191 S<n> before machine_start_gcode, and src/libslic3r/GCode.cpp:4915-4916 writes M141 S0 after machine_end_gcode — both gated only on that filament-derived flag (&& max_chamber_temp > 0).
  • src/libslic3r/GCodeWriter.cpp:400-422 produces the M191 text.
  • The printer option support_chamber_temp_control (defined in src/libslic3r/PrintConfig.cpp:4861) is never consulted in libslic3r/gcode generation; it is used only in the GUI to show/hide the filament checkbox (src/slic3r/GUI/Tab.cpp:5325, toggle_line(...)) and in src/slic3r/GUI/ConfigManipulation.cpp:247.

Suggested fix

Gate the two if (activate_chamber_temp_control && max_chamber_temp > 0) sites in GCode.cpp on m_config.support_chamber_temp_control as well — i.e. fold it into the flag at GCode.cpp:4022 (e.g. activate_chamber_temp_control = m_config.support_chamber_temp_control.value && ...), which matches the wiki's documented "both checkboxes required" semantics.

Repro script and artifacts: repro/run.sh, repro/NOTES.md, repro/machine*.json, repro/filament*.json, repro/gcode_excerpt_BUG_capability_off.txt.

Cause

G-code emission reads only the filament setting: src/libslic3r/GCode.cpp:4022-4027 computes activate_chamber_temp_control from m_config.activate_chamber_temp_control (per-extruder filament option), and M191/M141 are written at GCode.cpp:4413-4416 and GCode.cpp:4915-4916 based only on it (text from GCodeWriter::set_chamber_temperature, src/libslic3r/GCodeWriter.cpp:400-422). The printer capability support_chamber_temp_control is never checked in libslic3r — it is used only to hide the filament checkbox in the GUI (src/slic3r/GUI/Tab.cpp:5325).

Triage summary

With the printer option "support_chamber_temp_control" unchecked, slicing still emits M191 S before machine_start_gcode (and M141 S0 at the end) if the filament's "activate_chamber_temp_control" checkbox — which the GUI hides in that case — is still enabled. Reproduced via CLI on main.

Reproduction files (6)
file · NOTES.mdOpen in full
# Repro for issue #17352 — chamber temp M191 emitted although printer "support_chamber_temp_control" is off

Reproduced on main (commit f939e2b1e, OrcaSlicer 2.6.0-dev) using the CLI only — no GUI needed,
because the bug is in gcode emission, not in the GUI.

## Setup
- `repro/cube.stl` — plain 25x25x10 mm cube.
- `repro/machine.json` — machine preset json, `support_chamber_temp_control = 0`,
  with `machine_start_gcode` starting with `;MACHINE_START_MARKER` so we can see where the
  M191 lands relative to the user's machine start gcode. (`repro/machine_on.json` is the same
  with `support_chamber_temp_control = 1`.) Extra keys `use_relative_e_distances=0` and
  `layer_gcode=G92 E0` are only there to make validation pass with a bare-bones machine config.
- `repro/filament.json` — filament preset json with `activate_chamber_temp_control = 1`,
  `chamber_temperature = 50` (the state described in the issue: printer capability later
  switched off, leaving this checkbox hidden but still enabled). `repro/filament_off.json` is
  the same with `activate_chamber_temp_control = 0`.
- `repro/run.sh` — runs all three cases.

## Steps
    $ORCA_BIN --load-settings repro/machine.json --load-filaments repro/filament.json \
        --slice 0 --outputdir repro/out repro/cube.stl
    grep -n "M191\|M141" repro/out/plate_1.gcode

Note: the json presets must contain `"from": "user"`, otherwise the CLI exits with -5
("from unsupported").

## Result (bug)
`repro/out/plate_1.gcode` (printer capability OFF, filament flag ON):

    line 25:     M191 S50 ;set chamber_temperature and wait for it to be reached   <- right before machine_start_gcode
    line 26:     ;MACHINE_START_MARKER
    line 8112:   M141 S0;set chamber_temperature                                    <- after machine_end_gcode

and the config echo in the same file proves the capability flag was off during the slice:

    ; activate_chamber_temp_control = 1
    ; chamber_temperature = 50
    ; support_chamber_temp_control = 0

This matches the issue's excerpt exactly (M106 P2 wrappers appear only when `auxiliary_fan` is set; not needed for the M191 itself).

## Controls
- `support_chamber_temp_control=1` + filament on  -> M191 emitted (correct, `repro/out_on/`).
- `support_chamber_temp_control=0` + filament off -> no M191 (correct, `repro/out_off/`).

So the hidden/stale filament flag alone still drives M191/M141 output, exactly as reported.

## Cause (code)
- `src/libslic3r/GCode.cpp:4022-4027`: `activate_chamber_temp_control` / `max_chamber_temp`
  are computed only from the per-extruder filament settings `m_config.activate_chamber_temp_control`
  / `m_config.chamber_temperature`.
- `src/libslic3r/GCode.cpp:4413-4416` writes `set_chamber_temperature(max, wait=true)` -> `M191 S<n>`
  before machine_start_gcode, and `GCode.cpp:4915-4916` writes `M141 S0` at the end, both gated only
  on that filament-derived flag.
- `GCodeWriter::set_chamber_temperature` (`src/libslic3r/GCodeWriter.cpp:400-422`) emits the M191 text.
- The printer capability `support_chamber_temp_control` is referenced nowhere in libslic3r gcode
  generation; it is only used by the GUI to show/hide the filament checkbox
  (`src/slic3r/GUI/Tab.cpp:5325 toggle_line(...)`; also `src/slic3r/GUI/ConfigManipulation.cpp:247`).

## Expected fix direction
Gate the two `if (activate_chamber_temp_control && max_chamber_temp > 0)` sites on
`m_config.support_chamber_temp_control` as well (wiki documents M191 requires BOTH checkboxes).
file · run.shOpen in full
#!/bin/bash
# Reproduction for OrcaSlicer issue #17352: M191 chamber-temp control is emitted
# even though the printer option support_chamber_temp_control is disabled (the
# filament checkbox activate_chamber_temp_control is then hidden in the GUI but
# its stored value still drives the gcode).
#
# Run from the worktree root. Requires $ORCA_BIN.
set -x
cd "$(dirname "$0")/.."

# Case A (BUG): printer support_chamber_temp_control=0, filament activate_chamber_temp_control=1, chamber_temperature=50
# Expected: no M191 anywhere. Actual: "M191 S50" before machine_start_gcode, "M141 S0" at the end.
$ORCA_BIN --debug 1 --load-settings repro/machine.json --load-filaments repro/filament.json \
    --slice 0 --outputdir repro/out repro/cube.stl
grep -n "M191\|MACHINE_START_MARKER\|support_chamber_temp_control =\|activate_chamber_temp_control =" repro/out/plate_1.gcode

# Case B (control, capability on): support_chamber_temp_control=1 + filament on -> M191 present (correct)
$ORCA_BIN --debug 1 --load-settings repro/machine_on.json --load-filaments repro/filament.json \
    --slice 0 --outputdir repro/out_on repro/cube.stl
grep -c "M191" repro/out_on/plate_1.gcode

# Case C (control, filament off): support_chamber_temp_control=0 + filament off -> no M191 (correct)
$ORCA_BIN --debug 1 --load-settings repro/machine.json --load-filaments repro/filament_off.json \
    --slice 0 --outputdir repro/out_off repro/cube.stl
grep -c "M191" repro/out_off/plate_1.gcode
file · gcode_excerpt_BUG_capability_off.txtOpen in full
M201 X1000 Y1000 Z500 E5000
M203 X500 Y500 Z12 E120
M204 P1500 R1500 T1500
M205 X10.00 Y10.00 Z0.20 E2.50 ; sets the jerk limits, mm/sec
M190 S35 ; set bed temperature and wait for it to be reached
M104 S200 ; set nozzle temperature
;TYPE:Custom
M191 S50 ;set chamber_temperature and wait for it to be reached
;MACHINE_START_MARKER
G28
G90
G21
...
;MACHINE_END_MARKER
M84
M141 S0;set chamber_temperature
M73 P100 R0
...
; activate_chamber_temp_control = 1
; chamber_temperature = 50
; support_chamber_temp_control = 0
file · machine.jsonOpen in full
{
 "type": "machine",
 "from": "user",
 "name": "chamber test machine",
 "instantiation": "true",
 "support_chamber_temp_control": "0",
 "support_air_filtration": "0",
 "support_pause_printer": "0",
 "machine_start_gcode": ";MACHINE_START_MARKER\nG28\n",
 "machine_end_gcode": ";MACHINE_END_MARKER\nM84\n",
 "relative_extrusion": "0",
 "layer_gcode": "G92 E0\n",
 "use_relative_e_distances": "0"
}
file · filament.jsonOpen in full
{
    "type": "filament",
    "from": "user",
    "name": "chamber test",
    "instantiation": "true",
    "filament_type": ["PLA"],
    "filament_diameter": ["1.75"],
    "temperature": ["210"],
    "temperature_vitrification": ["60"],
    "hot_plate_temp": ["55"],
    "hot_plate_temp_initial_layer": ["60"],
    "filament_max_volumetric_speed": ["12"],
    "activate_chamber_temp_control": ["1"],
    "chamber_temperature": ["50"]
}
file · cube.stlOpen in full
solid cube
facet normal 0.000000 0.000000 -625.000000
 outer loop
  vertex 0.000000 0.000000 0.000000
  vertex 25.000000 25.000000 0.000000
  vertex 25.000000 0.000000 0.000000
 endloop
endfacet
facet normal 0.000000 0.000000 -625.000000
 outer loop
  vertex 0.000000 0.000000 0.000000
  vertex 0.000000 25.000000 0.000000
  vertex 25.000000 25.000000 0.000000
 endloop
endfacet
facet normal 0.000000 0.000000 625.000000
 outer loop
  vertex 0.000000 0.000000 10.000000
  vertex 25.000000 0.000000 10.000000
  vertex 25.000000 25.000000 10.000000
 endloop
endfacet
facet normal 0.000000 0.000000 625.000000
 outer loop
  vertex 0.000000 0.000000 10.000000
  vertex 25.000000 25.000000 10.000000
  vertex 0.000000 25.000000 10.000000
 endloop
endfacet
facet normal 0.000000 -250.000000 0.000000
 outer loop
  vertex 0.000000 0.000000 0.000000
  vertex 25.000000 0.000000 0.000000
  vertex 25.000000 0.000000 10.000000
 endloop
endfacet
facet normal 0.000000 -250.000000 0.000000
 outer loop
  vertex 0.000000 0.000000 0.000000
  vertex 25.000000 0.000000 10.000000
  vertex 0.000000 0.000000 10.000000
 endloop
endfacet
facet normal 250.000000 0.000000 0.000000
 outer loop
  vertex 25.000000 0.000000 0.000000
  vertex 25.000000 25.000000 0.000000
  vertex 25.000000 25.000000 10.000000
 endloop
endfacet
facet normal 250.000000 0.000000 0.000000
 outer loop
  vertex 25.000000 0.000000 0.000000
  vertex 25.000000 25.000000 10.000000
  vertex 25.000000 0.000000 10.000000
 endloop
endfacet
facet normal 0.000000 250.000000 0.000000
 outer loop
  vertex 25.000000 25.000000 0.000000
  vertex 0.000000 25.000000 0.000000
  vertex 0.000000 25.000000 10.000000
 endloop
endfacet
facet normal 0.000000 250.000000 0.000000
 outer loop
  vertex 25.000000 25.000000 0.000000
  vertex 0.000000 25.000000 10.000000
  vertex 25.000000 25.000000 10.000000
 endloop
endfacet
facet normal -250.000000 0.000000 0.000000
 outer loop
  vertex 0.000000 25.000000 0.000000
  vertex 0.000000 0.000000 0.000000
  vertex 0.000000 0.000000 10.000000
 endloop
endfacet
facet normal -250.000000 0.000000 0.000000
 outer loop
  vertex 0.000000 25.000000 0.000000
  vertex 0.000000 0.000000 10.000000
  vertex 0.000000 25.000000 10.000000
 endloop
endfacet
endsolid cube
Issue text on GitHub

Is this issue reproducible in the latest nightly build?

  • [x] I have checked the latest nightly build and the issue is still reproducible

Is there an existing issue for this problem?

  • [x] I have searched the existing issues

OrcaSlicer Version

2.5.0

Regression compared to a previous version

No response

Operating System (OS)

Windows

OS Version

Irrelevant

Additional system information

No response

Printer

Q1 Pro

How to reproduce

The wiki states (my highlight):

If your Filament's Activate temperature control and your printer Support control chamber temperature option are checked , OrcaSlicer will insert M191 command at the beginning of the gcode (before Machine G-code)

When I disable the checkbox in the printer settings, the checkbox in the filament settings disappears.
However, if was previously enabled, Orca will still insert the code!

The only way to skip the chamber temperature control BEFORE the custom machine gcode is:

  • enable the checkbox in the printer settings
  • disable the (now visible) checkbox in the filament settings
  • disable the checkbox in the printer settings (which, at this point, is useless)

It clearly is a bug because honouring a setting which doesn't get even shown is not a correct behaviour.

Actual results

The only way to avoid the temperature control commands sent before the custom machine gcode is to disable both checkboxes.

Expected results

Only both active should result in the gcode being inserted.

Project file & Debug log uploads

Printer: disabled temperature control, filament: HIDDEN checkbox, but previously temperature control was enabled

; EXECUTABLE_BLOCK_START
EXCLUDE_OBJECT_DEFINE NAME=Cube_id_0_copy_0 CENTER=122.5,122.5 POLYGON=[[110.25,110.25],[134.75,110.25],[134.75,134.75],[110.25,134.75],[110.25,110.25]]
M73 P0 R22
M106 S0
M106 P2 S0
;TYPE:Custom
M106 P2 S255
M191 S50 ;set chamber_temperature and wait for it to be reached
M106 P2 S0
SET_PRINT_STATS_INFO TOTAL_LAYER=123
PRINT_START BED=95 HOTEND=270 CHAMBER=50

Checklist of files to include

  • [ ] Log file
  • [ ] Project file

Anything else?

No response

Area
gcode
Platform
all
Author
dewi-ny-je
Comments
2
Created
2026-11-07
bug

Log

  1. vast-tw took it: fix
    vast-tw · 18 min ago
  2. Worker restarting; back in the queue
    vast-tw · 18 min ago
  3. vast-tw took it: fix
    vast-tw · 1 h ago
  4. Worker restarting; back in the queue
    vast-tw · 1 h ago
  5. vast-tw took it: fix
    vast-tw · 1 h ago
  6. vast-tw restarted; returned to the queue
    vast-tw · 1 h ago
  7. vast-tw took it: fix
    vast-tw · 1 h ago
  8. reproduce: reproduced
    vast-tw · 1 h ago
  9. vast-tw took it: reproduce
    vast-tw · 1 h ago
  10. triage: triaged
    vast-tw · 1 h ago
  11. vast-tw took it: triage
    vast-tw · 1 h ago
  12. Collected from GitHub
    panel · 3 h ago
vast-tw is fixing this issue, since 18 min ago.