feat(pi-bots): the pi-bots command on Pi Durable's agents' PATH (#9) #18
No reviewers
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bryan/nix-configs!18
Loading…
Reference in a new issue
No description provided.
Delete branch "n9-2-pi-bots-command"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Piece N9.2 of #9: Pi Durable's services find the bot service's command.
What
services.pi-botsinstalls api-botscommand in the system profile (services.pi-bots.package, read-only)./run/current-system/sw/binis already on thePATHof Pi Durable's agents (agentEnvironmentinpi-durable.nix), so the SGG service and the sampler find it. Under launchd,notify.pi_bots.clican name/run/current-system/sw/bin/pi-botsas an absolute path.src/cli.tson Homebrew's node, as the service's own agent does. It setsPI_BOTS_HOMESERVERandPI_BOTS_STATE_DIRto the service's values unless the caller has set them (an empty value counts as unset). Pi Durable's notifier passes onlyPATH,HOMEandPI_BOTS_*, so it reaches the running service's socket and needs no--homeserver.modules/services/AGENTS.md(the pi-bots row), README and a comment inpi-durable.nix.Not here: switching
sgg.jsonandsampler.jsontopi_bots, which is durable-pi-workspace's job.Tests
python3 scripts/test_pi_bots_service.py(28, 5 of them new, inCommand):bin/pi-bots;/run/current-system/sw/bin;PATHandHOME:PI_BOTS_*settings win;Each guard was mutated: defaults dropped, export dropped,
:-→+x, package not installed, arguments altered, stdin cut off (</dev/null), andexecdropped. Every mutation fails a test. The stand-in echoes its stdin and pid, so the test checks that a Markdown body sent with--file -arrives verbatim and that the command line is the caller's own child (the notifier's SIGKILL on a timeout reaches it).darwin-rebuild build --flake .#studiobuilds. With onlyPATHandHOMEset, the builtresult/sw/bin/pi-bots service statusanswered from the running service.scripts/test_pi_durable_module.pyhas 5 failures. The same 5 fail onmain: a DashystatusNameassertion in sampler-off and commissioning-off cases. They are unrelated to this change.Review
A visible Pi reviewer (Opus 5.5, medium) checked the change against the consumer,
notify.ts. It found one should-fix: the tests did not guard stdin passthrough orexec. It also raised two nits: the wording said "every agent's PATH", and the docs did not say the command exists only whileservices.pi-botsis enabled. All three are fixed. Correction 1 was approved, and the line-wrap nit it raised is fixed too.feat(pi-bots): the pi-bots command on every agent's PATH for Pi Durable (#9)to feat(pi-bots): the pi-bots command on Pi Durable's agents' PATH (#9)