Files
orca/src/main/codex/codex-structured-session-journal.ts
T
OrcaWin 2847bbe9e8 [comment audit] Consolidate completed code comment cleanup
Combine the completed comment cleanup from 319 stacked PRs into one change against `main`, so the full CI suite validates the combined result once. This replaces the previous audit stack; no additional audit work is included.

The change shortens redundant comments across 2,753 source and shell-snapshot files (25,235 net lines removed). Conflicts preserve current-main executable code. Runtime behavior, test assertions, directives, licenses, generated notices, SAFETY rationales, and compatibility markers are preserved. The audit tracker remains local, outside the repository.

Validation:
- Equivalent source/emitted AST and executable tokens across all 2,750 source files, with separate checks for embedded shell, SQL, JavaScript, CSS, and generated fixtures.
- Identical executable lines in the three shell snapshots; protected comments unchanged.
- Changed-code quality gate passed with no new findings.
- 358 tests passed, 2 skipped across 23 focused test files.
- `git diff --check` passed.
2026-10-23 13:15:45 -07:00

44 lines
2.0 KiB
TypeScript

import type { AgentSessionAccountKind } from '../../shared/agent-session-availability'
import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink'
import type { CodexDispatchEchoes } from './codex-structured-dispatch-echo'
import { createCodexJournalTranslator } from './codex-structured-journal-translation'
import type { CodexSubagentExecutions } from './codex-subagent-executions'
import type {
CodexAcquisitionAttempt,
CodexStructuredSessionAdapterDeps
} from './codex-structured-session-state'
export function createCodexSessionJournalTranslator(input: {
sink: StructuredAgentSessionEventSink | undefined
account: () => AgentSessionAccountKind | undefined
sessionId: string
acquisitionId: string
deps: CodexStructuredSessionAdapterDeps
primaryThreadId: () => string | null
dispatchEchoes: CodexDispatchEchoes
subagentExecutions: CodexSubagentExecutions
prompts: CodexAcquisitionAttempt['window']['prompts']
}) {
const { sink, account, sessionId, acquisitionId, deps, dispatchEchoes, prompts } = input
return sink
? createCodexJournalTranslator({
sink,
account,
sessionId,
acquisitionId,
...(deps.now ? { now: deps.now } : {}),
primaryThreadId: input.primaryThreadId,
dispatchRequestOrigin: (clientMessageId) => dispatchEchoes.requestOrigin(clientMessageId),
subagentExecutions: input.subagentExecutions,
bindPromptItemId: (journalItemId, threadId, promptKey, turnId) =>
prompts.bindJournalItemId(journalItemId, threadId, promptKey, turnId),
clearPromptTurn: (threadId, turnId) => prompts.clearTurn(threadId, turnId),
onUserMessageEcho: (clientMessageId, providerIdentity) => {
// Duplicate exact echoes retry receipt persistence while the send remains unsettled.
dispatchEchoes.settle(clientMessageId)
deps.onDispatchSettledLate?.({ sessionId, clientMessageId, providerIdentity })
}
})
: null
}