some-student-89096
12/10/2025, 9:46 PMError: ESRCH: no such process, read with the @livekit/agents-js package. The error seems to start triggering after a while and slowly ramps up in volume until we restart our service. We see the same number of errors every minute until something causes the error count to increase and then it stabilizes again. This pattern repeats. We are self hosting and have seen this same error occur since before agents v1.0.15 and still occurs on v1.0.25. Note that in the attached error per minute graph everytime the errors drop back down to 0 is right after a deploy.
I have a hunch that the root cause is in the supervised_proc.ts where you are calling getchildMemoryUsageMB inside of a setInterval. On line 215 there’s a call to pidusage(pid) which checks the process data. Since there’s a 5s interval this is most likely a race condition. pidusage can throw system errors including ESRCH and in the pidusage npm package they say to not wrap calls to pidusage() inside of `setInterval`:
> // Avoid using setInterval as they could overlap with asynchronous processing
I think at a minimum the call to this.getChildMemoryUsageMB needs error handling. Ideally a refactor to not wrap this call with a setInterval as well.lively-winter-88668
12/11/2025, 9:51 AMgetChildMemoryUsageMB call? I agree a refactor would be best, but that does at least isolate the root cause