Expand description
UserSimulator trait and shipped simulator implementations
(plan §12.3, §12.4).
A simulator stands in for a human user during a [ConversationLoop]
run: it produces an initial message from the task, then responds to
each assistant turn with either UserAction::Say (send a follow-up)
or UserAction::EndConversation (terminate the loop).
Simulators receive a oharness_core::ConversationView — not raw
messages — so they can call .user_visible() to strip internal
reasoning / tool calls / tool results and respond only to the
human-facing thread. Simulators that want stricter or looser views
can compose their own.
Structs§
- LlmUser
Simulator - A simulator that drives a user LLM with a persona + template. Each
respondcall builds aCompletionRequestwhose system prompt is the renderedprompt_template(with{persona}and{task}substituted) and whose user message is the serialized conversation so far. - Scripted
User Simulator - A simulator that replays a fixed sequence of user utterances. The
first entry is returned from
UserSimulator::initial_message; each subsequent call toUserSimulator::respondreturns the next entry,UserAction::Say-wrapped, until the script is exhausted — at which point the simulator returnsUserAction::EndConversation.
Enums§
- User
Action - What the simulator wants to do next.
- User
Error - Simulator-side errors. Any error here is promoted to
Termination::Failed { reason: "user_simulator_error" }by the [ConversationLoop] — simulators cannot silently fall back toUserAction::EndConversationsince that would hide bugs.