Repository navigation
Description
What
Four changes from the 2026-11-04 SIMBOL print session (10 h lost): (1) 3d print-preflight slot Tn colour check compares sliced vs loaded colour by CIELAB ΔE (configurable threshold, default accepts same-family beige #E8D8B0 vs #FEE5A5) and prints the distance; material mismatch stays FAIL. (2) 3d print-preflight --fix and 3d printer start --fix-colour rewrite filament_colour/extruder_colour for the used tool in the G-code header and the 3mf config to the colour the printer reports, keep sidecars/hashes consistent and print old/new sha256. (3) New 3d printer slot set NAME T --material --color [--brand] writing the slot filament info on Moonraker printers (U1 write path researched; dry-run, fake Moonraker, idle-only, refuse offline printers). (4) RIG_HATCH_REQUEST_3D_PRINTER_START_FORCE approvals intermittently fail with 'tg-ctl ask-forward not-posted ... reason=send-failed' while plain tg works: find the path, add retry with backoff and a clear message on how to start from the printer screen.
Why (motivation)
The 2026-11-04 SIMBOL session lost hours: a preflight FAIL on a same-family beige (#E8D8B0 vs #FEE5A5) was only resolvable with --force, whose Telegram approval failed intermittently with send-failed.
User impact
The operator can start a long print immediately after a one-command colour fix instead of waiting on a flaky approval; the preflight stops blocking on harmless colour variants.
Cost of inaction
The next long print again stalls for hours on a colour false-FAIL and a failing --force approval.
Acceptance criteria
- print-preflight reports ΔE for slot colour; #E8D8B0 vs #FEE5A5 passes by default, a different hue FAILs, material mismatch FAILs — forced: tests/test_colour_fix.py, tests/test_printer_colour_commands.py, tests/e2e/test_print_preflight_colour_workflows.py: ΔE 6.4 passes by default (#E8D8B0 vs #FEE5A5), blue FAILs, PLA vs PETG FAILs; PR feat(printer): slot colour by ΔE, --fix/--fix-colour, printer slot set, retry for a start --force approval Telegram could not post (Refs #728) #730 CI test green (run 42064573784)
- print-preflight --fix and printer start --fix-colour rewrite G-code header and 3mf config colours for the used tool and print old/new sha256; sidecars stay consistent — forced: tests/e2e/test_print_preflight_colour_workflows.py::test_preflight_fix_aligns_gcode_3mf_and_sidecars_and_prints_the_hashes and tests/e2e/test_printer_colour_workflows.py: G-code + 3MF + manifest + slice-warnings rewritten, old/new sha256 printed; one --fix also adds missing thumbnails; CI green
- 3d printer slot set --dry-run works; real write only on an idle writable Moonraker printer, tested against a fake Moonraker — forced: tests/e2e/test_printer_colour_workflows.py + tests/test_printer_colour_commands.py: slot set --dry-run, write only on idle writable fake Moonraker, refusals; CI green
- force-approval send-failed is retried with backoff and ends with an operator hint to start from the printer screen — forced: tests/e2e/test_printer_force_retry_workflows.py: send-failed retried 3 times then the printer-screen hint; CI green
Screenshots
(none)
Deploy
Deployed: no
Links
- PR: feat(printer): slot colour by ΔE, --fix/--fix-colour, printer slot set, retry for a start --force approval Telegram could not post (Refs #728) #730
- Merge commit: 1bdda60
Skipped gates
- links: bare field names filament_colour/extruder_colour are G-code keys, not repo paths
Activity
alex-mextner commentedon Nov 5, 2026
Root cause of the intermittent
ask-forward not-posted … reason=send-failed(research, 2026-11-05)Code path.
3d printer start --force→printer_ops/force_hatch.py:require_force_approval→ agent-toolsagenttools_hatch_escalation.request_hatch_approval→tg-ctl ask→ the tg-ctl daemon (tg-cli/features/tg-ctl/daemon-runtime/question-cards.ts: forwardAndPostQuestion). The daemon does ONEsendMessage(botPostResult, 15 s timeout, no retry). When it fails it logsask-forward dropped: reason=send-failed, drops the ask and the client printsask-forward not-posted: … daemon declined: reason=send-failed. Plaintgis a different process that sends later, so it can work a moment after.Evidence (the tg-cli daemon log,
tg-ctl.<chat>.log, the two failed requests of 2026-11-04):and the daemon's poll loop failed the same way (
getaddrinfo EAI_AGAIN) every 15 s from 22:03 to 22:05+. So: a transient resolver/network failure of the daemon's own process (EAI_AGAIN= temporary DNS failure), not a Telegram or card-format problem. The samesend-failedline appears for other hooks on 2026-10-25/28 and 2026-11-01 (hatch-rig-worktree-discard,hatch-block-raw-pr-merge, …): it is not specific to the printer hook.Safe to retry.
not-postedmeans no card exists, so asking again cannot double-approve.Fix in 3d-cli (this PR).
force_hatch.pyasks again after 3, 10 and 30 s (four requests in all, each reported on stderr) while the verdict isreason=send-failed; every other outcome (approved, denied, expired,not-registered, no justification) is final at once. When it still fails the refusal names the way around Telegram: the file is already stored on the printer, so start it from the printer screen (Files, then Print), says the screen does NOT run these checks, and points at the daemon log lines to read.Outside 3d-cli (not changed here). The retry belongs in the daemon too:
forwardAndPostQuestionshould retrysendButtonCardon network errors (EAI_AGAIN, timeouts) with backoff beforedropAsk(socket, "send-failed"), andagent-toolscould mapsend-failedto a retryable verdict. Suggested tickets: tg-cli (daemon send retry), agent-tools (request_hatch_approvalretry onnot-posted … send-failed).feat(print-preflight): slot colour by CIEDE2000 ΔE, --fix rewrites th…
fix(printer): retry a start --force approval Telegram could not post,…
feat(printer): start --fix-colour and `printer slot set|show` align f…
test(printer): e2e for a start --force approval that Telegram could n…
merge: feat/gcode-thumbnails-everywhere into feat/slot-colour-fix; on…
test(printer): user-workflow docstrings for two colour e2e stories (R…
merge: origin/main (squashed #725) into feat/slot-colour-fix; tree un…
feat(printer): slot colour by ΔE, --fix/--fix-colour, printer slot se…
alex-mextner commentedon Nov 5, 2026
Shipped: merged via #730.
Merge commit: 1bdda60
This does NOT close the ticket — acceptance still needs proof. Run
task read #728for the outstanding criteria, thentask check/task done.feat(printer): bed check + job watch that cancels and calls when the …
feat(printer): print-quality monitor — stringing, pattern loss, first…
feat(printer): macro passthrough and per-model alias commands (#721)