FakeAiServerBehaviour enum
How a scripted server should answer a query.
Values
- succeed → const FakeAiServerBehaviour
-
Stream FakeAiServer.replies as assistant text blocks, then
done. - echoPrompt → const FakeAiServerBehaviour
-
Answer with the prompt that was received, as one assistant text block.
Lets a spawned fixture report what crossed the socket, which is the only way the standalone path's privacy test can inspect the wire: the child's own buffers are in another process.
- failWithError → const FakeAiServerBehaviour
-
Send a terminal
errorchunk. - slowDrip → const FakeAiServerBehaviour
-
Stream FakeAiServer.replies with FakeAiServer.dripInterval between them — a slow but live far end.
The one behaviour that can distinguish a gap bound from a total budget: a completion whose deltas are individually prompt but whose whole run is long must not be cut off.
- thinkAloudThenAnswer → const FakeAiServerBehaviour
-
Emit nothing but
stream_eventchunks for FakeAiServer.thinkingBeats beats of FakeAiServer.dripInterval, then answer in one block.This is what a real extended-thinking model looks like: no assistant message at all for a long time, and partial-message events as the only evidence it is alive. A stall bound that did not count them would kill exactly the completions worth waiting for.
- hang → const FakeAiServerBehaviour
-
Accept the query and never answer, so cancellation can be observed.
- rejectCredential → const FakeAiServerBehaviour
-
What the Agent SDK does with a credential the API rejects:
system/init, then onesystem/api_retryevent per FakeAiServer.dripInterval carryingerror_status: 401/error: authentication_failed, for as long as the query is left running.Shape copied from a real run (SDK 0.3.284, 2026-09-28): the real one gives up after ten attempts and about three minutes, which this fixture does not bother to imitate — the point is that the rejection is stated on the first event, not that it is eventually concluded.
- retryThenAnswer → const FakeAiServerBehaviour
-
A transient failure the SDK recovers from: FakeAiServer.thinkingBeats
system/api_retryevents carryingerror_status: 529/error: server_error, then the answer. - callTools → const FakeAiServerBehaviour
-
What the Agent SDK does with a query that declares in-process tools: one assistant message with FakeAiServer.replies' first entry and a
tool_useblock, then oneagentSdk.toolCallrequest per entry of FakeAiServer.toolCalls, sent back over the same socket and each awaited before the next, then an assistant message with the remaining replies, thendone. The client's answers land in FakeAiServer.toolAnswers. - replay → const FakeAiServerBehaviour
-
Send FakeAiServer.recorded — Agent SDK messages recorded from a live run (
test/agent_sdk/fixtures/sdk_messages/) — one chunk each, then end the stream.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
FakeAiServerBehaviour> - A constant List of the values in this enum, in order of their declaration.