diff --git a/.opencode/package.json b/.opencode/package.json index 8b520c21629..054a7ccefb2 100644 --- a/.opencode/package.json +++ b/.opencode/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@opencode-ai/plugin": "1.2.24" + "@opencode-ai/plugin": "1.2.25" } } \ No newline at end of file diff --git a/src/pyodide/python-entrypoint-helper.ts b/src/pyodide/python-entrypoint-helper.ts index 7b49be1837e..3c8075e2a03 100644 --- a/src/pyodide/python-entrypoint-helper.ts +++ b/src/pyodide/python-entrypoint-helper.ts @@ -81,8 +81,16 @@ export type PyodideEntrypointHelper = { workerEntrypoint: any; patchWaitUntil: typeof patchWaitUntil; patch_env_helper: (patch: unknown) => Generator; + callRpcMethod: (binding: any, method: string, ...args: any[]) => any; }; +// Calls an RPC method on a JS binding entirely from the JS side, bypassing +// Pyodide's JsProxy attribute resolution. Pyodide adds extra methods such as +// send/throw to the JsProxy which can shadow RPC methods with the same name. +function callRpcMethod(binding: any, method: string, ...args: any[]): any { + return binding[method](...args); +} + // Function to import JavaScript modules from Python let _pyodide_entrypoint_helper: PyodideEntrypointHelper | null = null; @@ -106,6 +114,7 @@ export async function setDoAnImport( workerEntrypoint, patchWaitUntil, patch_env_helper, + callRpcMethod, }; }