microfoom
API referenceInterfaces

HarnessSession

Interface: HarnessSession

Defined in: packages/microfoom-core/src/session.ts:104

The PUBLIC harness contract (F6). A session runs one model turn: it drives the model, executes the supplied tools (calling their execute), and resolves when the turn settles (a tool signalled terminate, or the model produced no tool call). Signal failures by throwing FoomtimeHarnessError subclasses; honor request.signal.

Methods

fork()?

optional fork(): HarnessSession;

Defined in: packages/microfoom-core/src/session.ts:120

Branch this session: return a NEW session seeded with a copy of the current transcript, diverging independently from here (backs AgentSession.fork()). Optional — a harness that can't clone its conversation state omits it, and core's fork() then throws FoomtimeConfigError.

Returns

HarnessSession


runTurn()

runTurn(request): Promise<SessionTurnResult>;

Defined in: packages/microfoom-core/src/session.ts:105

Parameters

ParameterType
requestSessionTurnRequest

Returns

Promise<SessionTurnResult>


systemPrompt()?

optional systemPrompt(programPrompt): string;

Defined in: packages/microfoom-core/src/session.ts:113

The full system prompt this session will actually send the model for a given program prompt — e.g. a harness that prepends its own base prompt returns base + programPrompt. For display/observability only (the runtime shows this as the turn's system prompt); the same composition is applied inside runTurn. Omit when the session sends the program prompt verbatim.

Parameters

ParameterType
programPromptstring

Returns

string

On this page