Skip to content

Acquire and hold RESERVE_BEHAVIORS behavior control #17

@infraax

Description

@infraax

Task: Behavior Control Acquisition

Parent epic: #4 (M1 — Robot Connection)
Depends on: #16 (ConnectionManager)

What to do

After a successful SDK connection, acquire RESERVE_BEHAVIORS at Priority 30 and hold it for the session. This gives VectorBrain SDK control while allowing safety behaviors to preempt us.

// In ConnectionManager.Start(), after dial succeeds:
stream, err := client.BehaviorControl(ctx)
// Send ControlRequest with RESERVE_BEHAVIORS at Priority 30
// Keep the stream alive — releasing it surrenders control
// Re-acquire on reconnect

Why RESERVE not OVERRIDE

Safety behaviors (cliff detection, fall response) run at Priority 10 — lower number = higher priority. RESERVE (Priority 30) means we can be preempted. OVERRIDE would suppress safety behaviors. We never use OVERRIDE.

This is documented in CLAUDE.md as a non-negotiable constraint.

Reconnect behavior

If the connection drops and reconnects, re-acquire behavior control immediately after re-dial.

Notes

  • The control stream must be held alive for the duration of the session. If the stream closes, control is lost.
  • Log acquisition and loss of control at INFO level — this is important operational state.
  • HasControl bool should be exposed on ConnectionManager and reflected in RobotState.

Definition of done

RobotState.has_sdk_control is true when connected. Verified that cliff detection still stops Vector (safety not overridden).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions