fix: resolve TypeScript type error for agent property in fetch

- Use spread operator with type assertion for Node.js-specific agent property
- Ensures compatibility with standard RequestInit type while allowing HTTPS agent
This commit is contained in:
Roo Code 2025-09-28 18:45:22 +00:00
parent a158c21e8c
commit b73bd7cded

View file

@ -859,10 +859,11 @@ export class McpHub {
// Custom fetch function that includes the HTTPS agent
reconnectingEventSourceOptions.fetch = (url: string | URL, init: RequestInit) => {
const headers = new Headers({ ...(init?.headers || {}), ...(configInjected.headers || {}) })
// Use type assertion for Node.js-specific agent property
return fetch(url, {
...init,
headers,
agent: agent as any,
...({ agent } as any),
})
}
}