Skip to content

Bring existing agents into Agents2, with pictures and descriptions - #858

Merged
matt2e merged 6 commits into
mainfrom
baxen/agents2-adopt
Oct 12, 2026
Merged

matt2e merged 6 commits into
mainfrom
baxen/agents2-adopt

Conversation

@baxen

@baxen baxen commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Merge stack, bottom to top: #838 → #855 → #856 → #858 → #859 → #860 → #865 → #867 → #871. Each PR targets the one before it. Earlier stack notes here are superseded.

Also carries three commits moved here from #859 so that #859 is deletions only: keeping Agents2 agents through erase and renames, importing picture and description as ordinary profile state, and setting an agent's picture from the build view.

Folded in: #857 (closed). Their descriptions are below.

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.

@baxen
baxen changed the base branch from baxen/agent-metadata to baxen/model October 11, 2026 22:57
@baxen
baxen force-pushed the baxen/agents2-adopt branch from c3a2a21 to 987566f Compare October 11, 2026 23:11
@baxen baxen changed the title Bring existing local agent identities into Agents2 Bring existing agents into Agents2, with pictures and descriptions Oct 11, 2026
@baxen
baxen force-pushed the baxen/agents2-adopt branch from 987566f to 3aa3760 Compare October 11, 2026 23:55
@baxen
baxen marked this pull request as ready for review October 11, 2026 23:56
@baxen
baxen requested review from a team as code owners October 11, 2026 23:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-12T00:04:22.988902Z 3aa3760 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@baxen
baxen force-pushed the baxen/agents2-adopt branch from 3aa3760 to c3f4fbe Compare October 12, 2026 00:12

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment on lines +666 to +670
onChange={(picture) => {
setPictureError("");
agents2
.save(agent.pubkey, { picture: picture || null })
.catch((error: unknown) => setPictureError(message(error)));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[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.

Comment on lines +547 to +553
setFound(
(last) =>
last && {
...last,
agents: last.agents.filter((item) => item.pubkey !== agent.pubkey),
},
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[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.

Base automatically changed from baxen/model to main October 12, 2026 03:08
baxen and others added 6 commits October 12, 2026 14:11
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>
@matt2e
matt2e force-pushed the baxen/agents2-adopt branch from c3f4fbe to 8a948f8 Compare October 12, 2026 03:13
@matt2e
matt2e merged commit 63f7e90 into main Oct 12, 2026
59 of 63 checks passed
@matt2e
matt2e deleted the baxen/agents2-adopt branch October 12, 2026 04:18
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.

3 participants