Skip to content

Add reply subscriptions with bounded classification and agent notifications - #4

Merged
ishwar00 merged 6 commits into
mainfrom
feat/reply-subscriptions
Nov 2, 2026
Merged

ishwar00 merged 6 commits into
mainfrom
feat/reply-subscriptions

Conversation

@ishwar00

@ishwar00 ishwar00 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Agents can subscribe to responses about sent WhatsApp messages, including ordinary unquoted group replies. The service classifies incoming batches against the original request and sends pointer-only Postbag notices to the waiting agent. Unrelated group chatter stays quiet.

Flow: approve and send → subscribe using accepted draft IDs or outgoing message IDs → read relevant replies when notified → receive a fixed-deadline outcome. Already-stored replies are included, so fast responses arriving before subscription creation are recovered. Expired-anchor registrations are rejected. Catch-up starts at the first in-window revision, with no quiet delay on irrelevant history pages. There is no prepared-watch state or acknowledgment call.

  • watch_replies, get_replies, and cancel_watch, with durable revisions and repeatable cursor reads.
  • Decisions, cursor advancement and notice creation commit atomically. Model execution happens outside transactions.
  • Context-sized batches isolate oversized messages without preventing neighboring replies from being classified. Chronological context includes interleaved owner/filtered messages. Uncertain results surface immediately as possible, without a recheck queue. Exact quoted replies remain relevant at expiry; tombstones do not trigger pushes.
  • Notification credentials are stored once per agent/destination; renewal through one watch repairs sibling watches too.
  • Four delivery states and bounded retries, including uncertain outcomes, with stable notice IDs/revisions. Duplicate pointers are safe; submission does not prove agent processing.
  • Temporary configurable Claude Code/Codex classifiers, bounded context, fixed deadlines and call budgets. Existing human send approval remains client-enforced.

Setup: docs/replies.md. Push requires the Postbag extension in parasxos/postbag#31; a pinned fork install is documented. Pull does not require Postbag.

Validation:

  • Typecheck/build clean; 95/95 bridge tests pass.
  • Regression tests reproduce rollback at notice insertion, oversized-message isolation and batch pagination, shared-token renewal and concurrent rotations, default-delay catch-up over 1000 old messages, interleaved context, quoted deadline handling, immediate replies before subscription, fixed deadlines, unknown-submission retries, and concurrent registration idempotency.
  • Real Haiku synthetic runs classified the valid DNS reply while isolating an oversized paste and unrelated chatter, including interleaved owner follow-ups and 1000 old messages; reply and expiry notices were submitted through Postbag. No WhatsApp messages sent.
  • The unchanged Postbag dependency previously passed its full 686-test suite; its six focused service tests pass again.
  • Claude simplify-by-design review requested for the final committed implementation; no blockers at source commit 0cf8be7. Its synthetic busy-group probe confirms catch-up improved from 66 to 6 simulated seconds with default batching delay.

Limits: classification can misjudge relevance; audit reads retain unrelated/unclassified candidates. CLI isolation depends on installed flags and is not an OS security boundary. Only messages delivered by WhatsApp are available.

@ishwar00
ishwar00 merged commit cef7816 into main Nov 2, 2026
2 checks passed
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