Skip to content

Improve Helio reliability, catalog consistency, and workflow safety - #11793

Merged
lanewei120 merged 1 commit into
bambulab:masterfrom
HelioPri:agent/helio-reliability-upstream
Aug 5, 2026
Merged

Improve Helio reliability, catalog consistency, and workflow safety#11793
lanewei120 merged 1 commit into
bambulab:masterfrom
HelioPri:agent/helio-reliability-upstream

Conversation

@HelioPri

@HelioPri HelioPri commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Improve Helio reliability, catalog consistency, and workflow safety

Summary

This change hardens the Helio Additive integration against transient network failures, cancellation races, stale support data, and stale sliced output. It also completes several workflow fixes around history ordering, unsupported printers, multi-material guidance, simulation exports, and slicer validation errors.

The upstream submission is intentionally packaged as one commit so the reliability and state-management changes land as a coherent unit.

Why this is needed

The previous workflow had limited, operation-specific recovery and did not consistently distinguish transient from terminal failures or protect retries against duplicate and stale results. In practice, long-running simulations and optimizations may encounter transient HTTP failures, interrupted uploads, delayed GraphQL responses, user cancellation, region changes, or a new action starting while an older worker is still stopping.

Those conditions could cause several user-visible failures:

  • a simulation or optimization failing after a recoverable network interruption;
  • a retried mutation creating duplicate backend runs;
  • stale workers continuing after cancellation or publishing results into a newer action;
  • partially refreshed printer and material catalogs being combined;
  • history results appearing out of order or malformed timestamps displaying as extremely old dates;
  • Helio using stale G-code after the project enters a slicer validation error;
  • the Helio action being incorrectly disabled for valid unsupported/reference-printer workflows;
  • simulation results lacking the same sliced-3MF export offered by optimization results.

What changed

Resilient and idempotent network operations

  • Add a shared Helio retry policy for HTTP, transport, GraphQL, and backend-authentication failures.
  • Retry ordinary transient failures with bounded backoff instead of failing immediately.
  • Reuse one idempotency key across create retries, reducing duplicate-creation risk.
  • For simulation and optimization creates, use a unique stable run name and adopt a matching recent run when a response is lost after server acceptance.
  • Make upload retry waits cancellation-aware.
  • Bound progress polling and distinguish transient polling failures from terminal backend failures.
  • Harden response parsing so malformed or incomplete data produces controlled errors rather than unchecked field access.

Cancellation, worker lifecycle, and stale-event protection

  • Track Helio action generations through start, progress, completion, and slicing events.
  • Ignore completion events belonging to a canceled or superseded generation.
  • Prevent a new action from reviving or reusing an older worker that is still stopping.
  • Reject a new start without canceling the action already in progress.
  • Avoid blocking the GUI while an earlier worker is still shutting down; return promptly and ask the user to try again shortly.
  • Join support-data and print-priority request workers during application exit.
  • Run print-priority requests off the GUI thread and prevent a support-data refresh from publishing stale cache entries.

Consistent printer and material support data

  • Load paginated printer and material catalogs completely rather than assuming a single page.
  • Publish immutable catalog snapshots only after a complete load.
  • Keep the last usable snapshot available when a refresh fails.
  • Treat the printer/material pair as one catalog generation so a run cannot mix new printer data with stale material data.
  • Reuse the action's captured snapshots throughout printer and material matching.
  • Invalidate catalog and cache source state when the API URL or credentials change so the next request loads the correct source.
  • Track per-catalog load state and expose pair availability to the GUI as Synchronizing, Usable, or LoadFailed when data is present or loading fails.

Helio history behavior

  • Limit history requests to the latest 10 simulations and latest 10 optimizations.
  • Sort returned runs newest first, placing missing or invalid timestamps last.
  • Parse run timestamps defensively and display Unknown when a timestamp cannot be recovered.

Safer launch eligibility and stale G-code prevention

  • Keep Helio available for valid native slices on unsupported/reference printers.
  • Keep Helio disabled for standalone or imported G-code modes.
  • Disable Helio while background slicing is active.
  • Require the current plate to have both a valid slice result and a valid live slicer state.
  • Block launch for slicer validation errors and broken mixed-filament definitions, even if an older valid G-code result remains on the plate.
  • Revalidate the original plate after modal dialogs and immediately before starting network work, preventing a plate change from combining old selections with another plate's G-code.
  • Preserve the official top-bar Helio icon assets when updating enabled/disabled state.

Workflow and UI corrections

  • Replace obsolete wording that implied true multi-material support was only a future feature.
  • Point users to the existing experimental multi-material optimization preference.
  • Add sliced-3MF export to simulation results, matching the existing optimization workflow.
  • Clarify support-data errors and simulation export tooltips.

Tests

Adds focused coverage for:

  • retry classification and retry-controller limits;
  • paginated support-data loading, malformed/partial-response rejection, and bounded retry behavior;
  • snapshot preservation, overlapping-request suppression, atomic pair publication, and stale-generation rejection;
  • recent-run timestamp parsing, including malformed names and retry suffixes.

Test files:

  • tests/slic3rutils/helio_retry_policy_tests.cpp
  • tests/slic3rutils/helio_support_data_tests.cpp
  • tests/slic3rutils/helio_recent_runs_tests.cpp

Validation

  • git diff --cached --check
  • conflict-marker scan after applying the change to current official master
  • independent static adversarial review of the current upstream-base integration
  • prior downstream manual testing covered Mac and Windows simulation/optimization workflows, unsupported printers, multi-material guidance, sliced-3MF export, cancellation/restart behavior, and support-data refresh behavior; it was not rerun against this upstream base

This local checkout does not have a configured dependency build or generated wxWidgets headers, so a full local BambuStudio compile was not run. The upstream CI build matrix should complete before this draft is marked ready for review.

Integration notes

  • Based on official bambulab/BambuStudio commit 12f17b06f4f537f9c03162d08bb70cf733c42839.
  • The feature originated as three linear downstream commits and is squashed here into one signed upstream commit.
  • The commit changes 20 files: 13 modified and 7 added.
  • The only conflict against current official master was the Helio top-bar icon rename in MainFrame.cpp; the resolution keeps the new validation-aware state calculation and the official helio_icon_topbar / helio_icon_topbar_disable assets.
  • No submodule or binary changes are included.

Reviewer focus areas

  • cancellation and generation transitions when a new action is requested while an older worker is stopping;
  • retry classification, idempotent create handling, and retryable uploads;
  • atomic printer/material catalog generation handling;
  • plate identity and slicer-validation checks around nested modal dialogs;
  • application shutdown while Helio background requests are active.

Centralize transient retry classification and add bounded, cancellation-aware retries for Helio create, upload, and polling operations. Use idempotency keys and action generations to prevent duplicate runs, revived workers, and stale completion events.

Load paginated printer and material catalogs into immutable, generation-consistent snapshots. Preserve the last usable data after failed refreshes and refresh cached support data when region or credentials change.

Harden launch eligibility against imported G-code, active slicing, validation errors, broken mixed-filament definitions, and plate changes across modal dialogs. Preserve valid unsupported-printer workflows.

Improve history ordering and timestamp fallback, update multi-material guidance, add sliced-3MF export for simulation results, and include focused retry, support-data, and recent-run tests.
@HelioPri
HelioPri marked this pull request as ready for review August 3, 2026 10:16
@lanewei120
lanewei120 merged commit f43cbe4 into bambulab:master Aug 5, 2026
21 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.

3 participants