StepExecutorContext
Namespace: E2E
public class StepExecutorContextWhat an executor receives for one step (upstream’s StepExecutorContext). The runtime builds it. A test of an
executor can build its own and override the members it reads: each one that does work throws until it is overridden.
Inheritance: object
Properties
Section titled “Properties”Actions
Section titled “Actions”public required IExecutorActions Actions { get; init; }Value: IExecutorActions
AgentContext
Section titled “AgentContext”public string? AgentContext { get; init; }Trusted project/test context, redacted: the agent’s Context, then the test’s agentContext, one per line. Null when
both are blank.
Value: string
Attempt
Section titled “Attempt”public required ExecutorAttempt Attempt { get; init; }The attempt this step runs in: its identity, the signal that ends it, and the scratch memory.
Value: ExecutorAttempt
Budgets
Section titled “Budgets”public required IExecutorBudgets Budgets { get; init; }Value: IExecutorBudgets
Ledger
Section titled “Ledger”public string Ledger { get; init; }The completed earlier steps of this attempt, serialized for prompt context, one per line, oldest first. Empty when none.
Value: string
public IAgentModel? Model { get; init; }The model the agent’s entry is configured with, or the one the executor brought. Null when there is none.
Value: IAgentModel
PixelsTainted
Section titled “PixelsTainted”public virtual bool PixelsTainted { get; }True once a secret was filled in this attempt: CancellationToken) withholds pixels from the model for the rest of it. An
executor reads it when it assembles its vocabulary, to leave screenshot tools out rather than offer tools that can
only decline.
Value: bool
ProviderOptions
Section titled “ProviderOptions”public IReadOnlyDictionary<string, JsonElement>? ProviderOptions { get; init; }The agent’s provider options, keyed by provider. The built-in executor sends them with every model call unless it was given its own.
Value: IReadOnlyDictionary<string, JsonElement>
ReplayedPrefix
Section titled “ReplayedPrefix”public ReplayedPrefix? ReplayedPrefix { get; init; }Present when a cached replay ran part of this step before it handed the step over.
Value: ReplayedPrefix
public required ExecutorStep Step { get; init; }Value: ExecutorStep
Target
Section titled “Target”public required ExecutorTargetInfo Target { get; init; }The target this step runs on.
Value: ExecutorTargetInfo
Methods
Section titled “Methods”AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)
Section titled “AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)”public virtual Task<string> AttachScreenshotAsync(ExecutorPixels pixels, string label, CancellationToken cancellationToken = default)Keeps pixels the executor or one of its tools observed as a screenshot of the step in progress, and returns the path of the file, relative to the project root. The file is named by <code class=“paramref”>label</code> and lands in the attempt’s results directory. For a tool with evidence worth keeping.
Parameters
| Name | Type | Description |
|---|---|---|
pixels |
ExecutorPixels | |
label |
string | |
cancellationToken |
CancellationToken |
Returns: Task<string>
AttachTranscript(string)
Section titled “AttachTranscript(string)”public virtual void AttachTranscript(string text)Attaches the executor’s model transcript to the step. It is written to the results directory as a log file
when the attempt keeps results, and dropped otherwise. Call it once, at the end.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
AttachTurns(IReadOnlyList<StepTurn>)
Section titled “AttachTurns(IReadOnlyList<StepTurn>)”public virtual void AttachTurns(IReadOnlyList<StepTurn> turns)Keeps a bounded record of the step’s model turns on the step record: each turn’s tool calls and what came back, clipped. The report shows the last turns under a failed step, so a reader sees what the model did and saw without the transcript. Call it as each turn ends; the last call wins.
Parameters
| Name | Type | Description |
|---|---|---|
turns |
IReadOnlyList<StepTurn> |
ObserveAsync(ExecutorObserveOptions?, CancellationToken)
Section titled “ObserveAsync(ExecutorObserveOptions?, CancellationToken)”public virtual Task<ExecutorObservation> ObserveAsync(ExecutorObserveOptions? options = null, CancellationToken cancellationToken = default)Captures one fresh, redacted observation. The text is always present; the tree and the pixels are opt-in, so an executor that renders its own view of the screen asks for exactly what it uses.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ExecutorObserveOptions | |
cancellationToken |
CancellationToken |
Returns: Task<ExecutorObservation>