Skip to content

fix(#308): ping/pong as plaintext — sidestep pair-handshake asymmetry - #317

Merged
joelteply merged 1 commit into
canaryfrom
fix-308-pong-not-firing
Apr 29, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix-308-pong-not-firing

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Stderr smoking gun: [airc:monitor] dropping encrypted msg from <peer>: missing pubkey/privkey for decrypt. Pair handshake stored x25519 pubkeys asymmetrically — pong was encrypted, recipient couldn't decrypt, silently dropped, cmd_ping timed out. Force ping/pong plaintext (zero security value in encrypting a public uuid). New --plaintext flag on cmd_send. TDD coverage in test_monitor_formatter.py.

Found via stderr in /tmp/airc-connect-*.log:
  [airc:monitor] dropping encrypted msg from <peer>: missing pubkey/privkey for decrypt

Pair handshake stores x25519 pubkeys ASYMMETRICALLY. Continuum had my
pubkey (could encrypt PONG to me); I didn't have theirs (couldn't
decrypt). monitor_formatter dropped the encrypted PONG silently with
that stderr line, auto-pong looked like it never fired, cmd_ping
timed out forever.

For [PING:uuid] / [PONG:uuid] specifically, encryption adds zero
security value — the body is a public uuid with no secret content.
Plaintext sidesteps the asymmetry entirely for control traffic.

Changes:
  - cmd_send: new --plaintext flag (skips envelope-layer wrap regardless
    of recipient's stored pubkey).
  - cmd_ping: routes via #general --plaintext (was just #general).
  - monitor_formatter auto-pong: subprocess argv now includes --plaintext.

The bigger pubkey-symmetry bug (peer record A.json missing x25519_pub
after handshake) is filed separately — this fix unblocks the ping
demo loop without depending on that fix.

TDD: test_monitor_formatter.py asserts auto-pong argv contains
--plaintext (regression guard against re-introducing encrypted control
traffic). test_ping_addressed_to_someone_else_does_not_fire_pong +
test_pong_is_suppressed_not_repeated + test_broadcast_ping_does_not_fire_pong
+ test_heartbeat_line_is_swallowed_no_stdout_output cover surrounding
contracts.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 741cb51 into canary Apr 29, 2026
@joelteply
joelteply deleted the fix-308-pong-not-firing branch April 29, 2026 15:48
joelteply added a commit that referenced this pull request Apr 29, 2026
…ixes

canary → main: morning fixes (#316 pidfile, #317 ping, #318 input-validation, #319 host bootstrap)
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