Skip to content

refactor(deliver): one delivery function per host - #74

Merged
leeguooooo merged 1 commit into
mainfrom
refactor/per-host-delivery
Nov 6, 2026
Merged

leeguooooo merged 1 commit into
mainfrom
refactor/per-host-delivery

Conversation

@leeguooooo

Copy link
Copy Markdown
Owner

Pure refactor, no protocol change.

Before: cmdSend inlined Pi and Hermes wakes, deliverDm had its own Claude/Pi/Hermes/OpenCode/Grok branches, and deliverNotice a third copy — the same wake + wording + exit-code logic written up to three times per host (adding the Claude channel in #71 meant touching four places).

After: each host has one deliverTo<Host> in src/deliver.ts (deliverToClaude, deliverToPi, deliverToHermes, deliverToOpenCode, deliverToGrok, plus the existing deliverToCodexTask). Entry points only resolve addresses and call them. Every host's wake primitive now has exactly one call site. Parallel Claude wakes in send use a bufferedSink and flush in target order instead of reporting each result twice.

Behaviour notes (notice path only): a Pi notice with an unknown outcome now prints the unknown-outcome line (exit semantics unchanged), and an OpenCode notice failure includes its detail — both now match dm.

Verification: tsc clean; full suite same as main (only the 4 environment-specific local failures); new test/deliver.test.ts for buffered ordering. No CHANGELOG entry, so merging does not cut a release.

send, dm, ocs notices and the LAN daemon each had their own copy of the Claude, Pi,
Hermes, OpenCode and Grok wake + reporting code. Each host now has a single
deliverTo<Host> in deliver.ts (Codex already had deliverToCodexTask); entry points only
resolve addresses. Parallel Claude wakes in send buffer their output and flush in target
order instead of reporting twice.

Small wording alignment on the notice path: a Pi notice with an unknown outcome uses the
unknown-outcome line, and an OpenCode notice failure includes its detail, as dm already did.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 78fed918-b45f-4c28-a879-bf67b0c510c7
Commits

Reviewing files that changed from the base of the PR and between dfd6c28 and 7f12891.

Files selected for processing: 3

  • src/cli.ts
  • src/deliver.ts
  • test/deliver.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@leeguooooo
leeguooooo merged commit 995b184 into main Nov 6, 2026
7 checks passed
@leeguooooo
leeguooooo deleted the refactor/per-host-delivery branch November 6, 2026 09:25
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