fix: clean up Docker isolation containers by default#141
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #140
Working session summaryDone. PR #141 is updated, ready, and clean: Head commit is
Implemented the Docker cleanup behavior from issue #140, including default cleanup after command completion, host log preservation, Local checks passed, including JS check/test, Rust fmt/clippy/test, file-size, test parity, changeset validation, and diff whitespace check. Working tree is clean. This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (682.1K + 14.8M cached) input tokens, 70.6K output tokens, $24.832279 cost 🤖 Models used:
📎 Log file uploaded as Repository (2 chunks) (106559KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Fixes #140.
Summary
$ --isolated dockernow cleans up Docker containers by default after the container command finishes while keeping the host-side session log. The old--auto-remove-docker-containerflag remains supported as a compatibility alias for the always-cleanup policy.What changed
--always-cleanup-container(default behavior)--keep-container--keep-container-on-fail--auto-remove-docker-containercompatibility aliasdocker run --rmusage so detached logging can drain and capture the exit code before cleanup.docker logs -f, capturedocker inspect .State.ExitCode, write the log footer, then remove containers according to policy.Reproduction
Before this change, detached Docker sessions without
--auto-remove-docker-containerleft exited containers behind indefinitely. Attached Docker sessions used--rmand inherited stdio, so they could not reliably preserve a host log while also letting the wrapper decide cleanup policy.After this change:
Tests
cd js && bun run checkcd js && bun run testbun test ./js/test/docker-autoremove.jsbun test ./js/test/args-parser.js ./js/test/args-parser-docker-cleanup.js ./js/test/command-builder-docker-cleanup.jscargo fmt --manifest-path rust/Cargo.toml --all -- --checkcargo clippy --manifest-path rust/Cargo.toml --all-targets --all-featurescargo test --manifest-path rust/Cargo.toml --all-features --verbosebash scripts/check-mjs-syntax.shnode scripts/check-test-parity.mjsnode scripts/validate-changeset.mjsNo screenshots are included because this is CLI/runtime behavior.
Release
js/.changeset/docker-container-cleanup.md(minor)rust/changelog.d/141.md(bump: minor)