InteractionStatistics
ReferencesTracks what the AI conversation loop has been doing on a given AiComponent: the current phase plus running counters for each kind of event (model calls, docs lookups, clarifications, compilation attempts, various failure modes). Also owns the lifecycle handle for the current run -- the SolutionId identifying it and the CancellationToken that aborts it. The component's attributes class draws from this state. Every property setter fires Changed on a real change. The owning component subscribes once and invalidates the canvas on Changed, so the drawing refreshes automatically as the loop progresses.
Properties
IsBusy
#True when the conversation loop is mid-flight: the model is being called, a tool result is being computed, a clarification dialog is open, or Roslyn is compiling. False when idle or terminal.
ShapeFailures
#Submissions that compiled but didn't expose exactly one concrete AiComponentLogic subclass.
State
#Methods
BeginRun
#Start a new run: cancel any prior in-flight run, allocate a fresh SolutionId and CancellationTokenSource, reset State to InteractionState.Idle, and return the token to thread through any awaitable work.
Parameters:
| id (out SolutionId) |
CancelCurrentRun
#public void CancelCurrentRun()
Cancel the in-flight run (if any): trip the token, mark the id as cancelled in the global registry, dispose the source, and move State to InteractionState.AbortedByUser so the busy icon clears. Safe to call when no run is active -- a no-op in that case.
EndRun
#Tear down the CTS at the end of a normal run. Only acts when the supplied id still matches RunId; if a newer run has already replaced it, this is a no-op (the newer run owns the source).
Parameters:
| id (SolutionId) |