Skip to content

Resource-cleanup audit: release sensors/network/compute on every completion path #38

Description

@rayl15

Part of the power-management roadmap in #36 (Stage 1).

Goal

Guarantee that every request-completion path releases all held resources: camera stream, microphone, speech recognition, network sockets/WebSockets, timers, frame buffers, and model-inference tasks.

Why

OpenVision already does snapshot-first "click-and-go" (camera stops right after capture) and has performFullStop(), conversation-inactivity timeouts, and background/GPU guards. But cleanup isn't verified as a single sweep across all exit paths, so a leak on one path (e.g. an error mid-stream) could leave the camera or a socket alive and drain battery.

Paths that must all release resources

  • Successful completion
  • User cancellation / barge-in
  • Inactivity timeout
  • Error mid-request
  • App backgrounding
  • Glasses disconnection
  • Repeated network failure

Pointers

  • OpenVision/Views/VoiceAgent/VoiceAgentView.swiftperformFullStop(), stopLiveVideoMode(), capture flow (~line 620)
  • OpenVision/Managers/GlassesManager.swiftstartStreaming() / stopStreaming()
  • OpenVision/Services/GemmaLocal/GemmaLocalService.swift — background/generation guards (~line 744)

Good first issue — mostly an audit + adding missing teardown calls. Happy to review a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomerspowerBattery, thermal, and power efficiency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions