reference

Terminal results

Field-by-field reference for the result data carried by completed, failed, and cancelled Kestrel runs.

Protocolbeginner0.7.0 Stable
Verified 2026-07-13View sourceReport a docs issue

Result shape

TypeScript
interface RunnerResultV2<TOutput = unknown> {
  output: TOutput;
  assistantText: string | null;
  finalizedPayload?: unknown;
  operatorAffordance?: unknown;
}
FieldRequiredMeaning
outputYesNormalized runtime and application result data
assistantTextYesHuman-facing assistant response, or null when none exists
finalizedPayloadNoStructured finalized data owned by the application contract
operatorAffordanceNoControl information for waiting or operator-managed work

An empty string is not valid assistantText. Structured data must never be converted into an invented assistant message.

Outcome handling

OutcomeEvent or statusConsumer behavior
Completedrun.completedStore the result and render non-null assistantText
Failedrun.failedPreserve safe failure details and any validated result data
Cancelledrun.cancelledRecord cancellation for the exact run
WaitingNormalized waiting statusShow the expected continuation and resume or cancel the same run
TypeScript
const result = terminal.payload.result;
 
if (result.assistantText !== null) {
  renderAssistant(result.assistantText);
}
 
storeStructuredResult(result.output, result.finalizedPayload);