Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/CodexAcpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ export class CodexAcpClient {
request: acp.PromptRequest,
agentMode: AgentMode,
modelId: ModelId,
modelName: string,
serviceTier: ServiceTier | null,
disableSummary: boolean,
cwd: string,
Expand All @@ -864,7 +865,7 @@ export class CodexAcpClient {
sandboxPolicy: addAdditionalDirectoriesToSandboxPolicy(agentMode.sandboxPolicy, additionalDirectories),
summary: disableSummary ? "none" : "auto",
effort: effort,
model: modelId.model,
model: modelName,
serviceTier: serviceTier,
}, onTurnStarted);
}
Expand Down
4 changes: 4 additions & 0 deletions src/CodexAcpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2417,6 +2417,8 @@ export class CodexAcpServer {
}

const modelId = ModelId.fromString(sessionState.currentModelId);
const modelName = this.findCurrentModel(sessionState.availableModels, sessionState.currentModelId)?.model
?? modelId.model;
const modelLacksReasoning = sessionState.supportedReasoningEfforts.length > 0
&& sessionState.supportedReasoningEfforts.every(e => e.reasoningEffort === "none");

Expand All @@ -2442,6 +2444,7 @@ export class CodexAcpServer {
effectiveParams,
agentMode,
modelId,
modelName,
serviceTier,
disableSummary,
sessionState.cwd,
Expand Down Expand Up @@ -2532,6 +2535,7 @@ export class CodexAcpServer {
implementationRequest,
agentMode,
modelId,
modelName,
serviceTier,
disableSummary,
sessionState.cwd,
Expand Down
21 changes: 21 additions & 0 deletions src/__tests__/CodexACPAgent/CodexAcpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3580,6 +3580,27 @@ describe('ACP server test', { timeout: 40_000 }, () => {
expect(turnStartSpy).toHaveBeenCalledWith(expect.objectContaining({ summary: "auto" }));
});

it('should pass the executable model name to turn/start', async () => {
const model = createTestModel({
id: "catalog-model-id",
model: "provider-model-name",
});
const {mockFixture, turnStartSpy} = setupPromptFixture({
currentModelId: "catalog-model-id[medium]",
availableModels: [model],
});

await mockFixture.getCodexAcpAgent().prompt({
sessionId: "session-id",
prompt: [{type: "text", text: "test"}],
});

expect(turnStartSpy).toHaveBeenCalledWith(expect.objectContaining({
model: "provider-model-name",
effort: "medium",
}));
});

it ('should reject prompt with images when model does not support image input', async () => {
const { mockFixture } = setupPromptFixture({
supportedInputModalities: ["text"],
Expand Down