Skip to content

fix(macos): compress the remote SQLite agent so the exec request fits libssh2's packet limit - #4249

Merged
datlechin merged 3 commits into
mainfrom
fix/remote-sqlite-exec-packet-limit
Nov 12, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/remote-sqlite-exec-packet-limit

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Remote SQLite "on server" never connected: RemoteSQLiteAgentSource.launcherCommand() carried the base64 agent program once per interpreter (~73 KB). libssh2 rejects an uncompressed SSH packet payload at or above MAX_SSH_PACKET_LEN - 0x100 (34744 B) with LIBSSH2_ERROR_INVAL, so libssh2_channel_process_startup("exec", …) failed with -34 on every server.
  • Compress the program once (Apple Compression, COMPRESSION_ZLIB = raw DEFLATE), carry it once in a shell variable, and inflate it in the bootstrap with zlib.decompress(…, -15). The exec request drops to ~7 KB, ~28 KB under the limit.

Test plan

  • RemoteSQLiteAdmissionTests.launcherCommandCarriesNoUserDataAndFitsThePacketLimit: asserts the request is under 34744 B. Fails on main (73093 B), passes here.
  • RemoteSQLiteAgentPipeTests now launches via the shipped blob and bootstrap, so the protocol suite also covers the decompression round-trip.
  • apple/scripts/probes/remote-sqlite-launcher.py: exec request 6959 B, HELLO → READY (sqlite 3.54.0, python 3.9.6).

Fixes #4241

@datlechin
datlechin enabled auto-merge (squash) November 12, 2026 21:03
@datlechin
datlechin disabled auto-merge November 12, 2026 21:39
@datlechin
datlechin merged commit e4dfcfb into main Nov 12, 2026
10 checks passed
@datlechin
datlechin deleted the fix/remote-sqlite-exec-packet-limit branch November 12, 2026 21:39
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.

Remote SQLite "on server" never connects: exec request exceeds libssh2's packet limit (libssh2 -34)

1 participant