Add federation exchange status observability#284
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a live observability endpoint for the Lefine/ForgeFed exchange flow so we can see whether docker-git is connected and whether requests/tasks are arriving.
Changes:
GET /federation/exchange/statusfollow.sent,inbox.follow.accept,inbox.follow.reject,inbox.issue.received, andpoll.completedlastInboxAt, andlastPollAtpackages/api/README.mdRelated:
How to use
Set the public federation origin to the public URL that Lefine can reach:
Create or reuse the Lefine exchange subscription:
Check whether the connection is alive:
curl "$API/federation/exchange/status"Important fields in the response:
summary.accepted > 0means Lefine accepted our Follow subscription.summary.lastInboxAtmeans something arrived in/federation/inbox, for example Lefine'sAccept.summary.lastPollAtmeans docker-git successfully polled the remote Lefine outbox.summary.issuesis the number of ForgeFed issues/Tickets currently persisted by docker-git.summary.processedOutboxItemsis the number of outbox items already handled, used for deduplication.recentEventsshows the latest exchange activity: Follow sent, Follow accepted/rejected, issue received, poll completed.Run a safe manual poll that does not start agents/projects:
Run a normal poll that can create docker-git projects/agents when new
Create(Ticket)items exist:View persisted incoming issues:
curl "$API/federation/issues"Expected flow:
Followto Lefine and recordsfollow.sent.Acceptinto/federation/inbox; status becomesaccepted,lastInboxAtis set, andinbox.follow.acceptappears inrecentEvents.poll.completed.Create(Ticket)creates a persisted issue and recordsinbox.issue.received.runTasksis notfalse, docker-git starts the project/agent flow using the Ticket GitHub URL orDOCKER_GIT_EXCHANGE_PROJECT_REPO_URLfallback.A subscription by itself does not create a docker-git task. It only establishes the ActivityPub connection. Tasks appear after Lefine publishes/sends a
Create(Ticket).Live smoke result
Smoke-tested with a public Cloudflare origin. Current observed state after subscribing to Lefine:
{ "summary": { "subscriptions": 1, "accepted": 1, "pending": 0, "rejected": 0, "issues": 0, "processedOutboxItems": 0, "lastInboxAt": "2026-05-12T11:33:59.448Z" }, "subscriptions": [ { "target": "https://problemsets.lefine.pro/actor/code", "queue": "code", "status": "accepted", "remoteActor": "https://problemsets.lefine.pro/actor/code", "remoteOutbox": "https://problemsets.lefine.pro/outbox/code" } ] }Manual safe poll returned
totalItems=0,newItems=0,processedItems=0, so the connection is accepted but Lefine had no new tasks in the outbox at that moment.Verification
Result: API tests passed, 18 files / 109 tests.