Repository navigation
test(agent-registry): 25 structural tests for local registry skill (#1039) - #1159
bassilkhilo-ag2 wants to merge 1 commit into
Conversation
VasiliyRad
left a comment
There was a problem hiding this comment.
Two issues before approving:
-
build_log.mdmust be removed from the PR. It's in.gitignore— this is mutable workspace state from the proactive loop, not something that should be tracked. Likely force-added by accident. -
src/health-check.pychange is a production code modification (new_pid_scripthelper, enriched multi-PID warn format). The PR title/scope istest(agent-registry)— a functional health-check change doesn't belong here. Split it into its own PR (e.g.fix(health-check): show source paths in multi-bridge warn) or at minimum retitle to reflect both scopes.
Tests themselves look solid — structural grep assertions, meaningful invariants, no false-positive risk. Happy to approve once the two items above are addressed.
|
Status update (2026-05-26): The The health-check change ships cleanly in PR #1157 (already APPROVED by @VasiliyRad). The build_log.md chore commits should never have been pushed and will be dropped. A rebase onto upstream main (dropping build_log.md, letting health-check land via #1157) is ready — pending owner go-ahead to force-push. The actual test content here is unchanged and passes against current main. |
…ill (sonichi#1039) Covers: stdlib-only constraint, ThreadingHTTPServer binding, sqlite3 schema, 127.0.0.1-only bind, all 5 endpoints, port-range scan, atomic discovery file write/remove, STALE_SECS/PRUNE_SECS, threading lock, ON CONFLICT upsert, workspace resolution; client: discovery-based location, --autostart, watch cmd, start_new_session=True, SIGTERM; hook: backgrounded, --autostart, CLAUDE_PROJECT_DIR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c82c296 to
31cf079
Compare
|
Branch rebased onto origin/main — bundled junk (build_log.md, health-check.py, health-check-bridge-multi-pid.test.py) stripped. Diff is now clean: only the intended test file(s). |
What
Structural tests covering the agent-registry skill added in PR #1039.
Background
PR #1039 introduced a local, dependency-free HTTP service that tracks running Claude Code instances. Agents register via a SessionStart hook, heartbeat while alive, and the registry ages out stale entries. Consumers (dashboard, Electron overlay) read the live list over a localhost API.
No tests shipped with the PR. This adds structural coverage for the critical invariants.
Tests (25 assertions)
registry-service.py (16)
ThreadingHTTPServerfromhttp.serversqlite3for persistence127.0.0.10.0.0.0/register/heartbeat/deregister/agents/healthPORT_RANGEdefined (port scan)for port in range(...)iterates free-port scanwrite_discovery()called at startupagent-registry.jsondiscovery file nameremove_discovery()in finally block<workspace>/data/agent-registry.dbSTALE_SECSdefinedPRUNE_SECSdefinedON CONFLICTupsert for idempotent re-registrationthreading.Lock()guards DB operationsos.replace()for discovery writeSUTANDO_WORKSPACEenv var respected~/.sutando/workspacedefault presentregistry-client.py (5)
agent-registry.jsonto find service--autostartsupportcmd_watch/def watchexistsstart_new_session=Truefor service subprocesssignal.signal+SIGTERMhandlerurllib(stdlib), notrequestssession-start.sh (3)
&)--autostartCLAUDE_PROJECT_DIRas--cwdRun
🤖 Generated with Claude Code