Launch an LLM-background stage: rehydrate ctx from upstream +
parsed input, build the request via the shared seam, submit it via the
injected deps.submitBackgroundResponse, and return
{ responseId, status } WITHOUT awaiting completion.
Emits stage:start, stage:llm-request, and stage:llm-response-created
(from the submit's returned id) — but NO stage:llm-call / stage:end
(the completion side emits those, in a later invocation). The
per-stage event pair therefore spans two invocations; an onEvent
consumer must NOT assume a balanced start↔end per call.
deps.submitBackgroundResponse is REQUIRED; launchStage throws if it
is absent. stageId must name an LLM stage (built by llmStage);
a non-LLM stage throws. attempt (default 1) lets a re-launch rebuild
the retry-suffixed user message for attempt 2+.
Launch an LLM-background stage: rehydrate
ctxfromupstream+ parsed input, build the request via the shared seam, submit it via the injecteddeps.submitBackgroundResponse, and return{ responseId, status }WITHOUT awaiting completion.Emits
stage:start,stage:llm-request, andstage:llm-response-created(from the submit's returned id) — but NOstage:llm-call/stage:end(the completion side emits those, in a later invocation). The per-stage event pair therefore spans two invocations; anonEventconsumer must NOT assume a balanced start↔end per call.deps.submitBackgroundResponseis REQUIRED;launchStagethrows if it is absent.stageIdmust name an LLM stage (built byllmStage); a non-LLM stage throws.attempt(default 1) lets a re-launch rebuild the retry-suffixed user message for attempt 2+.