Skip to content

Add relay-up plugin: Session Relay — cross-session task & chat relay - #18

Open
Great-us wants to merge 1 commit into
zai-org:mainfrom
Great-us:add-relay-up-plugin
Open

Great-us wants to merge 1 commit into
zai-org:mainfrom
Great-us:add-relay-up-plugin

Conversation

@Great-us

Copy link
Copy Markdown

What user problem does this solve?

Coordinating multiple ZCode windows (e.g. an expensive model as leader + cheap models as workers) currently means copy-pasting between windows by hand. relay-up turns dispatch → execute → report → review → dispatch into a fully automated loop. All transport is plain file I/O — the relay itself never calls any model API, and workers always remain visible native windows (a deliberate principle).

What's included

  • /relay-up skill — scaffolds the mailbox (relay-task v1.1 card lane + directed chat lane), the relay-next worker skill, runtime skeletons, and two small tools into any project. Idempotent: existing files are never overwritten (restore semantics). /relay-up down backs everything out to a timestamped folder.
  • Hooks (SessionStart / UserPromptSubmit / Stop) — session registration for model accounting, pending-chat delivery as context, and atomic claim of the next card + chat with continuation injection. Activated only in projects containing the relay/relay.enabled marker that /relay-up writes; entirely fail-open (any exception exits silently with exit 0).
  • Worker flow — drain-mode execution (all pending cards in one turn), optional per-window 5-minute watcher cron installed from the included bootstrap card template, 9-field report contract.
  • Leader flowtools/verify_report.py: 7-check acceptance (field presence, dual SHA-256, task-id match, status enum, artifacts existence), plus idle governance (sustained idleness stands workers down and throttles the leader; one sentence revives everything).

Reference implementation and full docs: https://github.com/Great-us/relay-up

How it was tested

  • 25 stdlib-only tests in plugins/relay-up/tests/python tests/test_relay_hook_chat.py → 20 OK; python tests/test_chat_send.py → 5 OK (claim/inject/merge/dedupe/quarantine/gating/fail-open/multi-project marker routing; chat_send CLI).
  • Platform behaviors verified against live ZCode sessions (2026-09): Stop continuation injection via {"decision":"block"}, UserPromptSubmit additionalContext delivery, the 3-continuations-per-turn cap, cron self-wake, and one full end-to-end loop (bootstrap → dispatch → execution → report → acceptance → review chat).

Version and marketplace registration

relay-up v0.1.0, category developer-tools, registered in the root marketplace.json with name/version/description identical to the manifest.

Dependencies, network, permissions, and side effects

  • Requires python (3.8+, stdlib only) on PATH.
  • No network access. No model/API dependencies beyond the user's own sessions. No credentials are read.
  • File writes: only inside the target project's relay/ tree, .zcode/skills/relay-next/, and two tool files (tools/chat_send.py, tools/verify_report.py) — all created by /relay-up and declared in the plugin README.
  • Hooks read session metadata from stdin and write only under the marked project's relay/runtime/ (session registry, chain log, chain state).
  • Optional automations: the bootstrap card creates a per-window watcher cron via the platform scheduler; /relay-up down and shutdown cards remove them.
  • Third-party code/assets: none. All original code, MIT licensed.

Checklist

  • plugin name is unique and kebab-case
  • .zcode-plugin/plugin.json present; name/version/description match the root marketplace.json
  • bilingual README.md / README_CN.md with side effects documented
  • python scripts/validate.py → OK: 27 plugin(s) validated
  • python scripts/build_dist.py → exit 0 (relay-up 0.1.0 zip, 34,740 bytes)
  • git diff --check clean

…for ZCode

New community plugin relay-up (v0.1.0, developer-tools):
- /relay-up skill scaffolds a file-based mailbox (task cards + chat) into any
  project, idempotently
- SessionStart/UserPromptSubmit/Stop hooks auto-inject pending cards and chat,
  activated only by the relay/relay.enabled marker, fail-open
- drain-mode worker skill, watcher-cron bootstrap, 7-check acceptance verifier
- 25 stdlib tests; bilingual README; no network, no third-party code; MIT
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