fix(runner): disarm FicTrac closed-loop apply at sequence start, end and abort (v0.71) - #177
Merged
Merged
Conversation
…and abort (Studio v0.71) A stale bridge apply=true (left on by Console closed-loop use or a run that aborted mid-trial) leaked into the next run: the shared apply gate opens as soon as session.running is set, so FicTrac frames were pushed into the opening Mode-2 step and the firmware rejected every SET_FRAME_POSITION (0x70) with status 1 — 304 error lines in the first 3 s of rig03-sr run 8u5v10jg (2026-09-04). Harmless to the data, but it floods the Studio log and confuses operators. ArenaRunner gains a private _disarmClosedLoop() (idempotent, never throws) called from runSequence() before the first step, from its finally block, and from _clear() (abort()/disconnect). Existing closed-loop test updated for the two safety falses; two new regression tests: stale apply is cleared BEFORE the first controller send, and an abort mid-closed-loop leaves apply off. 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
Diagnosed from a rig log today (rig03-sr, run
8u5v10jg): 304SET_FRAME_POSITION(0x70) commands were rejected with firmware status 1 during the first 3 s — the Mode-2start_bgstep — before the runner emitted its firstfictracApply trueat 3.02 s. The bridge's closed-loop apply flag had been left on (Console use or an earlier aborted run), and the shared apply gate (stepperLoaded || session.running) opens the moment a run starts, so FicTrac frames flowed into a non-Mode-3 step. Harmless to the data, but hundreds of error lines in the Studio log.(The run's later abort at step 33 was a separate controller/USB stall — 12 s of unanswered commands then a trial-params timeout — not addressed here; the same protocol completed on re-run.)
Change
js/arena-runner-g6.js: new private_disarmClosedLoop()(idempotent, guarded, never throws) calledrunSequence()right after_abort = false— before the first step,finallyblock — sequence end or abort,_clear()—abort()/ involuntary disconnect.Protocol timing and data are unchanged; the protocol's own
startClosedLoop/stopClosedLoopstill toggle apply as before.Tests
[false, true, false, false](start disarm, protocol on/off, end disarm).apply=trueis cleared before the first controller send; abort mid-closed-loop leaves apply off.pixi run testgreen (runner suite 235/235). Studio footer → v0.71 + release-notes entry.🤖 Generated with Claude Code