@@ -5431,7 +5431,7 @@ describe("createAgentChatService", () => {
54315431 | { mode ?: unknown ; settings ?: { model ?: unknown ; reasoning_effort ?: unknown ; developer_instructions ?: unknown } }
54325432 | undefined ;
54335433
5434- expect ( params ?. approvalPolicy ) . toBe ( "untrusted " ) ;
5434+ expect ( params ?. approvalPolicy ) . toBe ( "unlessTrusted " ) ;
54355435 expect ( params ?. sandboxPolicy ?. type ) . toBe ( "readOnly" ) ;
54365436 expect ( params ?. effort ) . toBe ( "medium" ) ;
54375437 expect ( collaborationMode ?. mode ) . toBe ( "plan" ) ;
@@ -5484,7 +5484,7 @@ describe("createAgentChatService", () => {
54845484 } | undefined ;
54855485 const collaborationMode = params ?. collaborationMode as { mode ?: unknown } | undefined ;
54865486
5487- expect ( params ?. approvalPolicy ) . toBe ( "on-request " ) ;
5487+ expect ( params ?. approvalPolicy ) . toBe ( "onRequest " ) ;
54885488 expect ( params ?. sandboxPolicy ?. type ) . toBe ( "workspaceWrite" ) ;
54895489 expect ( params ?. effort ) . toBe ( "medium" ) ;
54905490 expect ( collaborationMode ?. mode ) . toBe ( "default" ) ;
@@ -5548,8 +5548,8 @@ describe("createAgentChatService", () => {
55485548 reasoningEffort ?: unknown ;
55495549 } | undefined ;
55505550 expect ( params ?. approvalPolicy ) . toBe ( "never" ) ;
5551- expect ( params ?. sandbox ) . toBe ( "danger-full-access " ) ;
5552- expect ( params ?. reasoningEffort ) . toBeUndefined ( ) ;
5551+ expect ( params ?. sandbox ) . toBe ( "dangerFullAccess " ) ;
5552+ expect ( params ?. reasoningEffort ) . toBe ( "medium" ) ;
55535553
55545554 const turnStartRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "turn/start" ) ;
55555555 const turnStartParams = turnStartRequest ?. params as {
@@ -5562,10 +5562,10 @@ describe("createAgentChatService", () => {
55625562 expect ( turnStartParams ?. effort ) . toBe ( "medium" ) ;
55635563 } ) ;
55645564
5565- it ( "uses the app-server's effective Codex policy for subsequent turn/start overrides " , async ( ) => {
5565+ it ( "keeps the requested Codex reasoning effort while applying effective thread policy " , async ( ) => {
55665566 mockState . codexResponseOverrides . set ( "thread/start" , ( ) => ( {
55675567 thread : { id : "thread-effective-start" } ,
5568- approvalPolicy : "on-failure " ,
5568+ approvalPolicy : "onFailure " ,
55695569 sandbox : {
55705570 type : "workspaceWrite" ,
55715571 writableRoots : [ ] ,
@@ -5582,6 +5582,7 @@ describe("createAgentChatService", () => {
55825582 laneId : "lane-1" ,
55835583 provider : "codex" ,
55845584 model : "gpt-5.4" ,
5585+ reasoningEffort : "xhigh" ,
55855586 } ) ;
55865587
55875588 await service . sendMessage ( {
@@ -5593,26 +5594,28 @@ describe("createAgentChatService", () => {
55935594 expect ( mockState . codexRequestPayloads . some ( ( payload ) => payload . method === "turn/start" ) ) . toBe ( true ) ;
55945595 } ) ;
55955596
5597+ const threadStartRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "thread/start" ) ;
5598+ expect ( ( threadStartRequest ?. params as { reasoningEffort ?: unknown } | undefined ) ?. reasoningEffort ) . toBe ( "xhigh" ) ;
55965599 const turnStartRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "turn/start" ) ;
55975600 const turnStartParams = turnStartRequest ?. params as {
55985601 approvalPolicy ?: unknown ;
55995602 sandboxPolicy ?: { type ?: unknown } ;
56005603 effort ?: unknown ;
56015604 } | undefined ;
5602- expect ( turnStartParams ?. approvalPolicy ) . toBe ( "on-failure " ) ;
5605+ expect ( turnStartParams ?. approvalPolicy ) . toBe ( "onFailure " ) ;
56035606 expect ( turnStartParams ?. sandboxPolicy ?. type ) . toBe ( "workspaceWrite" ) ;
5604- expect ( turnStartParams ?. effort ) . toBe ( "high " ) ;
5607+ expect ( turnStartParams ?. effort ) . toBe ( "xhigh " ) ;
56055608
56065609 const summary = await service . getSessionSummary ( session . id ) ;
56075610 expect ( summary ?. codexApprovalPolicy ) . toBe ( "on-failure" ) ;
56085611 expect ( summary ?. codexSandbox ) . toBe ( "workspace-write" ) ;
56095612 expect ( summary ?. permissionMode ) . toBe ( "default" ) ;
5610- expect ( summary ?. reasoningEffort ) . toBe ( "high " ) ;
5613+ expect ( summary ?. reasoningEffort ) . toBe ( "xhigh " ) ;
56115614
56125615 const persisted = readPersistedChatState ( session . id ) ;
56135616 expect ( persisted . codexApprovalPolicy ) . toBe ( "on-failure" ) ;
56145617 expect ( persisted . codexSandbox ) . toBe ( "workspace-write" ) ;
5615- expect ( persisted . reasoningEffort ) . toBe ( "high " ) ;
5618+ expect ( persisted . reasoningEffort ) . toBe ( "xhigh " ) ;
56165619 } ) ;
56175620
56185621 it ( "re-resumes Codex threads when permission mode changes mid-session" , async ( ) => {
@@ -5681,8 +5684,8 @@ describe("createAgentChatService", () => {
56815684 reasoningEffort ?: unknown ;
56825685 } | undefined ;
56835686 expect ( params ?. approvalPolicy ) . toBe ( "never" ) ;
5684- expect ( params ?. sandbox ) . toBe ( "danger-full-access " ) ;
5685- expect ( params ?. reasoningEffort ) . toBeUndefined ( ) ;
5687+ expect ( params ?. sandbox ) . toBe ( "dangerFullAccess " ) ;
5688+ expect ( params ?. reasoningEffort ) . toBe ( "medium" ) ;
56865689
56875690 const turnStartRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "turn/start" ) ;
56885691 const turnStartParams = turnStartRequest ?. params as {
@@ -5760,7 +5763,7 @@ describe("createAgentChatService", () => {
57605763 const resumeRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "thread/resume" ) ;
57615764 const resumeParams = resumeRequest ?. params as { approvalPolicy ?: unknown ; sandbox ?: unknown } | undefined ;
57625765 expect ( resumeParams ?. approvalPolicy ) . toBe ( "never" ) ;
5763- expect ( resumeParams ?. sandbox ) . toBe ( "danger-full-access " ) ;
5766+ expect ( resumeParams ?. sandbox ) . toBe ( "dangerFullAccess " ) ;
57645767 } ) ;
57655768
57665769 it ( "does not auto-upgrade default Codex chats into plan mode" , async ( ) => {
@@ -5837,10 +5840,10 @@ describe("createAgentChatService", () => {
58375840 expect ( sessionService . reopen ) . toHaveBeenCalledWith ( session . id ) ;
58385841 } ) ;
58395842
5840- it ( "trusts the app-server's effective Codex policy on resume" , async ( ) => {
5843+ it ( "keeps persisted Codex reasoning effort while applying effective policy on resume" , async ( ) => {
58415844 mockState . codexResponseOverrides . set ( "thread/resume" , ( ) => ( {
58425845 thread : { id : "thread-effective-resume" } ,
5843- approvalPolicy : "on-failure " ,
5846+ approvalPolicy : "onFailure " ,
58445847 sandbox : { type : "workspaceWrite" } ,
58455848 reasoningEffort : "high" ,
58465849 } ) ) ;
@@ -5861,21 +5864,23 @@ describe("createAgentChatService", () => {
58615864 codexApprovalPolicy : "never" ,
58625865 codexSandbox : "danger-full-access" ,
58635866 codexConfigSource : "flags" ,
5864- reasoningEffort : "medium " ,
5867+ reasoningEffort : "xhigh " ,
58655868 } ) ;
58665869
58675870 const resumed = await service . resumeSession ( { sessionId : session . id } ) ;
58685871
5872+ const resumeRequest = mockState . codexRequestPayloads . find ( ( payload ) => payload . method === "thread/resume" ) ;
5873+ expect ( ( resumeRequest ?. params as { reasoningEffort ?: unknown } | undefined ) ?. reasoningEffort ) . toBe ( "xhigh" ) ;
58695874 expect ( resumed . codexApprovalPolicy ) . toBe ( "on-failure" ) ;
58705875 expect ( resumed . codexSandbox ) . toBe ( "workspace-write" ) ;
58715876 expect ( resumed . permissionMode ) . toBe ( "default" ) ;
5872- expect ( resumed . reasoningEffort ) . toBe ( "high " ) ;
5877+ expect ( resumed . reasoningEffort ) . toBe ( "xhigh " ) ;
58735878
58745879 const persistedAfter = readPersistedChatState ( session . id ) ;
58755880 expect ( persistedAfter . threadId ) . toBe ( "thread-effective-resume" ) ;
58765881 expect ( persistedAfter . codexApprovalPolicy ) . toBe ( "on-failure" ) ;
58775882 expect ( persistedAfter . codexSandbox ) . toBe ( "workspace-write" ) ;
5878- expect ( persistedAfter . reasoningEffort ) . toBe ( "high " ) ;
5883+ expect ( persistedAfter . reasoningEffort ) . toBe ( "xhigh " ) ;
58795884 } ) ;
58805885
58815886 it ( "throws when resuming an unknown session" , async ( ) => {
0 commit comments