Skip to content

Advertised 1M character cap breaks around 98K on the remote path, with a raw traceback #7

Closed

Description

@abruption

--b64 is passed as an ssh command-line argument, so it hits Linux MAX_ARG_STRLEN (128 KB per argument). With base64's 4/3 expansion the real ceiling is roughly 98,300 characters — not the 1,000,000 that MAX_MESSAGE_CHARS advertises and that the README repeats.

Reported measurements: 90,000 chars fine, 150,000 chars fails. Reproduced here at 150,000 (ssh exited 1).

Two layers to this:

  1. The cap is wrong for the remote path. MAX_MESSAGE_CHARS is only enforced inside post_to_socket(), which runs on the far side after the argument has already been rejected.
  2. The failure isn't handled. run_remote() catches only FileNotFoundError and TimeoutExpired, so OSError: [Errno 7] Argument list too long escapes as a traceback. main() catches only CcPeerError and KeyboardInterrupt, so --json callers get no JSON at all — the skill parsing that output breaks.

Other unhandled paths in the same shape:

  • post_to_socket() wraps only connect(); sendall/shutdown can raise BrokenPipeError
  • read_message() can raise binascii.Error on malformed --b64

Fix

  • Enforce a remote-path limit before dispatch, with a message that names the real number
  • Catch OSError in run_remote(), BrokenPipeError in post_to_socket(), binascii.Error in read_message()
  • Make sure every failure still emits JSON under --json

Verified on v0.2.0.

Activity

  1. added
    bug
    on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions