Skip to content

fix(acp): reconcile hosted agent directory profiles - #5929

Open
LucasMoskun wants to merge 1 commit into
block:mainfrom
LucasMoskun:fix/acp-agent-profile-reconcile
Open

fix(acp): reconcile hosted agent directory profiles#5929
LucasMoskun wants to merge 1 commit into
block:mainfrom
LucasMoskun:fix/acp-agent-profile-reconcile

Conversation

@LucasMoskun

Copy link
Copy Markdown

Summary

  • reconcile buzz-acp identities into the replaceable kind 10100 agent directory after startup channel discovery
  • publish actual channel names/IDs and effective response authorization while preserving unknown profile fields
  • project the implicit runtime owner into the public allowlist, including the equivalent owner allowlist for owner-only mode
  • retain an existing channel_add_policy, or require an explicit first-time BUZZ_ACP_CHANNEL_ADD_POLICY so startup never guesses or widens policy
  • skip unchanged profiles and keep reconciliation failures non-fatal

Why

Desktop mention authorization now fails closed for remote agents missing current directory authorization. Legacy manually hosted agents can still be relay members and channel bots with valid kind 0 profiles, yet remain absent from autocomplete and receive no signed p tag. A live headless canary confirmed that a complete profile with the effective owner restores autocomplete, signed-recipient delivery, and harness wake without a Desktop restart.

Closes #5928.

Validation

  • live canary: Desktop 0.5.14 autocomplete -> signed p tag -> relay -> buzz-acp wake
  • cargo test -p buzz-acp (783 passed)
  • cargo clippy -p buzz-acp --all-targets -- -D warnings
  • just ci (full workspace/desktop/web/mobile gate passed; mobile: 1,399 tests)

Co-authored-by: LucasMoskun <contact@lucasmoskun.com>
Signed-off-by: LucasMoskun <contact@lucasmoskun.com>

@themiguelamador themiguelamador left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found and fixed three issues in the new startup reconciliation path:

  • Kind 10100 is replaceable, but the new event used the wall-clock second without advancing the observed head. A reconciliation in the same second as the current profile could therefore lose the NIP-16 event-ID tie-break and leave stale authorization/channel data authoritative.
  • Buzz’s POST /events returns HTTP 200 for an ingest result even when its JSON says accepted:false. The code ignored that field and logged Published, so stale/rejected writes could be reported as successful. Publication now requires explicit acceptance.
  • The operation is documented as non-fatal, but it performs up to three REST calls whose client retry budgets can collectively delay the subscribed main event loop for roughly two minutes during a partial HTTP outage. The whole best-effort reconciliation is now capped at ten seconds.

Fix: Complear/buzz branch review/pr-5929-fix, commit 8a837a5f28a69005c3a7c4db44b61d88b358acb4.

Verification:

  • cargo test -p buzz-acp: 785 unit tests + 9 lifecycle integration tests passed
  • focused profile reconciliation tests: 6 passed
  • cargo clippy -p buzz-acp --all-targets -- -D warnings
  • cargo fmt --check
  • git diff --check

Requesting changes until the fix is incorporated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buzz-acp: reconcile kind 10100 profiles for manually hosted agents

2 participants