feat(remote): client mode, token auth, install scripts, install-skill, a2a-poll + durable-cron - #139
Conversation
…ill, a2a-poll + durable-cron docs/skill - config.py: get/set_server_url (TAOSMD_SERVER_URL env + config.json server_url) and get/set_server_token (TAOSMD_TOKEN env + server_token) with same defensive pattern as existing get/set_memory_model. - taosmd/remote.py: RemoteClient(base_url, token, timeout) — stdlib urllib only. Async methods via asyncio.to_thread: ingest, search, pending_list, pending_resolve, a2a_send, a2a_feed, a2a_channels, a2a_members, stats. Non-2xx raises RuntimeError(status+body). - service.py: _get_remote(data_dir) dispatch at top of every function. When data_dir is explicit (http_server path), reads only config.json (never TAOSMD_SERVER_URL env) to prevent infinite-loop self-proxying. When data_dir is None (CLI/MCP/Python API), full env+file resolution. Remote client instances cached by (url, token) tuple. - http_server.py: optional server-side token auth. If server_token is set in the server's own config.json, every data/A2A JSON endpoint requires Authorization: Bearer <token> (401 JSON otherwise). GET /health, /, /ui, and static assets are always open. - cli.py: taosmd config set-server <url>/--clear, set-token <token>/--clear, config show (prints url + whether token is set, never the token value). Global --server URL flag. taosmd install-skill (--force). taosmd a2a-poll --channel --exclude --state-file --server. - taosmd/skills/taosmd-a2a/SKILL.md: packaged copy of skill, added cron step. .claude/skills/taosmd-a2a/SKILL.md: updated with cron step. pyproject.toml: skills/**/* added to package-data. - scripts/install-client.sh/.ps1: pip install → set-server → install-skill → /health check. scripts/install-server.sh/.ps1: pip install → --install-service → health check → Tailscale guidance + token reminder. No hardcoded IPs. - docs/a2a-comms.md: "Durable monitoring" section with idempotent cron snippet (create-or-amend tagged line), schtasks Windows equivalent, inbox format, session ritual reminder. - tests/test_remote.py: RemoteClient round-trips, config get/set + env-override, service dispatch goes-remote/stays-local, token auth (no-header 401, correct 200, health open), install-skill idempotent/force. tests/test_a2a_poll.py: seed via test server, poll prints only-new, state updates, --exclude filters + advances state, multiple channels tracked independently. 466 tests pass.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR implements a complete remote client-server architecture for taOSmd, enabling distributed deployments with token-based authentication, durable message polling for A2A bus monitoring, and automated installation scripts for both client and server platforms. ChangesRemote Client-Server Architecture
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
TAOSMD_SERVER_URLenv ortaosmd config set-server <url>transparently routes all service calls (ingest, search, pending, A2A) throughRemoteClient(stdliburllib, async viaasyncio.to_thread). Local behavior completely unchanged when no URL is set.taosmd config set-token/TAOSMD_TOKENon clients;server_tokenin server's config.json gates data/A2A endpoints withAuthorization: Bearer(401 JSON otherwise).GET /health,/, and static assets always open.scripts/install-client.sh/.ps1(install → set-server → install-skill →/healthcheck) andscripts/install-server.sh/.ps1(install →--install-service→ Tailscale guidance + token reminder). No hardcoded IPs.taosmd install-skill— copies packagedtaosmd/skills/taosmd-a2a/SKILL.mdinto~/.claude/skills/taosmd-a2a/, idempotent without--force.taosmd a2a-poll— cron-friendly poller: fetches/a2a/messages, prints only messages with ID > last-seen (state file~/.taosmd/a2a-poll-state.json), supports--exclude <agent>, updates state on exit.docs/a2a-comms.mdgains a "Durable monitoring" section with idempotent create-or-amend crontab snippet (tagged# taosmd-a2a:CHANNEL), Windowsschtasksequivalent, and session ritual reminder..claude/skills/taosmd-a2a/SKILL.mdand the packaged copy tell the agent to set up the hourly cron after joining.Test plan
python3 -m pytest -q→ 466 passed, 0 failedtests/test_remote.py— RemoteClient round-trips, config get/set + env-override, service dispatch (remote/local), token auth (401/200/health-open), install-skill idempotent/forcetests/test_a2a_poll.py— seed via test server, poll prints only-new, state file updates,--excludefilters + advances state, multi-channel stateSummary by CodeRabbit
New Features
Documentation