Skip to content

feat(agent): integrate Live voice session controls into AgentDemoScreen - #100

Merged
mingweiliao merged 2 commits into
android:mainfrom
juliantoledo:feat/live-chat-integration
Nov 23, 2026
Merged

mingweiliao merged 2 commits into
android:mainfrom
juliantoledo:feat/live-chat-integration

Conversation

@juliantoledo

Copy link
Copy Markdown
Contributor

Summary

Connects the chat UI (AgentDemoViewModel → AgentDemoScreen) to the VoiceInteractionSession Live voice overlay landed in #91:

  • AgentUiState & AgentDemoViewModel:
    • Observes LiveAgentOrchestrator.activeSession directly to expose liveStatus on the current thread and isAnotherThreadLiveBusy when another thread is using a Live session.
    • Checks CheckAudioPermissionUseCase and CheckVoiceServiceActiveUseCase before emitting LiveSetupPrompt.LaunchAssistSession(threadId, targetPackageName), and surfaces error dialogs if microphone permission is denied, assistant settings are unavailable, or Activity.showAssist(...) fails.
  • AgentDemoScreen:
    • Adds the Start Live Voice Session action in the chat input bar, passing the active threadId and optional @app target to Activity.showAssist(AgentVoiceInteractionSession.createSessionArgs(...)).
    • Disables conflicting text input while a Live voice session is active on the current thread.

Test Plan

  • ./gradlew spotlessCheck
  • ./gradlew test (AgentDemoViewModelTest)
  • ./gradlew validateScreenshotTest (AgentDemoScreenScreenshotTest)
  • ./gradlew assembleDebug assembleRelease

@juliantoledo
juliantoledo requested review from a team as code owners November 23, 2026 11:04
@mingweiliao

Copy link
Copy Markdown
Contributor

Thanks for wiring this up! One thing I'd like to change is how a Live session relates to the current thread.

Right now, tapping Live continues the current thread, but the session isn't really a continuation of it:

  • It uses a different model (models/gemini-3.8-live) from the one the thread shows.
  • It has no interaction ID linking it to the thread's earlier turns, so it actually starts a brand-new conversation, even though it looks like it's continuing.

Suggested direction: Start a new thread for Live. It's fine for Live to use a different model, but then it should get its own thread, recorded with the Live model, instead of being added to the current one.

WDYT?

@juliantoledo

Copy link
Copy Markdown
Contributor Author

Makes complete sense — updated in e2ae27e! Each new Live session now creates its own dedicated thread recorded with LiveLlmProvider.liveModel (gemini-3.8-live), both when launched from AgentDemoScreen and from the system Digital Assistant gesture (OnRetryClicked still reuses that session's thread). In AgentDemoScreen, Live threads display gemini-3.8-live as a voice transcript thread (disabling typed text / model mutation while keeping + Create Thread and starting a new Live session enabled).

@mingweiliao
mingweiliao merged commit 4634d62 into android:main Nov 23, 2026
11 checks passed
@juliantoledo
juliantoledo deleted the feat/live-chat-integration branch November 24, 2026 13:18
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.

2 participants