Add human handoff, CSAT capture, and escalation-aware chat state - #11
Merged
Conversation
Handles the three new backend SSE event types (session_escalated,
human_message, feedback_requested) and the new human_agent message role:
renders an escalated-state banner, a distinct human-agent message bubble,
and a post-turn CSAT prompt. Adds ResolveKitAPIClient.submitFeedback for
POST /v1/sessions/{id}/feedback.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feedback_requested fired the rating prompt the moment the event arrived, even mid-conversation (e.g. right after "Hi" -> a generic greeting). Wait a few seconds before showing it, and cancel if the user sends another message in the meantime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
session_escalated now cancels any CSAT prompt still pending from the AI's last reply -- it shouldn't surface while the user is waiting on a human handoff. feedback_requested's new "immediate" flag (true only for the human-resolve trigger) skips the debounce and shows the prompt right away, since that signal means the conversation is definitively over. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ResolveKitRuntime.reloadWithNewSession() already existed, and the Android sample already exposes it, but the iOS sample's toolbar only had "Done" -- there was no way to start a fresh session without force- quitting the app. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Give the user more room to keep chatting before the rating prompt interrupts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
scripts/check_agent_docs.sh requires AGENTS.md to reference both docs/INDEX.md and docs/agent-first/README.md -- neither was linked, which was failing the required build-and-test check on main itself, independent of this branch's actual changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
swiftlint was never installed on the macOS runner (no setup step), so the required build-and-test check has been failing with "command not found" on every run, including main -- independent of any code changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Client-side support for the backend's new human-handoff/CSAT features:
session_escalated,human_message,feedback_requested(with animmediateflag distinguishing an AI-turn-triggered CSAT prompt from a definitive human-resolve trigger).Role.humanAgentmessage bubble, escalated-state banner,ResolveKitRuntime.submitFeedback/dismissFeedbackRequest.reloadWithNewSession()API was never wired up in the sample's toolbar).Test plan
swift build— cleanswift test— 94/94 passed