Skip to content

No way to wait for a reply #31

Closed

Description

@abruption

Motivation

Replies landed in v0.2.0, and that turned waiting into a real step — one the tool doesn't know about. A message goes out, and the sender is left writing an ad-hoc loop to notice the answer.

From one day of real use across four machines, I wrote that loop four times, slightly differently each time. One of them judged wrongly: it grepped for a marker string that also appeared in an error message echoing the session name, so a blocked injection attempt was reported as successful. The check was wrong, not the code under test.

That's the argument for putting it in the tool — not convenience, but that everyone reinventing the wait writes a slightly different, occasionally wrong, version of it.

Sketch

cc-peer wait --from ontology --timeout 300

Blocks until a message from that session arrives in this session's inbox, or the timeout expires. Exit 0 on arrival, 2 on timeout, so it composes.

Open questions, in rough order of difficulty:

  • How does it know a message arrived? The transcript is the only observable record, and it's append-only JSONL — tailing for a new record with origin.kind == "peer" and a matching sender is plausible, but reading another session's transcript is a different kind of coupling than writing to a socket. Worth checking whether something cleaner exists before committing to it.
  • --from matching: session name, or anything?
  • Does it print the reply, or just return? Printing makes it useful in a pipeline; returning keeps it a pure synchronisation primitive.

Scope

This is the least defined item here and the only one that adds a subcommand rather than fixing something. If the transcript-tailing turns out to be fragile, the right answer may be to document the pattern rather than ship it. Don't force it in to have shipped something.

Acceptance criteria

  • A decision recorded on how arrival is detected, with the alternatives considered
  • If implemented: timeout behaviour and exit codes tested without a real peer
  • If not implemented: the working pattern documented in SKILL.md so the next person doesn't rewrite it wrongly

Activity

  1. abruption commented on Sep 16, 2026

    @abruption
    OwnerAuthor

    Decision recorded in PR #71: defer a general wait / send --wait interface.

    The supported native observer is narrower than session-peer's transport surface. Claude Code documents notify_when_idle as a one-shot notice from a main Claude conversation watching another session on the same machine. It explicitly excludes subagents, agent-team teammates, and sessions beyond that machine. Codex queue submission has no equivalent acknowledgement observer available to session-peer. Sources: idle notices, message delivery, and inbox socket.

    Transcript tailing remains unsuitable: a new record can belong to another request, while a missing record can mean held input, an offline target, changed storage, or an unfinished turn. That cannot support honest consumed/acknowledged semantics, timeout, cancellation, or delayed-reply correlation across Claude, Codex, and SSH.

    PR #71 therefore exposes capabilities.replyObservation.status: unsupported, documents the reproducible reason, and updates skills/session-peer/SKILL.md with the working pattern: include a correlation token and ask the target to send an explicit message to the structured Reply-To URI. No polling, resend, activation, or transcript marker inference is performed. This satisfies the issue's documented defer path without introducing false-positive success.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions