mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
feat(codex): use hook to obtain the session id and transcript path
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { logger } from '@/ui/logger';
|
||||
import { spawnWithTerminalGuard } from '@/utils/spawnWithTerminalGuard';
|
||||
import { buildMcpServerConfigArgs, buildDeveloperInstructionsArg } from './utils/codexMcpConfig';
|
||||
import {
|
||||
buildMcpServerConfigArgs,
|
||||
buildDeveloperInstructionsArg,
|
||||
buildSessionStartHookConfigArgs
|
||||
} from './utils/codexMcpConfig';
|
||||
import { codexSystemPrompt } from './utils/systemPrompt';
|
||||
import type { ReasoningEffort } from './appServerTypes';
|
||||
|
||||
@@ -33,6 +37,10 @@ export async function codexLocal(opts: {
|
||||
onSessionFound: (id: string) => void;
|
||||
codexArgs?: string[];
|
||||
mcpServers?: Record<string, { command: string; args: string[] }>;
|
||||
sessionHook?: {
|
||||
port: number;
|
||||
token: string;
|
||||
};
|
||||
}): Promise<void> {
|
||||
const args: string[] = [];
|
||||
|
||||
@@ -58,6 +66,10 @@ export async function codexLocal(opts: {
|
||||
args.push(...buildMcpServerConfigArgs(opts.mcpServers));
|
||||
}
|
||||
|
||||
if (opts.sessionHook) {
|
||||
args.push(...buildSessionStartHookConfigArgs(opts.sessionHook.port, opts.sessionHook.token));
|
||||
}
|
||||
|
||||
// Add developer instructions (system prompt)
|
||||
args.push(...buildDeveloperInstructionsArg(codexSystemPrompt));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user