Skip to content

Commit 46792be

Browse files
authored
Refactor create method and logDebug function
1 parent 09edcf4 commit 46792be

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/integrations/codex/run.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,7 @@ export class CodexCliSession {
293293
}
294294
}
295295

296-
/**
297-
* Creates a new Codex CLI session for interactive communication
298-
* @param options - Configuration options for the CLI session
299-
* @param options.cliPath - Optional custom path to the Codex CLI binary
300-
* @param options.args - Optional CLI arguments to pass
301-
* @param options.debugEnabled - Enable debug logging
302-
* @param options.debugLogPath - Custom path for debug logs
303-
* @param options.allowNetworkAccess - Allow network access in the session
304-
* @returns Promise resolving to an initialized CodexCliSession
305-
* @throws Error if Codex CLI is not found or fails to initialize
306-
*/
307-
static async create(options: CodexCliSessionOptions): Promise<CodexCliSession> {
296+
static async create(options: CodexCliSessionOptions): Promise<CodexCliSession> {
308297
const resolvedCliPath = await resolveCodexCliPath(options.cliPath)
309298
if (!resolvedCliPath) {
310299
throw new Error("Codex CLI not found. Please install @openai/codex or specify codexCliPath in settings.")
@@ -331,13 +320,7 @@ static async create(options: CodexCliSessionOptions): Promise<CodexCliSession> {
331320
if (!this.debugEnabled) return
332321
const timestamped = `[${new Date().toISOString()}] ${line}`
333322
if (this.logFileStream) {
334-
if (this.logFileStream) {
335-
try {
336-
this.logFileStream.write(`${timestamped}${os.EOL}`)
337-
} catch (error) {
338-
console.warn("Failed to write to Codex debug log stream:", error)
339-
}
340-
}
323+
this.logFileStream.write(`${timestamped}${os.EOL}`)
341324
} else {
342325
try {
343326
fs.appendFileSync(this.debugLogPath, `${timestamped}${os.EOL}`)

0 commit comments

Comments
 (0)