proposit-core
    Preparing search index...

    Function completeStage

    • Complete an LLM-background stage from its retrieved response. Recovers the stage's LLM config, parses the RAW assistant text in retrieved.output against the stage's schema (via the shared seam), classifies a non-completed status per the launch/complete table, and returns the standard TExecuteStageResult.

      Emits stage:llm-call + stage:end (NO stage:start — that fired in the launch invocation). tokenUsage is taken directly from retrieved.tokenUsage (the per-ctx WeakMap cannot bridge the two invocations). On a RETRYABLE failure the result carries retryReason (the reason code); a fail-fast failure (failed envelope, content_filter) carries none; a cancelled response settles as outcome: "skipped" with no ProcessingFailure.

      stageId must name an LLM stage; a non-LLM stage throws.

      Parameters

      Returns Promise<TExecuteStageResult>