Dashboard › opencode-lore › Distillation
f6e2388f-ae77-4c4b-8ac6-4c10a3bcd9c1["lore_tm_v1_55YxoBN_MCprcZoip-u2aIaZitAC8n4qPiGKbaTJsX4","lore_tm_v1_g6JK_F6RowF4CM1an2V1zvibneo0Tde7JZ5_PLjE07Q","lore_tm_v1_uA5dKDWPEbW5zIGABSpvu8tQ7B_hExtKQTWgUfWJobU"]
Date: Sep 16, 2026
packages/gateway/test/openai-responses-recall-aware-stream.test.ts:2310-2377 showed a Codex-validation test for private direct recall promotion under tight limits: maxDeferredBytes: 16 * 1024, maxHiddenRecallBytes: 1, and maxRetainedStateBytes: 64 * 1024. A function call fc_sparse_promotion_limit / call_sparse_promotion_limit contains query "private direct promotion query"; expected behavior is PUBLIC_RECALL_ERROR without PUBLIC_GATEWAY_ERROR, no private query or function/call IDs in streamed output or completedResponse, recallCalls === 0, successful === false, and runFollowUp must not run.seeds data-only Codex items on principal and continuation streams at packages/gateway/test/openai-responses-recall-aware-stream.test.ts:2379-2470 covers a principal stream whose text events omit output_index, then invokes recallCall(1, { query: "data-only" }); onRecall extracts accumulated text and must see "principal preamble"."continuation answer" through response.output_text.delta/done, then emits done-only function-call data for fc_data_only_followup with call_id: "call_data_only_followup", name: "read", and arguments: '{"path":"file"}'; its terminal output contains { type: "item_reference", id: "fc_data_only_followup" }. Expected output includes "continuation answer" and "name":"read", excludes PUBLIC_RECALL_ERROR, and the completed response contains { type: "tool_use", id: "call_data_only_followup", name: "read", input: { path: "file" } }.packages/gateway/test/openai-responses-recall-aware-stream.test.ts:2472 is titled forwards a principal data-only non-recall tool after its name resolves; the visible setup begins with response.function_call_arguments.done for item_id: "fc_data_only_visible" and arguments: '{"path":"file"}'.normalizeCodexResponsesEvent( at packages/gateway/src/stream/openai-responses.ts:1750.packages/gateway/src/stream/openai-responses.ts:1640-1659 validates sparse Codex fields: optional content_index must be a safe integer in [0, maxSparseIndex), optional sequence_number must be a nonnegative safe integer, and optional item_id must be a string; violations call malformedResponsesEvent().packages/gateway/src/stream/openai-responses.ts:1661-1706 requires parsed.response to be a record for response.created, response.in_progress, response.failed, response.completed, response.incomplete, and response.done; optional terminal id, model, and status must be strings, id and model must match established state, response.created permits status "in_progress" or "queued", and response.in_progress permits only "in_progress".packages/gateway/src/stream/openai-responses.ts:1708-1742 routes response.output_item.added/done through normalizeCodexItemEvent(...); content-part, output-text, refusal, and function-call-argument events through normalizeCodexDataEvent(...); and requires the corresponding payload fields (delta, text, refusal, or arguments) to be strings.packages/gateway/src/stream/openai-responses.ts:1745-1749 states that normalizeCodexResponsesEvent() advances an independent normalization state and that callers accumulating the same event must use a separate state because the Codex normalizer binds omitted indices and may seed done-only items.normalizeCodexResponsesEvent(state, event, parsed, maxSparseIndex = DEFAULT_MAX_SSE_FRAMES) at packages/gateway/src/stream/openai-responses.ts:1750-1789 first calls validateCodexResponsesEvent(...); rejects function-call argument delta/done events after the indexed item is in state.argumentDoneItems; records argument-done indices before calling applyResponsesEvent(...); records text/refusal done indices afterward; binds an added tool itemβs effective identity using item.callId || item.id; and on response.output_item.done removes the index from activeTextItems, activeToolItems, unboundTextItems, and unboundToolItems.validatedTerminalStatus(...) at packages/gateway/src/stream/openai-responses.ts:1791-1829 validates terminal response shape, string status, incomplete_details record shape, and string incomplete_details.reason; public validation rejects missing/empty compatibility status, absent non-public status defaults to "incomplete" for response.incomplete and "completed" otherwise, and statuses "failed" or "cancelled" throw Responses terminal reported failure.