Add human handoff, CSAT capture, and escalation-aware chat state - #18
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. 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>
Give the user more room to keep chatting before the rating prompt interrupts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The sample module (and therefore :ui, which it depends on) has never actually compiled in a clean environment: - kotlinCompilerExtensionVersion 1.5.8 (in :ui and :sample) is only certified for Kotlin 1.9.22, but gradle/libs.versions.toml pins Kotlin 1.9.25. Bumped to 1.5.15, the compatible Compose Compiler for that Kotlin version. - ksp was pinned to 1.9.22-1.0.17, incompatible with Kotlin 1.9.25 for the same reason. Bumped to 1.9.25-1.0.20. - Sample source had drifted from current :core/:ui APIs: ResolveKitFunctionPack.id -> packName (+ missing supportedPlatforms), a missing ResolveKitChatActivity import, rememberSaveable imported from the wrong package, and a resolveKitParametersSchema type mismatch (Map<String, Any> vs the JSONObject typealias). - AndroidManifest.xml was missing usesCleartextTraffic="true", so every plain-HTTP request (used for staging/local dev, same as the iOS sample's NSAllowsArbitraryLoads) was silently blocked by Android. Verified via a full clean build + running on an emulator against the staging backend: session creation, message history, and SSE reconnect all work correctly end to end. 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 check on main itself, independent of this branch's actual changes. Also corrected the documented Kotlin version (1.9.22 -> 1.9.25) to match gradle/libs.versions.toml. 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, mirroring the iOS SDK:
SessionEscalated,HumanMessage,FeedbackRequested(with animmediateflag distinguishing an AI-turn-triggered CSAT prompt from a definitive human-resolve trigger).ChatMessageRole.HUMAN_AGENTmessage bubble, escalated-state banner,ResolveKitRuntime.submitFeedback/dismissFeedbackRequest.:core/:ui(missing import, renamed interface members, wrongrememberSaveablepackage) and a missingusesCleartextTrafficmanifest exception needed to reach the staging backend over plain HTTP.Test plan
:networkingmodule compiles and its unit tests pass:sample:assembleDebugbuild succeeds (previously never worked in this repo)