Skip to main content

Module 06: Update Types

Comprehensive coverage of all SessionUpdate types in ACP.

What You’ll Learn

  • All SessionUpdate types and when they appear
  • Dispatching on update types with instanceof
  • Building rich UIs that show agent activity

The Code

The client registers a sessionUpdateHandler and uses instanceof to handle each type:

Update Types Reference

This module extends Module 05 by handling every update type rather than just messages.

Source Code

View on GitHub

Running the Example

Requires the Grok CLI on your PATH, signed in once with grok login. The module launches it as grok agent stdio; no API key is needed.

Next Module

Module 07: Agent Requests — handle file read/write requests from agents.