Skip to content

STO-446: feat(model): add --delete-my-model-files-after-upload - #333

Merged
jebenexer merged 1 commit into
mainfrom
benjaminbrannaka/sto-446-needs-to-automatically-wipe-before-bringing-new-model-in
Sep 2, 2026
Merged

jebenexer merged 1 commit into
mainfrom
benjaminbrannaka/sto-446-needs-to-automatically-wipe-before-bringing-new-model-in

Conversation

@jebenexer

@jebenexer jebenexer commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes STO-446.

model add --model-path uploads whatever files are currently in the directory, with no tracking of what belonged to a previous version. Reusing the same local directory across model versions silently uploads a contaminated mixture of old and new files.

Fix

New opt-in flag: --delete-my-model-files-after-upload.

  • Requires --model-path and --wait-for-hash — errors immediately (before any upload) if either is missing.
  • Deletes only the exact files uploaded by this run, and only after the model version hash is confirmed server-side. Never a blanket directory wipe.
  • If hash confirmation or any file deletion fails, the command exits non-zero and leaves files in place — no silent partial success.
  • Adds deletedModelFiles/deletedModelFilesBytes to JSON output.

Testing

  • New unit tests covering flag validation, the happy path (verified deletion + output), and both failure modes (hash-confirmation failure leaves files untouched; partial delete failure reports non-zero with the specific failing file).
  • Full existing test suite passes.
  • Validated end-to-end against a local RIAB stack (real GraphQL + S3-backed upload + hasher pipeline, not mocks):
    • Reproduced the original contamination bug: uploading model B into a directory still holding model A's config.json silently included it — confirmed by downloading the file and seeing model A's content.
    • Confirmed the fix leaves the directory clean after a verified upload.
    • Confirmed the hash-timeout failure path leaves files untouched with a non-zero exit.
    • Round-trip integrity check: uploaded a 4-file model (including a nested subdirectory) with the new flag, captured SHA-256 hashes of the originals before upload, let the flag delete the local copies, then re-downloaded all 4 files through mProxy's presigned S3 URLs and diffed hashes. All 4 files were byte-identical to the originals — confirms the server-side stored blobs are correct before the local copies are removed, not just trusted based on the upload response.

Follow-up (not in this PR)

The runpodctl skill and vendored command-surface.json in runpod/runpod-plugins-official are both tied to released versions — will update those once this ships in a release.

STO-446: runpodctl model add --model-path re-uploads whatever files
currently sit in the directory, with no tracking of what belonged to a
previous version. Reusing the same local directory across model
versions silently uploads a contaminated mixture of old and new files.

Add an opt-in --delete-my-model-files-after-upload flag that removes
exactly the files uploaded by this run, but only after the model
version hash is confirmed server-side (requires --wait-for-hash).
Hash-confirmation failure or a partial delete both return a non-zero
exit with nothing silently dropped.
@jebenexer jebenexer changed the title feat(model): add --delete-my-model-files-after-upload STO-446: feat(model): add --delete-my-model-files-after-upload Aug 31, 2026
@jebenexer
jebenexer merged commit 069ac66 into main Sep 2, 2026
1 check passed
@jebenexer
jebenexer deleted the benjaminbrannaka/sto-446-needs-to-automatically-wipe-before-bringing-new-model-in branch September 2, 2026 18:44
@promptless

promptless Bot commented Sep 2, 2026

Copy link
Copy Markdown

Promptless documentation updates

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