Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Summary

Implements call_assist notification command using CallKit to present a native incoming call UI that opens AssistView when answered. Works from lock screen, similar to update_widgets but with user interaction.

New Command Handler:

  • CallKitManager: Thread-safe CallKit integration with atomic state operations
  • HandlerCallAssist: Notification command processor
  • CallKit delegate in NotificationManager opens AssistView on answer

Supported Parameters:

  • caller_name: Display name for incoming call (default: "Home Assistant")
  • pipeline_id: Specific Assist pipeline ID
  • auto_start_recording: Auto-start voice recording

Usage:

service: notify.mobile_app_iphone
data:
  message: "command"
  data:
    command: call_assist
    caller_name: "Front Door"
    auto_start_recording: true

Implementation Notes:

  • iOS only (uses CallKit framework)
  • Call automatically ends after answer (UI trigger only)
  • Thread-safe with DispatchQueue for state management
  • Atomic captureAndClearState() prevents race conditions

Screenshots

N/A - Uses native iOS CallKit UI

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Test cases and comprehensive documentation included in Documentation/CallKitAssistCommand.md and Documentation/CallKitAssistFlowDiagram.md.

Original prompt

Using CallKit, implement a notification command like the "update_widgets" but that calls the ios app and when answered open AssistView


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 7 commits January 16, 2026 23:20
- Created CallKitManager to handle incoming calls via CallKit
- Added 'call_assist' notification command handler
- Integrated CallKit with NotificationManager to open AssistView on answer
- Supports optional parameters: caller_name, pipeline_id, auto_start_recording

Co-authored-by: bgoncal <[email protected]>
- Created test case JSON files for notification parser tests
- Added comprehensive documentation for using the call_assist command
- Included examples with various parameter combinations

Co-authored-by: bgoncal <[email protected]>
- Added thread-safe access to CallKit state using DispatchQueue
- Fixed race condition in call answer handler by capturing state atomically
- Improved error handling in NotificationManager with guard statement
- Prevents crash when no servers are available

Co-authored-by: bgoncal <[email protected]>
- Added error handling for webViewWindowControllerPromise failure
- Improved state clearing order in CallKit answer handler
- Clear state before delegate callback to prevent potential reuse
- Added explicit logging for promise failures

Co-authored-by: bgoncal <[email protected]>
- Added atomic captureAndClearState() method for thread-safe state transitions
- Added clearState() helper for atomic state clearing
- All state operations now happen within a single queue.sync block
- Prevents race conditions between reading and clearing state

Co-authored-by: bgoncal <[email protected]>
- Comprehensive overview of CallKit notification command feature
- Details on all files changed and their purposes
- Technical implementation details and architecture
- Code quality notes and future enhancement ideas

Co-authored-by: bgoncal <[email protected]>
Copilot AI changed the title [WIP] Add CallKit notification command to open AssistView Add CallKit notification command to open Assist Jan 16, 2026
Copilot AI requested a review from bgoncal January 16, 2026 23:30
Deleted documentation files related to the CallKit Assist command and implementation summary. Updated Xcode project to add CallKitManager.swift to the build and source groups. Refactored NotificationManager to use webViewControllerPromise for AssistView presentation. Cleaned up CallKitManager by removing hardcoded app name from provider configuration.
@bgoncal
Copy link
Member

bgoncal commented Jan 19, 2026

On hold until more clear vision of use cases for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants