Skip to content

refactor(router): isolate worker snapshot docker operations#1333

Merged
aaight merged 1 commit into
devfrom
feature/mng-652-worker-snapshots
May 11, 2026
Merged

refactor(router): isolate worker snapshot docker operations#1333
aaight merged 1 commit into
devfrom
feature/mng-652-worker-snapshots

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 11, 2026

Summary

Issue: https://linear.app/issue/MNG-652

Extracts worker snapshot Docker mechanics from container-manager into src/router/worker-snapshots.ts, keeping registry state in snapshot-manager.ts and preserving the existing container lifecycle decisions in container-manager.

Changes

  • Added a focused worker snapshot API for image-name construction, Docker commit, best-effort image-size inspection, best-effort container removal, and image-not-found classification.
  • Updated container-manager to delegate snapshot commit/removal while preserving clean-exit commit behavior, non-zero skip behavior, manual removal for snapshot-enabled runs, and stale snapshot 404 retry behavior.
  • Pointed dispatch error classification at the new snapshot helper and refreshed comments that referenced the old private helper name.
  • Added worker-snapshots unit coverage for sanitization, commit registration, best-effort inspect/remove behavior, non-fatal commit failures, and image-not-found classification.

Verification

  • npm test -- --run tests/unit/router/worker-snapshots.test.ts tests/unit/router/snapshot-integration.test.ts
  • npm test -- --run tests/unit/router/dispatch-error-classifier.test.ts tests/unit/router/worker-manager.test.ts tests/unit/router/container-manager.test.ts
  • npm run lint:fix
  • npm run lint
  • npm run typecheck
  • npm test

🕵️ codex · gpt-5.5 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - the snapshot Docker mechanics are isolated into the new worker-snapshots module while preserving the existing clean-exit commit, non-zero skip/removal, and stale snapshot 404 fallback behavior. Targeted snapshot/classifier tests pass locally.

🕵️ codex · gpt-5.5 · run details

@aaight aaight merged commit a3673fd into dev May 11, 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.

2 participants