Finished

data class Finished(val threadId: String, val runId: String, val result: JsonElement? = null, val interrupts: List<UiInterrupt> = emptyList()) : RunState

The run finished.

This is the run's verdict, not the turn's. A client that executes tools answers a finished run with another run carrying the results, so a transcript can read Finished while a tool is still executing and again between that run and the next; a UI gating on "the agent is done" gates on the call that started the exchange returning, not on this.

Constructors

Link copied to clipboard
constructor(threadId: String, runId: String, result: JsonElement? = null, interrupts: List<UiInterrupt> = emptyList())

Properties

Link copied to clipboard

Whether the run stopped to wait for the client rather than because it was done.

Link copied to clipboard

what the run stopped to ask for, when it stopped to ask rather than because it was done. Empty for a run that was done. Every one of these has to be answered -- or abandoned -- by the next run on the thread before that run starts; the protocol has no other way past an interrupt, and agui-agent's AgentSession.resume is the call that answers them.

Link copied to clipboard

What the thread is waiting on: the interrupts of a RunState.Finished that stopped to ask, and nothing for any other state. A renderer that draws the questions asks this rather than casting.

Link copied to clipboard
val result: JsonElement?

whatever the agent returned with RUN_FINISHED, which the protocol leaves untyped.

Link copied to clipboard
Link copied to clipboard