Creates the handle of a run that has not started yet.
The client of the adapter.
The run.
The run's thread.
Outbox, settings and the onWaiting callback.
ReadonlyclientThe client of the adapter.
true once RunHandle.finish ran.
ReadonlyoutboxThe outbox for replies.
ReadonlyrunThe run.
ReadonlythreadThe run's thread.
The jti of the token the run started or resumed with (undefined before).
true while the run waits for input.
Aborted when the run was cancelled or ended on the server; hand it to the runtime so its
work stops (run.cancel_requested, run_not_active, run_inactive).
The live-box patcher.
The patcher once the run started, else undefined.
The run document version the patcher works on (0 before the start).
Waits for a person (awaitRunInput); the run goes to waiting_input.
Pending patches are sent first. The adapter resumes the run with the token of the next follow-up or interaction.
What the run waits for.
A promise that resolves when the run waits.
ProblemError when the patch or awaitRunInput was refused.
Ends the run (finishRun) after sending pending patches.
A final flush refused by the server or without an answer is dropped, and a finishRun answered with run_inactive or
run_not_active counts as already ended, not as an error; the server answers a repeated
equal end state with 200. A second call does nothing.
completed, failed or cancelled.
reason, summary, metrics and costs.
A promise that resolves when the run has ended.
ProblemError for another refusal of the server.
Loads the run context (getRunContext); render it with renderContext.
The context.
ProblemError when the server refused.
Registers a callback for the cancellation; after it, the callback runs at once.
Called once when the run is cancelled or ended on the server.
A function that removes the callback.
Reports the agent session of this run in its thread (reportAgentSession, 09 9.1 and
9.5).
If-Match is the compare-and-swap over the session row's version: absent when the run has
no row yet (the report creates it), otherwise the version of the row. Each call carries a
fresh Idempotency-Key, so the client may repeat it after a lost answer.
The AgentSessionReport (external_session_ref, model, started,
bind_failed).
ifMatch, the row version.
The session row; its version is the next ifMatch.
ProblemError, for example 412 version_conflict or 409 conflict with
session_bound_elsewhere, session_changed or session_not_bound.
Marks the run as cancelled and calls the cancel callbacks (once).
The adapter calls it for run.cancel_requested; the patcher calls it when the server says
the run has ended.
Notes that startRun or resumeRun answered 200 with run.
The answered run (its version is the patch base).
The jti the run started or resumed with.
What a handler gets for one run: patches, context, input, the end and replies.
The adapter creates it before
prepare(the run is stillqueued) and starts the patcher oncestartRunorresumeRunanswered; inside the handler every request of the client is bound to the run (07 SR9).