Repository navigation
App assistant: StopAssistantTurn - #956
Closed
Michael Lee (michaellee1019) wants to merge 14 commits into
Closed
Michael Lee (michaellee1019) wants to merge 14 commits into
Michael Lee (michaellee1019) wants to merge 14 commits into
Conversation
AppAssistantService is the shared chat contract for the web app and Viam mobile: one server stream for a turn, plus list and get for the server-owned transcript. Approval and client-tool pauses end the stream so a phone can drop the connection while a person decides. Co-authored-by: Michael Lee <michaellee1019@gmail.com>
GetConversationResponse now returns the open client tool and the stored conversation context. ApprovalRequired carries a structured diff. List conversations is defined as newest updated_at first. Co-authored-by: Michael Lee <michaellee1019@gmail.com>
The app server never sends approval_required and refuses an approval input: a staged change is confirmed with the builder's Save, and backend writes run on the call. The API is unreleased, so the remaining fields take the freed numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
ListModels lists the models a conversation can use, and StreamTurn takes one in model. Each stream that ran the model reports the conversation's billed cost and, to a caller who may see it, the paying organization's month-to-date AI cost. GetConversation returns the conversation's model and cost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
The per-conversation cost is dropped from TurnUsage and GetConversation. The API is unreleased, so the remaining field takes the freed number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
The four RPCs move from their own AppAssistantService into AppService as StreamAssistantTurn, ListAssistantConversations, GetAssistantConversation and ListAssistantModels, so the app's existing routes carry them. Their messages move into viam.app.v1 with an Assistant prefix, and the stream's response is StreamAssistantTurnResponse, so the lint exception goes away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
- A text delta carries its block index, and complete names the first block of the final answer, so a client can collapse the narration. - A transcript reply holds its steps (narration and tool calls) and how long it took, so a reopened chat shows the work behind each answer. - GetAssistantConversation and the list say whether a turn is running. A turn finishes on the server when the client disconnects. - Failed RPCs carry an AssistantError detail with a typed reason, and the stop reason is an enum, so clients never match message text. - ListAssistantConversations is paginated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
AssistantMessageRole replaces the free-form "user" / "assistant" string, so clients branch on a typed value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
…viamrobotics/api into cursor/app-assistant-proto-b580
- StopAssistantTurn stops the turn running in a conversation, which a client cannot do by closing a stream that the turn outlives. The turn ends with ASSISTANT_STOP_REASON_STOPPED. - StreamAssistantTurnRequest.client names the app the user chats from, so the assistant describes where it is and asks only for client tools that app runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
The assistant goes by the conversation context alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
Member
Author
|
Folded into #941 at your request: its branch now includes this PR's commits ( Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to the App assistant API in viamrobotics/api#941. This branch is based on #941, so until that merges the diff includes it. The changes this PR adds are its own commits.
Stopping a turn
A turn keeps running on the server after its stream closes, so a phone can background without losing the reply. That also means closing the stream no longer stops it. A server-streaming RPC takes a single request, so there is no way to send "stop" on the same stream.
StopAssistantTurn(conversation_id)stops the turn running in one of the caller's conversations.ASSISTANT_STOP_REASON_STOPPED, and the steps it finished are kept.https://claude.ai/code/session_01JLuWqczk3u5gmMh7nSxMA1
Generated by Claude Code