Skip to content

Preserve literal preset env values for resume - #4231

Closed
SiluPanda wants to merge 1 commit into
dstackai:masterfrom
SiluPanda:issue_4165_preserve_literal_env
Closed

Preserve literal preset env values for resume#4231
SiluPanda wants to merge 1 commit into
dstackai:masterfrom
SiluPanda:issue_4165_preserve_literal_env

Conversation

@SiluPanda

Copy link
Copy Markdown

Summary

  • preserve literal preset environment values in the private session manifest so a later resume gets the same configuration
  • continue storing passthrough environment entries by name, so values inherited from the caller (such as HF_TOKEN) are not copied into the manifest
  • cover both the serialized YAML and its round-trip through the resume configuration loader

The manifest already uses the session's atomic private writer, which creates files with mode 0600. This change records KEY=value only when the original preset configuration contained that literal value; a bare KEY remains a passthrough reference resolved from the environment on resume.

Fixes #4165.

Validation

$ uv run pytest -q src/tests/_internal/cli/services/presets/test_agent.py src/tests/_internal/cli/services/presets/test_create.py
117 passed, 2 skipped in 2.45s

$ uv run ruff format --check <changed Python files>
2 files already formatted

$ uv run ruff check <changed Python files>
All checks passed!

$ git diff --check
# no output

AI-assisted implementation; I reviewed the diff and ran the checks above locally.

@r4victor r4victor closed this Sep 1, 2026
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]: [Presets] Resume requires literal env values in the local environment

2 participants