wait_for_state
Waits until a KVM-connected machine reaches a target boot or run phase, polling gates and vision. Returns phase and confidence, or timeout with last state.
Instructions
Wait (bounded) until the screen reaches a boot/run phase (read-only).
Server-side twin of CLI watch: polls cheap power/signal/boot-progress
gates, then server-side vision, until phase (a classify_screen token;
unknown tokens fail fast with the valid list) is observed. timeout is
seconds, capped server-side at 300 — chain calls for longer waits. Success
returns phase/confidence plus a frame_ref to pass to mouse as
observed_frame_ref; a timeout returns reached=false with the last
observed state (never a hang, never a raised error). With no server-side
vision credentials only cheap-gate phases are waitable; others fail fast
pointing at classify_screen polling. Holds the driver open up to
timeout s. Details: doctrine topic 'interfaces'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | Optional context for the vision backend, e.g. what you expect on screen ('Fedora installer, language page'). | |
| phase | Yes | Target boot/run phase token as classify_screen names it (e.g. 'bios', 'bootloader', 'os_login'); an unknown token fails fast with the valid list. | |
| profile | No | Profile name from ~/.config/kvm-pilot/config.toml selecting which KVM/BMC (and its managed host) this call targets. Omit to use the server's default (KVM_PILOT_PROFILE). | |
| timeout | No | Seconds to wait before returning reached=false; capped server-side at 300. |