@@ -16,6 +16,7 @@ import {AgentMode} from "../../AgentMode";
1616import type { Model , ReviewStartResponse , ThreadGoal , TurnCompletedNotification , TurnStartParams } from "../../app-server/v2" ;
1717import type { RateLimitsMap } from "../../RateLimitsMap" ;
1818import { ModelId } from "../../ModelId" ;
19+ import { CodexAcpClient } from "../../CodexAcpClient" ;
1920
2021describe ( 'ACP server test' , { timeout : 40_000 } , ( ) => {
2122
@@ -3057,14 +3058,25 @@ describe('ACP server test', { timeout: 40_000 }, () => {
30573058 expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "none" } ) ) ;
30583059 } ) ;
30593060
3060- it ( 'should enable reasoning.summary by default' , async ( ) => {
3061- const { mockFixture, turnStartSpy } = setupPromptFixture ( {
3062- account : { type : "chatgpt" , email : "test@example.com" , planType : "pro" } ,
3063- } ) ;
3061+ // Explicit adapter config must override the default summary mode.
3062+ it ( 'should prefer CODEX_CONFIG reasoning.summary' , async ( ) => {
3063+ const { mockFixture, turnStartSpy } = setupPromptFixture ( ) ;
3064+ const configuredClient = new CodexAcpClient (
3065+ mockFixture . getCodexAppServerClient ( ) ,
3066+ { model_reasoning_summary : "detailed" } ,
3067+ ) ;
30643068
3065- await mockFixture . getCodexAcpAgent ( ) . prompt ( { sessionId : "id" , prompt : [ { type : "text" , text : "test" } ] } ) ;
3069+ await configuredClient . sendPrompt (
3070+ { sessionId : "id" , prompt : [ { type : "text" , text : "test" } ] } ,
3071+ AgentMode . DEFAULT_AGENT_MODE ,
3072+ ModelId . create ( "model-id" , "medium" ) ,
3073+ null ,
3074+ false ,
3075+ "/test/cwd" ,
3076+ [ ] ,
3077+ ) ;
30663078
3067- expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "auto" } ) ) ;
3079+ expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "detailed" } ) ) ;
30683080 } ) ;
30693081
30703082 it ( 'should disable reasoning.summary when model lacks reasoning' , async ( ) => {
@@ -3078,7 +3090,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
30783090 expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "none" } ) ) ;
30793091 } ) ;
30803092
3081- it ( 'should enable reasoning.summary when model supports reasoning' , async ( ) => {
3093+ it ( 'should use auto reasoning.summary by default when model supports reasoning' , async ( ) => {
30823094 const { mockFixture, turnStartSpy } = setupPromptFixture ( {
30833095 account : { type : "chatgpt" , email : "test@example.com" , planType : "pro" } ,
30843096 supportedReasoningEfforts : [
@@ -3089,7 +3101,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
30893101
30903102 await mockFixture . getCodexAcpAgent ( ) . prompt ( { sessionId : "id" , prompt : [ { type : "text" , text : "test" } ] } ) ;
30913103
3092- expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "auto" } ) ) ;
3104+ expect ( turnStartSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( { summary : "auto" } ) ) ;
30933105 } ) ;
30943106
30953107 it ( 'should reject prompt with images when model does not support image input' , async ( ) => {
0 commit comments