Repository navigation
feat(ui): chat holds a tool call that changes something until the reader allows it - #378
Merged
Michael McQuade (giraffesyo) merged 4 commits intoOct 20, 2026
Merged
Conversation
…pprovals # Conflicts: # packages/ui/src/ai/components/ChatMessage.test.tsx # packages/ui/src/ai/components/ChatMessage.tsx # packages/ui/src/ai/components/ChatThread.tsx
This was referenced Oct 20, 2026
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.
Summary
Lets a chat gateway offer tools that change something (stop a cluster, cancel a run) without running them on the model's say-so. The gateway holds such a call until the reader allows it.
The flow
toolApprovalchunk (toolCallId, optionalexpiresAt) in place of a result, and ends the reply.expiresAtthe card says the request expired.useChat().answerToolApprovalas a request with no new user turn.StreamRequest.resume(messageId,toolCallId,allowed, optionalfeedback) is sent asresumein the body.toolResultfor the call lands on the reply that paused, and the model's answer streams as a new reply under it. History replays as usual, because the paused reply now holds a finished call.tool_decisionon the call, and the answered card gives way to that line.Allowing the call, then the answer:
answer-flow.mp4
Shared conversations. A tool runs with the access of whoever sent the message, so:
Also
ChatToolOption.asksFirstmarks such a tool in the + menu and the tools modal ("Asks first").ToolCallStatusgains'waiting', with atool_waitpart delta;ApprovalPartgainsexpiresAtandwaitingOn.approvalRequestExpired, becauseapprovalExpiredis now the decision line's label.sendMessage's streaming now lives in one helper that resuming shares, and the history mapping is one function.Testing
make checkpasses (566 tests insrc/ai, including new ones for thetoolApprovalchunk, theresumebody,tool_wait, resuming onto the paused reply, deny feedback, expiry, who may answer, the "as Bob" label, and the decision recorded on answering).Checklist
make checkpassesproblem/messages/(none changed)