Repository navigation
doctor warns when a Buzz agent's directory record and profile disagree on its name - #196
Conversation
The kind-10100 record kept the first display_name it was published with: directoryFor never set one, so the carried value won on every publish. Registration now passes the display name it was given (profile.json or --name), and publishes under manifest.name as run does, so the two writers stop flipping the name field. run's reconcile still carries the record's display name. Refs sageox/sageox-monorepo#3582 Co-Authored-By: Madhur Shrimal <642275+shrimalmadhur@users.noreply.github.com> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…t leak in Co-Authored-By: Madhur Shrimal <642275+shrimalmadhur@users.noreply.github.com> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e on its name A rename that reached the kind-0 profile but not the directory record left the record's display_name binding to nobody, while doctor still called the agent mentionable. doctor now reads the profile and warns, naming both values and the fix (re-run identity register buzz). A space in the name is not flagged: clients match multi-word names. Part of sageox/sageox-monorepo#3583 Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Medium impact] The change affects the diagnostic output for configured Buzz agents. Add a connection time limit before merging so the optional check cannot stall setup.
|
…a silent relay Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> #194 landed as a squash. Keep main's copy of the register test, and move this PR's CHANGELOG entry from 0.13.0 back under Unreleased.
…apter do Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…rites identity register buzz signs only with BUZZ_NSEC, so for a surface on another identity the warning now says it cannot fix that record instead of offering it, and every form names the relay. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…offering re-registration Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…re-registration Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… typed path Co-Authored-By: Ryan Snodgrass <ryan@sageox.ai> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
doctornow reads the agent's kind-0 profile and warns when the directory record'sdisplay_namematches neither the profile'sdisplay_namenor itsname. That is the Ron case: the profile was renamed to "Ron", the record kept "Ron Weasley", so@Ron Weasleyreached nobody whiledoctorstill said the agent was mentionable. A mismatch replaces the "so it is mentionable" line with:The repair it names depends on #194 (re-registering renames the record), which has merged; this branch now includes it and targets
main.packages/adapter-buzz/src/profile.ts: newreadProfile, bounded by the sameCONNECT_MSconnect timeout as a publish. The directory fetch is generalized intofetchOwn(relay, pubkey, kind), which applies NIP-01's replaceable-event rule: newestcreated_atwins, and a same-second tie goes to the lower id, assupersedesinbuzz.tsdoes.packages/cli/src/cli.ts:profileNameDriftruns after the existing channel, respond_to and allowlist checks. If the profile can't be read, has no name, or the record has nodisplay_name, the check stays silent or gives a read warning. It never adds a new problem.docs/guide/chat-surfaces.md.Ryan's call (default chosen:
warn). I made this a warning, not aproblem. The profile's own name still reaches the agent, andbuzz-agent-start.shrunsdoctor, so aproblemwould block bring-up of an agent that can still be reached. To make it blocking, changeopts.warnings.push(drift)toopts.problems.push(drift)incheckDirectory.Repair hint names the relay and only offers what registration can do. Registration signs only with
BUZZ_NSEC, so the hint saysre-run \sageox-agent identity register buzz` againstonly when the surface's identity resolves to the same key asBUZZ_NSEC` (an alias ref to that key counts). For a surface on another key, the warning says registration cannot fix that record instead.Part of sageox/sageox-monorepo#3583. The whitespace half needed no code; this PR adds the name check.
Test Plan
New
packages/cli/test/doctor-directory-name.test.tsruns the realbin/sageox-agent doctoragainst an in-processLocalRelay(auth required) that holds a signed directory record and a signed kind-0 profile:{name: "Ron"}: expects the warning with both names and the fix, and no "so it is mentionable".Red first, with only the
cli.tschange reverted:New
readProfiletest inpackages/adapter-buzz/test/profile.test.ts: two profiles signed in the same second, the higher id delivered last. Red with only the tie-break reverted:doctor-directory-name.test.tsalso covers the hint: a surface on another key (BUZZ_NSEC_TWO) is not offered re-registration, and one whose ref (AGENT_NSEC) holds theBUZZ_NSECkey is. The alias case was red with the key comparison reverted to the ref-name check. Doctor resolvesBUZZ_NSECthe way registration's directory publish does (a mounted/mnt/secrets-store/BUZZ_NSECbefore.env), so a mounted key that differs from the alias's gets the "cannot fix" warning. That case can't run in CI (it needs a file under/mnt), so I checked it by hand with a throwaway test: red with the mount-first lookup reverted, green with it.With the fixes restored, those plus
doctor-channels,run-directory,identity-register-directoryand the rest ofadapter-buzz/test/profilepass.pnpm typecheckis green. The full suite runs in CI (this VM has noagebinary).Leftover: confirming the warning against a real drifted agent on buzz.test.sageox.ai needs live relay credentials, so that isn't covered here.
Checklist (expand if needed)
pnpm typecheck && pnpm testgreen (typecheck green; full suite on CI)deploy/changed (N/A)Link to Devin session: https://app.devin.ai/sessions/ae1a5a2674424adba5e7fe49bb7f165f
Open in Devin Desktop: https://app.devin.ai/desktop/session/ae1a5a2674424adba5e7fe49bb7f165f?variant=devin
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work
Summary by CodeRabbit
doctorcheck warns when a Buzz agent’s directory display name differs from its profile name or the profile cannot be read. Mismatches show both names and recommendsageox-agent identity register buzz; names containing spaces are supported.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.