(client: ApiMachineClient, machineId: string, cwd: string)
| 38 | } |
| 39 | |
| 40 | async function callListOpencodeModels(client: ApiMachineClient, machineId: string, cwd: string): Promise<unknown> { |
| 41 | // Reach into the private rpc handler manager to dispatch a request. |
| 42 | // Mirrors how the on-socket 'rpc-request' listener invokes handleRequest. |
| 43 | const manager = (client as unknown as { rpcHandlerManager: { handleRequest: (req: { method: string; params: string }) => Promise<string> } }).rpcHandlerManager |
| 44 | const raw = await manager.handleRequest({ |
| 45 | method: `${machineId}:listOpencodeModelsForCwd`, |
| 46 | params: JSON.stringify({ cwd }) |
| 47 | }) |
| 48 | return JSON.parse(raw) as unknown |
| 49 | } |
| 50 | |
| 51 | describe('ApiMachineClient listOpencodeModelsForCwd handler', () => { |
| 52 | let workspaceRoot: string |
no test coverage detected