fix: trace codex stdio lifecycle
This commit is contained in:
+13
-1
@@ -1,4 +1,4 @@
|
||||
import type { BackendEvent, BackendTurnResult, CommandRecord, InitialPromptAssembly, RunRecord } from "../common/types.js";
|
||||
import type { BackendEvent, BackendTurnResult, CommandRecord, InitialPromptAssembly, JsonRecord, RunRecord } from "../common/types.js";
|
||||
import { CodexStdioBackendSession, runCodexStdioTurn, type CodexStdioTurnOptions } from "./codex-stdio.js";
|
||||
import { backendProfileSpec } from "../common/backend-profiles.js";
|
||||
|
||||
@@ -16,6 +16,17 @@ export interface BackendAdapterOptions {
|
||||
workspacePath?: string;
|
||||
abortSignal?: AbortSignal;
|
||||
initialPrompt?: InitialPromptAssembly;
|
||||
otelContext?: {
|
||||
run: RunRecord;
|
||||
command: CommandRecord;
|
||||
attemptId?: string | null;
|
||||
runnerId?: string | null;
|
||||
runnerJobId?: string | null;
|
||||
jobName?: string | null;
|
||||
podName?: string | null;
|
||||
sourceCommit?: string | null;
|
||||
logPath?: string | null;
|
||||
} & JsonRecord;
|
||||
onEvent?: (event: BackendEvent) => void | Promise<void>;
|
||||
onActiveTurn?: (control: BackendActiveTurnControl) => void | (() => void);
|
||||
env?: NodeJS.ProcessEnv;
|
||||
@@ -64,6 +75,7 @@ export function backendTurnOptions(run: RunRecord, command: CommandRecord, optio
|
||||
if (options.codexArgs) turnOptions.args = options.codexArgs;
|
||||
if (options.env) turnOptions.env = options.env;
|
||||
if (options.initialPrompt) turnOptions.initialPrompt = options.initialPrompt;
|
||||
if (options.otelContext) turnOptions.otelContext = options.otelContext;
|
||||
if (options.codexHome) turnOptions.codexHome = options.codexHome;
|
||||
if (options.abortSignal) turnOptions.abortSignal = options.abortSignal;
|
||||
if (options.onEvent) turnOptions.onEvent = options.onEvent;
|
||||
|
||||
Reference in New Issue
Block a user