proposit-core
    Preparing search index...

    Function launchStage

    • 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+.

      Parameters

      Returns Promise<TLaunchStageResult>