Skip to content

fix(controller): keep task templates stable across lifecycle changes - #390

Merged
rakyll merged 1 commit into
google:mainfrom
AlexsJones:fix/stable-task-templates
Sep 24, 2026
Merged

rakyll merged 1 commit into
google:mainfrom
AlexsJones:fix/stable-task-templates

Conversation

@AlexsJones

Copy link
Copy Markdown
Collaborator

Fixes #378.

AX_TASK_YAML embedded the whole Task, including status and spec.suspend. That env value feeds the template-name hash, so readiness updates and suspend/resume each created a new ActorTemplate and golden snapshot, even though the workload hadn't changed.

This strips status and resets spec.suspend on a clone before marshalling, so only the launch configuration goes into the template. Nothing in ax-task-runner or the metadata server reads either field.

Tests

  • TestTaskReconciler_WorkspaceReady now checks that readiness updates plus a suspend/resume cycle reuse a single template. It also checks that changing spec.command still produces a distinct template.
  • Without the fix it fails with created 4 templates, want 1.
  • go test -race ./... passes on current main.

The runner and sandbox docs now describe what AX_TASK_YAML and /metadata/v1alpha1/ax/task actually contain.

Exclude status and the suspend flag from embedded launch configuration so reconciliation reuses the existing template and golden snapshot.
@rakyll
rakyll merged commit e6211f8 into google:main Sep 24, 2026
9 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.

Suspend/resume creates redundant ActorTemplates and golden snapshots

2 participants