Category: perf Severity: minor
Location: packages/client/src/client-dispatch.ts:357-378
What
Every job.event is pushed onto inv.events (and result_chunk bodies onto inv.chunks) for the job's entire lifetime with no cap or drain; inv.events is never read by the public client surface, so a long-running chatty job grows client memory without bound.
Evidence
const inv = target.invocationsByJobId.get(jobId);
if (inv === undefined) return;
inv.events.push(ep);
Proposed fix
Bound or drop inv.events accumulation (it is unused by the public API) and consider streaming chunks rather than retaining all bodies.
Acceptance criteria
Category: perf Severity: minor
Location:
packages/client/src/client-dispatch.ts:357-378What
Every job.event is pushed onto inv.events (and result_chunk bodies onto inv.chunks) for the job's entire lifetime with no cap or drain; inv.events is never read by the public client surface, so a long-running chatty job grows client memory without bound.
Evidence
Proposed fix
Bound or drop inv.events accumulation (it is unused by the public API) and consider streaming chunks rather than retaining all bodies.
Acceptance criteria