Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/CodexAcpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class CodexAcpServer {
private readonly getRecentStderr: () => string;
private readonly availableCommands: CodexCommands;
private clientInfo: acp.Implementation | null;
private clientCapabilities: acp.ClientCapabilities | null;
private terminalOutputMode: TerminalOutputMode;
private booleanConfigOptionsSupported: boolean;

Expand Down Expand Up @@ -175,6 +176,7 @@ export class CodexAcpServer {
this.getExitCode = getExitCode ?? (() => null);
this.getRecentStderr = getRecentStderr ?? (() => "");
this.clientInfo = null;
this.clientCapabilities = null;
this.terminalOutputMode = "terminal_output_delta";
this.booleanConfigOptionsSupported = false;
this.availableCommands = new CodexCommands(
Expand All @@ -190,6 +192,7 @@ export class CodexAcpServer {
): Promise<acp.InitializeResponse> {
logger.log("Initialize request received");
this.clientInfo = _params.clientInfo ?? null;
this.clientCapabilities = _params.clientCapabilities ?? null;
this.terminalOutputMode = resolveTerminalOutputMode(_params.clientCapabilities);
this.booleanConfigOptionsSupported = clientSupportsBooleanConfigOptions(_params.clientCapabilities);
await this.runWithProcessCheck(() => this.codexAcpClient.initialize(_params));
Expand Down Expand Up @@ -1437,10 +1440,15 @@ export class CodexAcpServer {
try {
const eventHandler = new CodexEventHandler(this.connection, sessionState);
const approvalHandler = new CodexApprovalHandler(this.connection, sessionState, activePrompt.signal);
const elicitationHandler = new CodexElicitationHandler(this.connection, sessionState, activePrompt.signal);
const elicitationHandler = new CodexElicitationHandler(
this.connection,
sessionState,
this.clientCapabilities,
activePrompt.signal,
);
await this.codexAcpClient.subscribeToSessionEvents(params.sessionId,
(event) => {
elicitationHandler.handleNotification(event);
async (event) => {
await elicitationHandler.handleNotification(event);
return eventHandler.handleNotification(event);
},
approvalHandler,
Expand Down
Loading