You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP host: recycle the tool host after its footprint grows, and rmcp's oversized stdio line #335
#474 bounded what the MCP host holds outside QuickJS's cap: collected output stays within 1 MB, a script may have at most 8 calls in flight, results over 16 MB are refused, and server stderr lines are cut at 1 KB. #481 moved tool answering and MCP out of sonny lookout into the sonny tool-host companion, so a large or slow MCP call no longer shares a process with notification delivery. A soak of 300 scripts, on Linux and on a Mac, found no steady growth.
These edges remain:
rmcp reads a streamable-HTTP server's non-streamed JSON reply with response.bytes(), with no limit. Sonny refuses the result after decoding when it is over 16 MB, but by then the whole body is in memory. This is the one unbounded allocation left. It is upstream (rmcp 3.8). The fix is a body cap in rmcp, or Sonny's own HTTP transport that stops reading past the limit.
Recycling the tool host. After scripts hit QuickJS's 256 MB cap, the macOS footprint stays at about 100 MB, against 20-25 MB at baseline. RSS reads 360+ MB, most of it reclaimable. It is not a leak: leaks finds 0, and malloc_zone_pressure_relief didn't help. Now that the tool host is its own companion, the practical fix is to restart it after a footprint threshold, or after N capped scripts, as Codex recycles its code-mode host. Giving QuickJS an allocator whose arena is freed as a whole is the other option.
rmcp (3.8) drops a stdio line over 16 MiB and leaves the connection open. The call then waits out its 60 s timeout instead of failing at once. This costs time, not memory, and is upstream.
changed the title [-]Sonny exec: memory edges left after the MCP soak[/-][+]Sonny exec: script memory stays with the process on macOS (and rmcp's unbounded edges)[/+]on Oct 31, 2026
changed the title [-]Sonny exec: script memory stays with the process on macOS (and rmcp's unbounded edges)[/-][+]MCP host: unbounded rmcp HTTP body read, and recycling the tool host[/+]on Oct 31, 2026
11-14 reconciliation: item 1 is fixed upstream. The pinned rmcp 3.9.0 (Cargo.lock) collects non-streamed HTTP bodies through read_bounded_body (transport/common/client_side_http.rs), which caps JSON replies at 16 MiB and error bodies at 64 KiB before retaining them, and refuses early on a too-large Content-Length.
Still open: item 2 (recycling the tool host after its footprint grows) and item 3 (rmcp's stdio transport drops a line over 16 MiB, DEFAULT_MAX_LINE_LENGTH, and leaves the connection open, so the call waits out its timeout).
changed the title [-]MCP host: unbounded rmcp HTTP body read, and recycling the tool host[/-][+]MCP host: recycle the tool host after its footprint grows, and rmcp's oversized stdio line[/+]on Nov 20, 2026
Title narrowed to what is left. Item 1 (the unbounded HTTP body read) was fixed upstream, as the 11-14 comment says; main now pins rmcp 3.10.0, which keeps that bound. Items 2 (recycling the tool host after its footprint grows) and 3 (rmcp's stdio transport dropping a line over 16 MiB and leaving the call to time out) stay open.
Activity
Sonny: bound the shared MCP host and pin a T3 thread to its bot's ide…
[-]Sonny exec: memory edges left after the MCP soak[/-][+]Sonny exec: script memory stays with the process on macOS (and rmcp's unbounded edges)[/+]Sonny: answer tools from their own companion, not the lookout (#481)
Sonny: exec's image() shows the model the picture, in order with the …
[-]Sonny exec: script memory stays with the process on macOS (and rmcp's unbounded edges)[/-][+]MCP host: unbounded rmcp HTTP body read, and recycling the tool host[/+]lydakis commentedon Nov 14, 2026
11-14 reconciliation: item 1 is fixed upstream. The pinned rmcp 3.9.0 (Cargo.lock) collects non-streamed HTTP bodies through
read_bounded_body(transport/common/client_side_http.rs), which caps JSON replies at 16 MiB and error bodies at 64 KiB before retaining them, and refuses early on a too-large Content-Length.Still open: item 2 (recycling the tool host after its footprint grows) and item 3 (rmcp's stdio transport drops a line over 16 MiB,
DEFAULT_MAX_LINE_LENGTH, and leaves the connection open, so the call waits out its timeout).Generated by Claude Code
[-]MCP host: unbounded rmcp HTTP body read, and recycling the tool host[/-][+]MCP host: recycle the tool host after its footprint grows, and rmcp's oversized stdio line[/+]lydakis commentedon Nov 20, 2026
Title narrowed to what is left. Item 1 (the unbounded HTTP body read) was fixed upstream, as the 11-14 comment says; main now pins rmcp 3.10.0, which keeps that bound. Items 2 (recycling the tool host after its footprint grows) and 3 (rmcp's stdio transport dropping a line over 16 MiB and leaving the call to time out) stay open.
Generated by Claude Code