Skip to content

fix(ipc): report actual consumed memory instead of RSS - #2235

Open
rosetta-livekit-bot[bot] wants to merge 4 commits into
mainfrom
tweezers-coupes-arena
Open

fix(ipc): report actual consumed memory instead of RSS#2235
rosetta-livekit-bot[bot] wants to merge 4 commits into
mainfrom
tweezers-coupes-arena

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Ports livekit/agents#6082 to the Node.js IPC supervisor.

Summary

  • report Linux PSS from procfs instead of double-counting shared pages in RSS
  • retain RSS fallback when PSS is unavailable and on non-Linux platforms
  • report the selected pss or rss metric in diagnostic logs
  • add a patch changeset for @livekit/agents

The final target diff is 84 changed lines, smaller than the source PRs 115 changed lines.

Source diff coverage

Source diff coverage

  • livekit-agents/livekit/agents/ipc/supervised_proc.py: adapted to agents/src/ipc/supervised_proc.ts. The target has no psutil counterpart, so Linux PSS is read asynchronously from smaps_rollup or aggregated smaps; the existing pidusage RSS sampler remains the fallback. No macOS or Windows special casing is added, matching the source PR caveat that supervised children do not expose USS there without elevated privileges.
  • tests/test_supervised_proc_memory.py: adapted to agents/src/ipc/supervised_proc.test.ts. Ports metric logging, Linux PSS selection, and RSS fallback coverage. The own-process macOS/Windows USS probe is not applicable to the target supervised-child behavior described by the source PR and is intentionally omitted.

Verification

  • pnpm test agents --silent (1,587 passed, 5 skipped)
  • pnpm build (40 packages)
  • pnpm lint (passes with existing warnings)
  • pnpm format:check

Source: livekit/agents#6082

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner August 6, 2026 16:07
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fdbf9dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-krisp Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from Bobronium August 6, 2026 16:08

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread agents/src/ipc/supervised_proc.ts Outdated
Comment thread agents/src/ipc/supervised_proc.ts Outdated
const MEMORY_WARN_RESET_DELTA_MB = 50;
const execFileAsync = promisify(execFile);

type MemoryMetric = 'pss' | 'uss' | 'footprint' | 'rss' | 'unknown';

@devin-ai-integration devin-ai-integration Bot Aug 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 New memory-reading helper added without documentation comments

The newly added memory-reading helper is introduced (getPssMB at agents/src/ipc/supervised_proc.ts:319) without any documentation comment, while the repository requires every new method to be documented.
Impact: Contributors and generated API docs lack an explanation of what the new memory number means and when it is unavailable.

Repository rule requiring documentation of new methods

CONTRIBUTING.md states: "If writing new methods/interfaces/enums/classes, document them. This project uses TypeDoc for automatic API documentation generation, and every new addition has to be properly documented." The new getPssMB method (agents/src/ipc/supervised_proc.ts:319-333) and the new MemoryMetric type alias (agents/src/ipc/supervised_proc.ts:16) have no doc comments, unlike the documented ProcOpts fields directly above them.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant