"apply after mounting" (Auto Centering checkbox) never fired. The GUI clicked
Auto Centering on the first status tick that showed the new sample id, but
/sample/mount still holds the hw lock at that point. /alc/center_loop takes
the same lock non-blocking, so the request failed with BeamlineBusyException,
which the GUI treats as a quiet error (no popup, no retry). A manual click a
few seconds later worked because the lock was free by then.
Fix
Arm on the sample-id change, click on the first status tick with busy=False
(busy is the hw lock state). Same thing the user did by hand.
Skip arming while queue automation runs: it mounts and centers itself and
frees the lock between /scan/auto calls; a GUI centering in that gap would
steal the lock from the next scan.
One connect line in main_window from the existing automation_running_changed
signal.
Known and accepted: Pause pressed during a scan's mount phase can still arm
that sample. Pause ends in an unmount, so the remaining window is the ms-wide
lock gap between scan end and unmount, sampled at 2 Hz. Noted in the code.
Supersedes PR 243 (fix/auto-center-after-mount-wait-idle, three commits with
an in-flight /scan/auto counter). That PR can be closed.
Verification
ruff check (+ isort variant), ruff format --check: pass
diff-quality basedpyright vs origin/main: 100%
tests/unit: 539 passed, 9 skipped (two runs)
diff-cover vs origin/main: 100% (15 lines)
Pre-push hook skipped: its --cov run hits a known macOS Bus error in
test_tell_sample_panel.py::test_queue_drop_chip_accepts_sample_payloads
(QDropEvent under coverage tracing), unrelated to this change; the same
gates were run by hand.
Still to do on hardware: tick the box, mount from the Dewar list, expect the
AUTO CENTERING overlay right after the robot finishes; run a short queue and
confirm no centering between samples.
## Problem
"apply after mounting" (Auto Centering checkbox) never fired. The GUI clicked
Auto Centering on the first status tick that showed the new sample id, but
/sample/mount still holds the hw lock at that point. /alc/center_loop takes
the same lock non-blocking, so the request failed with BeamlineBusyException,
which the GUI treats as a quiet error (no popup, no retry). A manual click a
few seconds later worked because the lock was free by then.
## Fix
- Arm on the sample-id change, click on the first status tick with busy=False
(busy is the hw lock state). Same thing the user did by hand.
- Skip arming while queue automation runs: it mounts and centers itself and
frees the lock between /scan/auto calls; a GUI centering in that gap would
steal the lock from the next scan.
- One connect line in main_window from the existing automation_running_changed
signal.
Known and accepted: Pause pressed during a scan's mount phase can still arm
that sample. Pause ends in an unmount, so the remaining window is the ms-wide
lock gap between scan end and unmount, sampled at 2 Hz. Noted in the code.
Supersedes PR 243 (fix/auto-center-after-mount-wait-idle, three commits with
an in-flight /scan/auto counter). That PR can be closed.
## Verification
- ruff check (+ isort variant), ruff format --check: pass
- diff-quality basedpyright vs origin/main: 100%
- tests/unit: 539 passed, 9 skipped (two runs)
- diff-cover vs origin/main: 100% (15 lines)
- Pre-push hook skipped: its --cov run hits a known macOS Bus error in
test_tell_sample_panel.py::test_queue_drop_chip_accepts_sample_payloads
(QDropEvent under coverage tracing), unrelated to this change; the same
gates were run by hand.
- Still to do on hardware: tick the box, mount from the Dewar list, expect the
AUTO CENTERING overlay right after the robot finishes; run a short queue and
confirm no centering between samples.
Generated with [Claude Code](https://claude.com/claude-code)
The "apply after mounting" checkbox clicked Auto Centering as soon as the
status poll showed a new sample id. /sample/mount still holds the hw lock
at that point, /alc/center_loop takes the same lock non-blocking, and the
resulting BeamlineBusyException is a quiet error the GUI swallows. So the
automatic click never did anything; only a later manual click worked.
Arm on the sample-id change and click on the first status tick with
busy=False, which is exactly what the user did by hand. Skip arming while
queue automation runs: it mounts and centers on its own and frees the lock
between /scan/auto calls, so a GUI centering in that gap would steal the
lock from the next scan. Pause during a scan's mount phase can still arm
that one sample, but Pause ends in an unmount, so the window is a ms-wide
lock gap sampled at 2 Hz; accepted, noted in the code.
Supersedes the three-commit approach on
fix/auto-center-after-mount-wait-idle (PR 243).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
"apply after mounting" (Auto Centering checkbox) never fired. The GUI clicked
Auto Centering on the first status tick that showed the new sample id, but
/sample/mount still holds the hw lock at that point. /alc/center_loop takes
the same lock non-blocking, so the request failed with BeamlineBusyException,
which the GUI treats as a quiet error (no popup, no retry). A manual click a
few seconds later worked because the lock was free by then.
Fix
(busy is the hw lock state). Same thing the user did by hand.
frees the lock between /scan/auto calls; a GUI centering in that gap would
steal the lock from the next scan.
signal.
Known and accepted: Pause pressed during a scan's mount phase can still arm
that sample. Pause ends in an unmount, so the remaining window is the ms-wide
lock gap between scan end and unmount, sampled at 2 Hz. Noted in the code.
Supersedes PR 243 (fix/auto-center-after-mount-wait-idle, three commits with
an in-flight /scan/auto counter). That PR can be closed.
Verification
test_tell_sample_panel.py::test_queue_drop_chip_accepts_sample_payloads
(QDropEvent under coverage tracing), unrelated to this change; the same
gates were run by hand.
AUTO CENTERING overlay right after the robot finishes; run a short queue and
confirm no centering between samples.
Generated with Claude Code
Coverage report (automated)
Total line + branch coverage: 51%
Diff coverage vs main: 100% (minimum 80%)
Full report: coverage artifact on this run.
168c8afb5fto2c388ff7ad