Repository navigation
Give the KAOS bridge the same E-mode treatment, and keep it current - #124
Merged
Merged
Conversation
Verifying the alpha update on the dev printer turned up something the AddOn.cfg fix cannot reach: KAOS declares [gcode_macro PHROZEN_TOOLCHANGE] a second time in kaos-ams-bridge.cfg, and a later declaration wins per option. So on a printer with KAOS on, the macro that actually runs is this one -- and it had the defect twice over. The AMS branch was WORSE than the kit's. Its own comment says M83 goes first to close "the kit's standing G1 E-1 before M83 latent defect on this path", and it does -- but it never hands the mode back. A slicer running absolute E would have every extrusion after the first tool change reinterpreted as relative, for the rest of the print. That is a bigger fault than the one it fixes. Confirmed by grep: exactly one M83 in the whole bridge and nothing anywhere that restores the mode -- not ORCA_PURGE, not PRZ_SPITTING_END. The no-AMS branch had the original defect untouched, and its comment says why: "byte-identical to stock". It was, when it was written. The kit has since fixed that line, so the copy was stale and the claim no longer true. Both branches now read the mode once at the top and hand it back, the same shape as the kit macro. Rendered against Klipper's own jinja2 in all four combinations of ams and entry mode: absolute gives M83 then the retract then M82, relative gives M83 and the retract, and the retract is present in every case. AND IT HAD TO SURVIVE KAOS_ON / KAOS_OFF. Our bridge configs are copied into printer_data/config when KAOS is ACTIVATED and never again. $SELF_DIR/config is inside the kit clone, so a kit update refreshes the source and leaves the copies -- a printer that has had KAOS on since before an update keeps running the old ones. The same "the correction never reaches the printer" shape as the rest of this week. So the guard, which already reconciles the spit patch on every klipper start, now refreshes our bridge configs too. Keyed on the include line actually present in printer.cfg, exactly like sync_spit_patch: a file whose include is gone is never put back, so KAOS_OFF stays off. KAOS's own files come from the upstream cache and are not touched. Measured against a copy of the dev printer's config with an isolated KAOS_HOME: with the include present and the installed bridge stale it is refreshed and says so; a second run is silent; with the include removed and the file deleted, nothing is put back. With KAOS off the AddOn.cfg macro runs, and that one is already current through #@reViSe. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verifying the alpha update on the dev printer turned up something the
AddOn.cfgfix cannot reach: KAOS declares[gcode_macro PHROZEN_TOOLCHANGE]a second time inkaos-ams-bridge.cfg, and a later declaration wins per option. So with KAOS on, the macro that actually runs is that one — and it had the defect twice over.The AMS branch was worse than the kit's
Its own comment says
M83goes first to close "the kit's standing G1 E-1 before M83 latent defect on this path". It does — but it never hands the mode back. A slicer running absolute E would have every extrusion after the first tool change reinterpreted as relative, for the rest of the print. That is a bigger fault than the one it fixes.Confirmed by grep: exactly one
M83in the whole bridge, and nothing anywhere restores the mode — notORCA_PURGE, notPRZ_SPITTING_END.The no-AMS branch still had the original defect
Its comment says why: "byte-identical to stock". It was, when written. The kit has since fixed that line, so the copy was stale and the claim no longer true.
Both branches now read the mode once at the top and hand it back. Rendered against Klipper's own jinja2, all four combinations:
M82M83→ retract →M82M83M83→ retractM82M83→ retract →M82M83M83→ retractIt had to survive
KAOS_ON/KAOS_OFFOur bridge configs are copied into
printer_data/configwhen KAOS is activated and never again.$SELF_DIR/configis inside the kit clone, so a kit update refreshes the source and leaves the copies — a printer that has had KAOS on since before an update keeps running the old ones. The same "the correction never reaches the printer" shape as the rest of this week.So
kaos-guard.sh, which already reconciles the spit patch before every klipper start, now refreshes our bridge configs too — keyed on the include line actually present in printer.cfg, exactly likesync_spit_patch. A file whose include is gone is never put back, soKAOS_OFFstays off. KAOS's own files come from the upstream cache and are untouched.Measured against a copy of the dev printer's config with an isolated
KAOS_HOME:AddOn.cfgmacro runs — already current through#@REVISE