Skip to content

feat(install): relay client from PyPI (ag2-sparrow) + launcher that actually starts it under services - #3

Merged
qingyun-wu merged 1 commit into
mainfrom
feat/use-ag2-sparrow-pypi
Jul 13, 2026
Merged

qingyun-wu merged 1 commit into
mainfrom
feat/use-ag2-sparrow-pypi

Conversation

@qingyun-wu

Copy link
Copy Markdown
Contributor

Box: Track 14 connect-agent onboarding, step-4 — BYO-agent distribution via PyPI (ag2-sparrow is live: https://pypi.org/project/ag2-sparrow/0.2.0/).

What

  1. Relay from PyPI. install.sh installs ag2-sparrow>=0.2.0 alongside the worker (pipx or the shared venv) instead of sparse-fetching relay files from the sutando repo. Supersedes fix(install): fetch the full 8-module relay closure #2 — the 6-vs-8 closure bug disappears with the fetch itself; recommend closing fix(install): fetch the full 8-module relay closure #2 when this merges.

  2. Services actually start the relay now. The merged installer's launchd/systemd units ran only the worker; their RELAY_CLIENT env was inert (the worker never spawns the relay), so under the service path tasks never arrived. The installer now writes ~/.agent-connect/launch.sh — one code path for launchd, systemd, nohup, and by-hand — which starts the relay wired to the worker's workspace via the dir-interface trio (AGENT_CONNECT_TASK_DIR/RESULT_DIR/STATE_DIR), then execs the worker, with the workspace-keyed pidfile hygiene from run-agent.sh.

  3. run-agent.sh prefers the ag2-sparrow console script; an explicitly-set legacy RELAY_CLIENT file keeps its old behavior. The canonical path drops the dead SUTANDO_WORKSPACE export (ignored by the old client since sutando#1440 — the exact misalignment the 0.2.0 dir interface fixes).

Verification

  • install.test.sh (now fully offline): 16/16 green — syntax, arg gates, dry-run, launcher wiring (env trio + interpolated absolute bins + worker exec), sparse-fetch-regression guard.
  • Instrumented E2E: ran the generated launch.sh with fake relay/worker bins that record their env — relay received the aligned dir trio + token/URL, worker started, pidfile carried both pids.
  • Clean-venv pip install ag2-sparrow==0.2.0 from PyPI verified separately (imports, ~/.ag2-sparrow defaults, console entrypoint).

Follow-up (not this PR)

— @sutando-qingyun-001

🤖 Generated with Claude Code

…ctually starts it under services

Replaces the sparse-fetch of relay files from the sutando repo with
`pip install ag2-sparrow>=0.2.0` (pipx or the dedicated venv — same
isolation strategy as the worker). Supersedes #2: the 6-vs-8 closure bug
disappears with the fetch itself.

Also fixes a functional gap in the merged installer: the launchd/systemd
units launched ONLY the worker — the RELAY_CLIENT env they set was inert
(the worker never spawns the relay), so tasks never arrived under the
service path. install.sh now writes ~/.agent-connect/launch.sh — one code
path for every start mode (launchd/systemd/nohup/by hand) that starts the
relay wired to the worker's workspace via ag2-sparrow's dir-interface env
trio (AGENT_CONNECT_TASK_DIR/RESULT_DIR/STATE_DIR), then execs the worker,
with the same workspace-keyed pidfile hygiene run-agent.sh uses.

run-agent.sh prefers the ag2-sparrow console script; an explicitly-set
legacy RELAY_CLIENT file path keeps its old behavior. The dead
SUTANDO_WORKSPACE export is gone from the canonical path (the old client
ignored it post-sutando#1440 — the misalignment the dir interface fixes).

install.test.sh: fully offline now; asserts the launcher is written with
the dir-interface wiring, interpolated absolute bins, and a worker exec;
guards against sparse-fetch reappearing. Verified beyond the smoke tests
with an instrumented E2E: fake relay/worker bins record their env — relay
receives the aligned dir trio + token/URL, worker starts, pidfile carries
both pids.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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