Repository navigation
feat(server): pre-flight disk check for the TCP run commands - #659
Draft
hongquanli wants to merge 1 commit into
Draft
hongquanli wants to merge 1 commit into
hongquanli wants to merge 1 commit into
Conversation
The "Not Enough Disk Space" check lived only in the two GUI acquisition
widgets, so an acquisition started over TCP/MCP (run_acquisition,
run_acquisition_from_yaml) was never checked: one that did not fit
started anyway and filled the disk.
Both commands now run the same check, after the controller is fully
configured and before anything is created on disk. A run the save disk
cannot hold is refused with an error that names the opt-in
('large_acquisition_mode: true' under 'acquisition:' in the YAML, or the
Large Acquisitions setting); with the mode on it starts and the
disk-space guard pauses it while data is offloaded. Runs that save
nothing (skip_saving) are not checked, as in the GUI.
The decision is shared: control.core.disk_space.preflight_disk_check
(Qt-free; measures the nearest existing parent when the save folder does
not exist yet) now backs the GUI dialog too, so both paths use the same
estimate, safety factor and message.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacks on #648 (needs its large acquisition mode and YAML opt-in). Independent of #649 and #650; trial merges with both branch tips are conflict-free.
The "Not Enough Disk Space" check lived only in the two GUI acquisition widgets, so an acquisition started over TCP/MCP (
run_acquisition,run_acquisition_from_yaml) was never checked: one that did not fit started anyway and filled the disk. A TCP client also never sees the dialog that offers large acquisition mode.Behavior
Both commands now check the save disk after the controller is fully configured and before anything is created on disk (no stray experiment folder on refusal):
RuntimeErrornaming the opt-inacquisition.large_acquisition_mode: true, or the Large Acquisitions setting)skip_savingThis is a deliberate default-behavior change for TCP runs that do not fit (requested by @hongquanli): they used to start and fill the disk; the GUI has always refused them.
Implementation
control/core/disk_space.py:preflight_disk_check(controller, save_directory)returns aPreflightDiskCheck(required and available bytes, image count,fits,describe()). Qt-free. When the save folder does not exist yet, free space is measured on its nearest existing parent.check_space_available_with_error_dialognow uses the same function, so both paths share the estimate, the 1.03 safety factor and the message. The dialog flow is unchanged.MicroscopeControlServer._refuse_if_acquisition_will_not_fit, called by both run commands; command docstrings (the MCP tool descriptions) anddocs/mcp_integration.mddescribe it.Tests
start_new_experiment/run_acquisitionand the error names the flag; YAML opt-in starts; global setting starts;skip_savingis not checked; a run that fits starts; the wells command is refused too. Verified these fail with the refusal neutralised.Not covered here: the fluidics protocol runner (
widgets_fluidics/qt_imaging_port.py) also starts acquisitions from settings without this check.🤖 Generated with Claude Code