Skip to content

Prevent resuming a saved preset - #4228

Open
ZenAlexa wants to merge 1 commit into
dstackai:masterfrom
ZenAlexa:issue_4204_block_verified_preset_resume
Open

Prevent resuming a saved preset#4228
ZenAlexa wants to merge 1 commit into
dstackai:masterfrom
ZenAlexa:issue_4204_block_verified_preset_resume

Conversation

@ZenAlexa

@ZenAlexa ZenAlexa commented Aug 30, 2026

Copy link
Copy Markdown

Closes #4204.

What changed

  • refuse dstack preset resume once the session has a committed preset.yml; cleanup may leave session.json at running, interrupted, or failed
  • let the saved preset own the list row, using the creation session only to decorate its progress, so a stale cleanup status cannot produce a second row for the same ID
  • cover the service-level gate, the CLI behavior, and stale interrupted/failed display states

Why

PresetStore.save() atomically commits the verified artifact before run cleanup. Cleanup is already best-effort and cannot invalidate that artifact, so its interruption must not make the completed creation resumable. A genuinely interrupted session with no saved preset keeps the existing resume behavior.

Verification

  • uv run pytest -q src/tests/_internal/cli/services/presets src/tests/_internal/cli/commands/test_preset.py — 312 passed, 2 skipped
  • uv run ruff check and uv run ruff format --check on the changed files
  • uvx pyright --pythonpath .venv/bin/python -p . — 0 errors

Copilot AI lite review requested due to automatic review settings August 30, 2026 06:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T06:16:04.768636Z eeb4581 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ZenAlexa

ZenAlexa commented Sep 1, 2026

Copy link
Copy Markdown
Author

The focused preset tests, Ruff checks, and Pyright pass on the current head. The fork workflow is action_required; please approve run 33296412298 so the full Test Build matrix can start.

@ZenAlexa

ZenAlexa commented Sep 2, 2026

Copy link
Copy Markdown
Author

Thanks for enabling the fork workflow. The full Test Build matrix is now green across Linux, macOS, Windows, Python 3.10–3.14, frontend, runner, gateway, schema generation, and lint; eeb45819 is ready for review.

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.

[Bug]: Resuming a preset session that already saved a preset marks it failed

2 participants