Skip to content

Personas: edit personas in conversation #786

Closed

Description

@bryantderosier

Item 11 of 11 in the Personas v2: simpler specialists milestone.

The problem

Conversation should be the main way to create and refine personas: "make the code reviewer stricter about tests", and the agent drafts the change for me to approve. Today there's no way for an agent to do that. There's no MCP tool that saves a persona, so every edit means opening Agent Setup and filling in the form by hand.

There are also two things about where an edit lands that aren't obvious:

  • Saving over a team persona hides later team updates for everyone on this server.
  • Everyone I share the server with runs my version.

Where this sits

This covers decisions 7 and 11 of the Personas v2 proposal, after Bastian's comment to say "environment override", not "personal copy". The persona library belongs to the server, so an override applies to everyone on it: guests and the people I give access to run my version. That's intended.

Owner-only editing turned out to be done already. Since #638 (20 Oct), every persona library RPC needs settings:write, which is the Owner's (packages/contracts/src/j5/clientRpcPermissions.ts:24-34). This story only has to keep the agent path behind that same gate.

What we already have

  • Overrides: a local definition with the same id overrides its folder source. Remove plus restore brings the source back.
  • Edits: they're digest-checked and safe to retry. editImportedAgentPersona, createAgentPersona, removeAgentPersona, restoreSourceAgentPersona and the rest are in J5_AGENT_PERSONA_WS_METHODS, with handlers in apps/server/src/j5/agents/agentPersonaRpc.ts.
  • Export: Agent Setup already offers Export YAML and Copy to environment.
  • No agent tool: no J5 MCP tool reads a full definition for editing or saves one.

Proposal

  • A save tool. Agents get a tool that drafts a persona create or edit and asks the server owner to approve it. Approval goes through the Inbox like any other ask, and shows the draft.
  • Where it lands. An approved edit to a team persona saves as an environment override. A new persona saves to the environment library. Nothing is ever written into a team source folder.
  • Warnings first. Before saving over a team persona, the agent tells me two things:
    • the override hides later team updates to that persona, for everyone on this server;
    • getting the team version back takes two steps: remove the override, then restore the team persona.
  • Cancel means nothing saved. Saves go through the existing library service, with digest-checked edits and safe retries.
  • Sharing with the team. The owner exports the persona and adds it to the team folder through that repo's normal review.
  • Save suggestions. When the same kind of custom worker keeps coming up, the agent suggests saving it as a persona. The suggestion never blocks work. Inside a Crew, it goes through the Captain. Nothing is ever added to the library automatically, and there's no background monitoring.

Acceptance criteria

  • An agent can read a persona's full definition and propose a create or edit through a J5 MCP tool.
  • Every proposed save waits for an approval from someone with Owner access on this server. Approval from anyone else is refused.
  • An approved edit to a folder persona creates an environment override, and the folder file is untouched.
  • An approved new persona lands in the environment library.
  • The approval shows the override warning and the two-step way back when the target is a team persona.
  • Declining or cancelling saves nothing.
  • A save against a definition that changed since the agent read it is refused (digest check), and retrying with the same request is safe.
  • A guest's worker runs the owner's override.
  • A client with operate access but not Owner access still can't change the library. Extend the existing permission tests to cover the MCP path.
  • Remove plus restore brings the team version back.
  • Export produces YAML the team folder accepts.
  • The agent guidance covers suggesting a save for a recurring custom worker: never blocking, through the Captain inside a Crew.
  • docs/j5/user/personas.md describes editing in conversation and what an override means for everyone on the server.

Out of scope

  • Private per-person copies.
  • Syncing overrides across servers. To use the same personas on several servers, put them in a folder source each server reads.
  • Background monitoring for recurring custom workers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions