@@ -44,45 +44,6 @@ function stdioServer(
4444 } ,
4545 } ;
4646}
47- function modelConfig ( workspace : string ) : OpenClawConfig {
48- return {
49- secrets : { providers : { default : { source : "env" } } } ,
50- models : {
51- mode : "replace" ,
52- providers : {
53- openai : {
54- baseUrl : "https://api.openai.com/v1" ,
55- api : "openai-responses" ,
56- apiKey : { source : "env" , provider : "default" , id : "OPENAI_API_KEY" } ,
57- models : [
58- {
59- id : MODEL_ID ,
60- name : MODEL_ID ,
61- api : "openai-responses" ,
62- reasoning : true ,
63- input : [ "text" ] ,
64- cost : { input : 0 , output : 0 , cacheRead : 0 , cacheWrite : 0 } ,
65- contextWindow : 48_000 ,
66- contextTokens : 48_000 ,
67- maxTokens : 8_192 ,
68- } ,
69- ] ,
70- } ,
71- } ,
72- } ,
73- agents : {
74- defaults : {
75- workspace,
76- model : { primary : MODEL_REF } ,
77- timeoutSeconds : Math . ceil ( REQUEST_TIMEOUT_MS / 1_000 ) ,
78- } ,
79- } ,
80- tools : { profile : "full" , toolSearch : false , codeMode : false } ,
81- memory : { search : { enabled : false } } ,
82- plugins : { enabled : false } ,
83- channels : { } ,
84- } ;
85- }
8647function expectCompletedTool (
8748 messages : HistoryMessage [ ] ,
8849 params : { name : string ; marker : string ; label : string } ,
@@ -98,7 +59,10 @@ function expectCompletedTool(
9859 return JSON . stringify ( block . arguments ?? block . input ) . includes ( params . marker ) ;
9960 } ) ;
10061 } ) ;
101- expect ( called , `chat.history omitted tool call ${ params . name } ` ) . toBe ( true ) ;
62+ expect (
63+ called ,
64+ `chat.history omitted tool call ${ params . name } : ${ JSON . stringify ( messages ) . slice ( - 16_384 ) } ` ,
65+ ) . toBe ( true ) ;
10266 const result = messages . find (
10367 ( candidate ) =>
10468 candidate . role === "toolResult" &&
@@ -182,19 +146,27 @@ describe.skipIf(!LIVE_ENABLED)("OpenAI cross-placement MCP model proof", () => {
182146 } ,
183147 transportBaseUrl : "http://127.0.0.1" ,
184148 controlUiEnabled : false ,
149+ providerMode : "live-frontier" ,
150+ primaryModel : MODEL_REF ,
151+ alternateModel : MODEL_REF ,
152+ enabledPluginIds : [ "codex" ] ,
185153 runtimeEnvPatch : {
186154 OPENAI_API_KEY ,
187- OPENCLAW_DISABLE_BUNDLED_PLUGINS : "1" ,
188155 OPENCLAW_SKIP_CHANNELS : "1" ,
189156 } ,
190157 mutateConfig : ( cfg ) => {
191- const live = modelConfig ( cfg . agents ?. defaults ?. workspace ?? gatewayParent ) ;
192158 return {
193- ...live ,
159+ ...cfg ,
194160 agents : {
195161 ...cfg . agents ,
196- ...live . agents ,
197- defaults : { ...cfg . agents ?. defaults , ...live . agents ?. defaults } ,
162+ defaults : {
163+ ...cfg . agents ?. defaults ,
164+ timeoutSeconds : Math . ceil ( REQUEST_TIMEOUT_MS / 1_000 ) ,
165+ mediaModels : undefined ,
166+ // Authored QA transport params select the built-in runtime.
167+ // Keep the official route unmodified to prove the default Codex harness.
168+ models : { [ MODEL_REF ] : { } } ,
169+ } ,
198170 entries : {
199171 ...cfg . agents ?. entries ,
200172 qa : {
@@ -204,6 +176,13 @@ describe.skipIf(!LIVE_ENABLED)("OpenAI cross-placement MCP model proof", () => {
204176 } ,
205177 } ,
206178 } ,
179+ tools : { ...cfg . tools , profile : "full" , toolSearch : false , codeMode : false } ,
180+ memory : { search : { enabled : false } } ,
181+ plugins : {
182+ ...cfg . plugins ,
183+ slots : { ...cfg . plugins ?. slots , memory : "none" } ,
184+ entries : { ...cfg . plugins ?. entries , "memory-core" : { enabled : false } } ,
185+ } ,
207186 mcp : { servers : gatewayServers } ,
208187 gateway : {
209188 ...cfg . gateway ,
@@ -245,18 +224,22 @@ describe.skipIf(!LIVE_ENABLED)("OpenAI cross-placement MCP model proof", () => {
245224 const sessionKey = `agent:qa:mcp-live-${ randomUUID ( ) } ` ;
246225 const idempotencyKey = randomUUID ( ) ;
247226 const prompt =
248- `Call gatewayLive__parity_probe with marker ${ gatewayMarker } . ` +
227+ `Call parity_probe on MCP server gatewayLive with marker ${ gatewayMarker } . ` +
249228 `Call nodeLive_parity_probe with marker ${ nodeMarker } . ` +
250229 `Only after both calls return successfully, reply with exactly ${ expectedToken } and nothing else.` ;
251- const started = ( await gateway . call (
230+ const completed = ( await gateway . call (
252231 "agent" ,
253232 { sessionKey, message : prompt , deliver : false , idempotencyKey } ,
254- { timeoutMs : 30_000 } ,
233+ { expectFinal : true , timeoutMs : REQUEST_TIMEOUT_MS + 5_000 } ,
255234 ) ) as { runId ?: unknown ; status ?: unknown } ;
256- if ( started . status !== "accepted" || typeof started . runId !== "string" ) {
257- throw new Error ( `live Gateway run did not start: ${ JSON . stringify ( started ) } ` ) ;
235+ expect ( completed , gateway . logs ( ) ) . toMatchObject ( {
236+ status : "ok" ,
237+ result : { meta : { agentMeta : { agentHarnessId : "codex" } } } ,
238+ } ) ;
239+ if ( typeof completed . runId !== "string" ) {
240+ throw new Error ( `live Gateway run omitted its identity: ${ JSON . stringify ( completed ) } ` ) ;
258241 }
259- const runId = started . runId ;
242+ const runId = completed . runId ;
260243 const terminal = await gateway . call (
261244 "agent.wait" ,
262245 { runId, timeoutMs : REQUEST_TIMEOUT_MS } ,
@@ -269,7 +252,8 @@ describe.skipIf(!LIVE_ENABLED)("OpenAI cross-placement MCP model proof", () => {
269252 } ) ) as { messages ?: HistoryMessage [ ] } ;
270253 const messages = history . messages ?? [ ] ;
271254 expectCompletedTool ( messages , {
272- name : "gatewayLive__parity_probe" ,
255+ // Codex owns configured Gateway MCP and records its native server.tool name.
256+ name : "gatewayLive.parity_probe" ,
273257 marker : gatewayMarker ,
274258 label : "gateway-live" ,
275259 } ) ;
0 commit comments