TtsrController class final
Orchestrates TTSR for one Agent.
Created once per agent (the CLI creates one next to the checkpoint
controller); the manager carries the rules. Detection rides the agent's
event stream: text/thinking/tool-call deltas feed TtsrManager.checkDelta;
a match aborts the stream immediately and schedules the inject+retry task
after TtsrSettings.retryDelay (omp's 50ms post-abort scheduling), so the
aborted run settles first. The retry is best-effort (omp semantics):
failures are swallowed and reported via onWarning.
Constructors
-
TtsrController({required Agent agent, required TtsrManager manager, TtsrSessionSink? sink, void onTriggered(List<
TtsrRule> rules)?, void onWarning(String message)?}) -
Creates a controller and attaches it to
agentvia Agent.subscribe.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- injectionsThisChain → int
-
Injection cycles fired in the current prompt-turn chain (the retry
storm guard counter; reset when a run completes without a TTSR abort).
no setter
- isAbortPending → bool
-
Whether a TTSR abort is pending (the stream was aborted to inject
rules; omp's
isTtsrAbortPending). UIs suppress the aborted-run error rendering while this is true.no setter - manager → TtsrManager
-
The rule manager backing this controller.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
settled
→ Future<
void> -
Resolves when no retry is scheduled or in flight and no abort is
pending. Hosts that batch-persist at run end (the CLI) await this
first so the transcript they persist includes the whole retry chain.
no setter
Methods
-
dispose(
) → void - Detaches from the agent and cancels any pending retry.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clears controller and manager state for a new session (omp builds a fresh manager per session): cancels a pending retry, drops queued injections, and clears the manager's injected-rule records so rules may fire again.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited