HarnessContext
HarnessContext =
object
Runtime context passed from the eval fixture into a harness run.
Example
Section titled “Example”const harness: Harness<string> = { name: "refund-agent", async run(input, context) { context.setArtifact("inputLength", input.length);
return { output: undefined, session: { events: [{ type: "message", role: "user", content: input }] }, usage: {}, errors: [], }; },};Properties
Section titled “Properties”artifacts
Section titled “artifacts”artifacts:
Record<string,JsonValue>
Mutable JSON-safe artifact bag shared with the harness.
setArtifact
Section titled “setArtifact”setArtifact: (
name,value) =>void
Stores one JSON-safe artifact on the current run.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Abort signal from Vitest when available.