Skip to content

Make the vision preflight detect a camera-less image - #225

Merged
RobVanProd merged 1 commit into
mainfrom
agent/vision-preflight-detects-camera-less-firmware
Aug 12, 2026
Merged

Make the vision preflight detect a camera-less image#225
RobVanProd merged 1 commit into
mainfrom
agent/vision-preflight-detects-camera-less-firmware

Conversation

@RobVanProd

Copy link
Copy Markdown
Owner

The preflight could not fail

bridge/vision_service.py --preflight reported "ready": true unconditionally. It never contacted
the robot, so it could not distinguish a working setup from one that would never produce a single
detection — and tools/start_local_vision.ps1 gates on that result, so it would happily launch a
worker doomed to return nothing.

That is exactly F3's signature failure, and a large part of why it stayed undiagnosed. F3 reads
"the camera works and the robot is serving frames; the host has never returned a single detection."
A worker polling a camera-less image looks identical to a detector that simply sees nobody: zero
faces, no errors, forever.

The reference robot reports compiled_enable_camera: 0 and compiled_enable_camera_host_vision: 0.
The old preflight still called it ready.

Change

Preflight now reads the unauthenticated /debug surface and refuses when:

  • either compiled camera flag is explicitly disabled → firmware-camera-disabled: <flags>
  • the robot is unreachable → robot-unreachable: <error type>
  • /debug is unparsable or not an object

It reports the distinguishing reason and exits 2, so the launcher stops rather than starting a
worker that cannot work.

An absent flag is treated as unknown rather than disabled. /debug truncates by omitting fields
(debug_response_truncated: true is observable on the live robot), so reading omission as "camera
off" would turn a large snapshot into a false negative.

Verified against the live robot

Before — same robot, camera compiled out:

{"schema":"stackchan.local-vision-start.v1","status":"preflight-ready", ...}   exit 0

After:

{"ready":false,"reason":"firmware-camera-disabled: compiled_enable_camera,compiled_enable_camera_host_vision", ...}
exit 2

and tools/start_local_vision.ps1 stops with Local vision preflight failed with exit 2.

Notes

  • No new secret handling: /debug needs no pairing code, and the pairing code is still never
    fetched into the payload. The existing no-leak assertion is retained.
  • bridge/test_vision_service.py: 11/11, covering ready, camera-disabled, unreachable, and the
    truncated-response case.
  • The old test was named "…without fetching…"; preflight now deliberately does fetch, so that
    contract is replaced rather than worked around.

Pairs with #224, which supplies a camera profile that does not also switch motion on. Neither is
physical qualification of F3.

The preflight reported `"ready": true` unconditionally. It never contacted the robot, so it
could not distinguish a working setup from one that would never produce a detection, and
`tools/start_local_vision.ps1` would happily launch a worker against firmware with the camera
compiled out.

That is F3's signature failure and why it stayed undiagnosed: the host polls forever and returns
zero faces, which looks exactly like a detector that simply sees nobody. The reference robot has
`compiled_enable_camera: 0` and `compiled_enable_camera_host_vision: 0`, and the old preflight
still called it ready.

Preflight now reads the unauthenticated /debug surface and refuses when either compiled flag is
explicitly disabled, when the robot is unreachable, or when /debug is unparsable, reporting the
distinguishing reason and exiting 2 so the launcher stops instead of starting a doomed worker.

An absent flag is treated as unknown rather than disabled: /debug truncates by omitting fields, and
reading omission as "camera off" would turn a large snapshot into a false negative.

Verified against the live robot: preflight now returns
`ready: false, reason: "firmware-camera-disabled: compiled_enable_camera,compiled_enable_camera_host_vision"`
with exit 2, and start_local_vision.ps1 stops with "Local vision preflight failed with exit 2."
It previously printed `preflight-ready` for that same robot.

The pairing code is still never fetched into the payload; /debug needs no pairing, so the check adds
no new secret handling. bridge/test_vision_service.py: 11/11.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RobVanProd
RobVanProd merged commit 447432c into main Aug 12, 2026
8 checks passed
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.

1 participant