test: align wechat extension mocks
This commit is contained in:
+6
-6
@@ -2057,7 +2057,7 @@ test('wechat mp service reconciles existing dedicated session before reply', asy
|
|||||||
extensionsReadCount += 1;
|
extensionsReadCount += 1;
|
||||||
const extensions =
|
const extensions =
|
||||||
extensionsReadCount > 1
|
extensionsReadCount > 1
|
||||||
? [{ name: 'sandbox-fs', available_tools: ['list_dir'] }]
|
? [extensionConfig]
|
||||||
: [];
|
: [];
|
||||||
return new Response(JSON.stringify({ extensions }), {
|
return new Response(JSON.stringify({ extensions }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
@@ -2212,7 +2212,7 @@ test('wechat mp service recreates poisoned dedicated session after bare completi
|
|||||||
},
|
},
|
||||||
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
||||||
if (pathname === `/sessions/${sessionId}/extensions`) {
|
if (pathname === `/sessions/${sessionId}/extensions`) {
|
||||||
return new Response(JSON.stringify({ extensions: [{ name: 'developer', available_tools: ['write'] }] }), {
|
return new Response(JSON.stringify({ extensions: [{ type: 'platform', name: 'developer', available_tools: ['write'] }] }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
@@ -2390,7 +2390,7 @@ test('wechat mp service forwards html link when write_file created a real page w
|
|||||||
},
|
},
|
||||||
sessionApiFetch: async (sessionId, pathname) => {
|
sessionApiFetch: async (sessionId, pathname) => {
|
||||||
if (pathname === `/sessions/${sessionId}/extensions`) {
|
if (pathname === `/sessions/${sessionId}/extensions`) {
|
||||||
return new Response(JSON.stringify({ extensions: [{ name: 'developer', available_tools: ['write'] }] }), {
|
return new Response(JSON.stringify({ extensions: [{ type: 'platform', name: 'developer', available_tools: ['write'] }] }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
@@ -3162,7 +3162,7 @@ test('wechat mp service recreates dedicated session when tool_calls error arrive
|
|||||||
},
|
},
|
||||||
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
||||||
if (pathname === `/sessions/${sessionId}/extensions`) {
|
if (pathname === `/sessions/${sessionId}/extensions`) {
|
||||||
return new Response(JSON.stringify({ extensions: [{ name: 'developer', available_tools: ['write'] }] }), {
|
return new Response(JSON.stringify({ extensions: [{ type: 'platform', name: 'developer', available_tools: ['write'] }] }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
@@ -3331,7 +3331,7 @@ test('wechat mp service recreates dedicated session after poisoned tool_calls hi
|
|||||||
},
|
},
|
||||||
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
sessionApiFetch: async (sessionId, pathname, init = {}) => {
|
||||||
if (pathname === `/sessions/${sessionId}/extensions`) {
|
if (pathname === `/sessions/${sessionId}/extensions`) {
|
||||||
return new Response(JSON.stringify({ extensions: [{ name: 'developer', available_tools: ['write'] }] }), {
|
return new Response(JSON.stringify({ extensions: [{ type: 'platform', name: 'developer', available_tools: ['write'] }] }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
@@ -3497,7 +3497,7 @@ test('wechat mp service retries poisoned publish claims before forwarding H5 ret
|
|||||||
},
|
},
|
||||||
sessionApiFetch: async (sessionId, pathname) => {
|
sessionApiFetch: async (sessionId, pathname) => {
|
||||||
if (pathname === `/sessions/${sessionId}/extensions`) {
|
if (pathname === `/sessions/${sessionId}/extensions`) {
|
||||||
return new Response(JSON.stringify({ extensions: [{ name: 'developer', available_tools: ['write'] }] }), {
|
return new Response(JSON.stringify({ extensions: [{ type: 'platform', name: 'developer', available_tools: ['write'] }] }), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user