feat(agents): reach sources through a relay agent #64
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!64
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/6-relay-agent"
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?
What changed
Browser-checked PR #64 at 390px and desktop with a real agent (C17: token shown once, Online/Offline/Revoked badges, delete, revoked token rejected, agent select only where valid); audited it against the design; the one bug found (F1 revoke race) is fixed in
4df7474and my failing test for it now passes with the agent suite (C21), CI green.Fixes #6
Red, then green
export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_TEST_PARTITION=6 mix test test/lamplighter/agents/relay_test.exs169940c): exit 1Checks
cd /tmp && timeout 150 ~/.venvs/pw/bin/python /home/peak/work/lamplighter-v1-2/checks/agents_browser.py, exit 0export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_TEST_PARTITION=6 mix test test/lamplighter_web/live/agent_settings_live_test.exs test/lamplighter_web/live/source_live/agent_select_test.exs, exit 0export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_TEST_PARTITION=6 mix test test/lamplighter/agent/ test/lamplighter/agents/, exit 0export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_TEST_PARTITION=6 mix precommit 2>&1 | tail -3, exit 0f05af0dpasses: token shown once with compose snippet, no overflow, Never connected → Online live with a real agent → Offline after it stops, revoke/delete, revoked token stays rejected, select only once an agent exists, absent on QNAP, Docker unix socket + agent errors. (Nye):cd /home/peak/work/lamplighter-v1-2/lamplighter && source ../env.sh && python3 ../review6/nye_agents_check.py | grep -v 'badge goes Offline' ; python3 ../review6/nye_agent_offline_check.py, exit 04df7474my F1 revoke-race test and all agent tests pass: a poll that passed auth before revoke now gets {:error, :revoked} and no source jobs. (Nye):source ../env.sh && mix test test/lamplighter/agents test/lamplighter/agents/nye_revoke_race_test.exs, exit 0Found and fixed
Risks
Hub is in memory, so single replica only (D7, already documented). The revoked-agent set grows by one entry per revoke until restart (negligible). QNAP SNMP and the Docker unix socket can't go through an agent (D11, documented). 7 small nits sent to Upper Wolfjaw (e.g. a timeout message says 15s where the docs say 25s; docs omit AGENT_ALLOW_INSECURE_SERVER) don't block shipping. Jeremy hasn't seen assumed decisions D7–D11.
Prover
Passed (Sonnet): At
4df7474the agent suites (94) and full precommit (981) pass, and my own revoke-race test and allowlist probes found nothing; not rerun: browser checks, real Docker image, multi-replica.Every command above was run by Fortysix's Basecamp itself, on the branch named.
Settings → Agents and the source form's agent select (feat/6-relay-agent @
ace238d), Chromium at 390px and 1280px. Check script: checks/agents_browser.py on my side.390-agents-created

desktop-agents-created

390-agents-list

desktop-agents-list

390-source-agent

desktop-source-agent

A poll that passed AgentAuth just before its agent was revoked could register with the Hub after disconnect, mark the agent online and be handed source jobs for one hold. The Hub now remembers disconnected agents and refuses their awaits and requests with {:error, :revoked}.