Repository navigation
fix: validate before sending, and print a reply address that runs - #12
Merged
Merged
Conversation
Validation lived inside post_to_socket, which --dry-run never calls and the remote path reaches only after ssh has already refused the argument. So a rehearsal could pass where the real send failed, and an empty message could ride out on the strength of its reply line alone — starting a turn on another machine to say nothing. check_message() now runs before dispatch, on the body the user actually wrote. The advertised 1,000,000 cap was never true over SSH: the message travels as a command-line argument and meets MAX_ARG_STRLEN around 98K after base64. The remote limit is now stated, enforced up front, and explains itself. The reply address was not runnable as printed. It named no user, so a worker running as ubuntu could not reach a laptop's abruptly; it named a bare cc-peer, which a non-interactive SSH session does not have on PATH. It now carries the sending user, an absolute script path, and --no-reply-to. Verified by running the generated line verbatim from KR — the message arrived. Also: --reply-to outside a session was dropped in silence, and now says why; malformed --b64 and a mid-write socket failure raise CcPeerError instead of escaping as tracebacks; the half-close comment no longer claims a delivery guarantee it never provided.
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #7, #8, #9.
Validation ran too late. It lived inside
post_to_socket(), which--dry-runnever calls and the remote path reaches only after ssh has already rejected the argument. A rehearsal could pass where the real send failed, and an empty message could ride out on its reply line alone — starting a turn on another machine to say nothing.check_message()now runs before dispatch, against the body the user actually wrote.The 1M cap was never true over SSH. The message travels as a command-line argument and meets
MAX_ARG_STRLENaround 98K after base64 expansion. There is now a stated remote limit (90,000) enforced up front, with an error that explains why it differs and what to do instead.The reply address was not runnable as printed. It named no user, so a worker running as
ubuntucould not reach this laptop'sabruptly; and it named a barecc-peer, which a non-interactive SSH session does not have on PATH. It now carries the sending user, an absolute script path, and--no-reply-to.Verification
Every row reproduced failing first.
/dev/nullWould post ... (64 chars)refusing to send an empty message--dry-runssh exited 1--b64binascii.Errortraceback--b64 is not valid base64-encoded UTF-8--reply-tooutside a sessionThe reply line was then tested end to end: generated here, pasted verbatim into a shell on the KR host, and the message arrived in this session.
The username is the sender's and is not guaranteed valid on the far side, but it is correct whenever accounts match and strictly better than omitting it.
Type
Checklist
python3 cc_peer.py listworks locallypython3 cc_peer.py list --host <a real host>works over SSH--dry-runresolves a target without posting anythingVerified against
v2.1.263 — macOS 26 (arm64) ↔ Ubuntu 24.04 (arm64), round trip in both directions.
Notes
SKILL.mdand README still describe the old reply form; that and the remaining cleanups are #10.