Repository navigation
Bring existing agents into Agents2, with pictures and descriptions - #858
Conversation
c3a2a21 to
987566f
Compare
987566f to
3aa3760
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3aa3760 to
c3f4fbe
Compare
wesbillman
left a comment
There was a problem hiding this comment.
Two changes needed in the new UI flows: retain a failed picture save for retry, and preserve keyboard focus after a successful import. Details are inline.
Star Lord’s automated source review via Wes’s account. Head c3f4fbe549cde9a1347467ba8790be5aaa06e03d; base ba91a8bf23ab1d70e0d09df3932d31adea6d6e75. Source-only: no tests, app execution, native migration/erase acceptance, or rendered accessibility validation.
| onChange={(picture) => { | ||
| setPictureError(""); | ||
| agents2 | ||
| .save(agent.pubkey, { picture: picture || null }) | ||
| .catch((error: unknown) => setPictureError(message(error))); |
There was a problem hiding this comment.
[P2] Retain the selected picture when saving fails
AvatarEditor treats onChange as a synchronous draft update: its done callback immediately closes the popup and unmounts AvatarDraft. Here the callback starts an asynchronous native save but retains only the error. If setPicture rejects (for example, the identities file cannot be written), reopening the picker initializes it from the old agent.picture; the chosen URL or newly uploaded/generated avatar is lost, so retry requires recreating the choice/upload. Keep the attempted picture in the build view with a retry action until persistence succeeds, or await saving before discarding the draft. This preserves the draft/recovery contract in DESIGN.md’s settings and state guidance.
| setFound( | ||
| (last) => | ||
| last && { | ||
| ...last, | ||
| agents: last.agents.filter((item) => item.pubkey !== agent.pubkey), | ||
| }, | ||
| ); |
There was a problem hiding this comment.
[P2] Hand focus to a surviving control after bringing an agent over
A keyboard-activated Bring over button retains focus while loading, but this success update removes its entire row. Neither BringOver nor its parent moves focus to a surviving element, so focus falls out of the panel instead of continuing through the remaining agents; importing the final row has the same problem. Before removing a row that still owns focus, arrange a handoff to the next/previous import button, or the panel’s Close control when empty. Do not move focus if the person already moved elsewhere. Cover both another-row and final-row cases, consistent with DESIGN.md’s focus-restoration/state-transition rules.
Store optional picture and about fields on Agents2 identities and publish them with the name. Track accepted metadata so updates and clears publish even without a rename. Preserve compatibility with older rows and publication receipts. Implemented with goose AI assistance. Human acceptance: green confirmed working. Signed-off-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Agents2 can now take over an identity that the harness controller or old Buzz (installed or dev) saved on this machine. It keeps the key, name and picture, and leaves the instructions and settings behind. Neither old store is written. - port.rs lists both stores as one flat list, one entry per key. The harness copy wins because its key is already in this app's store. It also re-reads an identity and its key at take-over time. - AppAgents::adopt is prepare with an existing key. When a harness agent saved for the same community already holds the key under the same credential ID, commit shares that key and never adds or withdraws it. Without this, a failed add would have deleted the harness copy. - An adopted agent keeps the profile its community already has. Without one, it publishes the name and picture it brought. If the read fails, it overwrites nothing until the agent is renamed. Agents2 profiles gain an optional picture. - Adds a "Bring over" side panel on the Agents2 page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Adapt adoption to the metadata layer so accepted pictures and descriptions are recorded with the name. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Erase kept only the earlier agent registry: "keep agents" wiped agents2/identities.json, orphaning its keys, and "remove agents" deleted only keys listed in the earlier registry. Both registries are now kept, and removing agents deletes the keys of both. A rename republished an adopted agent's profile with only its name, bot flag and picture, dropping about, banner, NIP-05 and the rest. It now reads the community's current profile and changes only the name and bot flag, adding the picture only where there is none. The Agents2 grid, peek and build view now show the picture an agent brought over instead of only its initials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Import authored descriptions and retained pictures from legacy and harness records. Publish ordinary stored metadata and track accepted picture/about changes without a persistent adopted flag or community-profile preservation path. Retain transient shared-key custody protections and compatibility with saved adoption flags. Implemented with goose AI assistance. Validated on tail with 46 controller unit tests, 5 integration tests, 4 native host tests, formatting and diff checks. Live tail acceptance remains deferred. Signed-off-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Agents2 had no way to set a picture, and its grid, peek and build view
passed raw relay media URLs straight to <img>, which community media
refuses without the media proxy, so even agents brought over with a
picture showed initials.
AppAgents::set_picture (app_agent_set_picture) saves or clears an HTTPS
picture; Agents2.save takes { picture } and republishes the profile
through the existing refresh. The build view's identity rail uses the
shared AvatarEditor (uploads as the owner, like your own profile), and
every agent portrait goes through useAvatarPreview.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
c3f4fbe to
8a948f8
Compare
Agents2 can bring over an identity from the earlier harness controller or old Buzz while preserving its key and existing profile. A Bring over view lists eligible identities; the native import path validates the source and reuses credentials through the existing credential store.
Validation: TypeScript passes after restacking. All 13 controller app-agent tests pass on this layer. Adoption records complete publication receipts from the metadata parent; existing native import and frontend adoption coverage is retained. Required push checks are recorded separately. Native migration and destructive erase acceptance remain pending. Kept draft for human testing.
From #857
Agents2 identities retain their picture and description as ordinary profile metadata. Publishing tracks accepted metadata so edits and explicit clears propagate even without a rename. Older stored rows and publication receipts remain compatible.
Validation: all 10 controller app-agent tests pass on this layer, including metadata compatibility and publication cases. This preserves the previously tested green change at
52fda8319; combined-stack native/human acceptance is pending. Draft for that testing.