Skip to content
1 min read · 154 words

Function: renderOpenAIResponsesReasoningItem()

ts
function renderOpenAIResponsesReasoningItem(input: {
  prefixFingerprint: string;
  reasoningReplay: ReasoningReplayMode;
  replayCompatibility: readonly string[];
  thought: Thought;
  warn?: (msg: string) => void;
}): OpenAIResponsesReasoningItem | undefined;

Defined in: src/batteries/llm/openai_responses/helpers.ts:643

Implements OpenAIResponsesHelpers.renderOpenAIResponsesReasoningItem.

Parameters

ParameterType
input{ prefixFingerprint: string; reasoningReplay: ReasoningReplayMode; replayCompatibility: readonly string[]; thought: Thought; warn?: (msg: string) => void; }
input.prefixFingerprintstring
input.reasoningReplayReasoningReplayMode
input.replayCompatibilityreadonly string[]
input.thoughtThought
input.warn?(msg: string) => void

Returns

| OpenAIResponsesReasoningItem | undefined

Remarks

Converts an eligible stored OpenAIResponsesReasoningReplayPayload into a wire reasoning item, or undefined if ineligible (no payload, wrong variant, or a stale fingerprint). The adjacency-sweep pass in buildOpenAIResponsesInput is what actually enforces the reasoning/output-item pairing constraint (Known Gotcha #1) — this function only validates the signature/fingerprint half of eligibility.

Under reasoningReplay: 'summary-only', the returned item strips content (full reasoning text) and encrypted_content — only summary is replayed. 'encrypted' (or any other non-'off' mode) returns the stored item verbatim.