Revamp new agent dialog#1201
Conversation
558fa41 to
9efe199
Compare
37d03e8 to
309889d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9efe199544
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sourceFile: "goosey.persona.md", | ||
| }); | ||
|
|
||
| assert.equal(state.initialValues.avatarUrl, "app-avatar:gloopies-19"); |
There was a problem hiding this comment.
Wire avatarRef through before asserting it
This new test currently fails because importPersonaDialogState still derives avatarUrl only from persona.avatarDataUrl, and the Tauri ParsePersonaFilesResult type does not populate an avatarRef field. In the added scenario where avatarDataUrl is null, the actual value is "", so the desktop unit suite is blocked until avatarRef is carried through the parser/state path or this assertion is removed.
Useful? React with 👍 / 👎.
| mcpCommand: runtime.mcpCommand ?? "", | ||
| personaId: persona.id, | ||
| systemPrompt: persona.systemPrompt, | ||
| avatarUrl: persona.avatarUrl ?? undefined, |
There was a problem hiding this comment.
Upload data-URI avatars before creating the agent
When this dialog is submitted after importing a PNG persona card, persona.avatarUrl can be a data:image/... URI. Passing that directly into createManagedAgent persists and publishes the data URI as the agent profile picture; larger cards can exceed the relay event content limit or leave the profile with an unhosted avatar, which is why the existing channelAgents creation path uploads data URIs before calling createManagedAgent. This new create-agent path should perform the same upload before setting avatarUrl.
Useful? React with 👍 / 👎.
| systemPrompt: persona.systemPrompt, | ||
| avatarUrl: persona.avatarUrl ?? undefined, | ||
| model: persona.model ?? undefined, | ||
| envVars: persona.envVars, |
There was a problem hiding this comment.
Omit persona envVars when linking the agent
For agents created from a persona with saved env vars, this copies the persona env into the per-agent env_vars while also setting personaId. The runtime later merges persona env first and agent env second via merged_user_env, so this duplicate per-agent copy shadows any future persona env edits or secret rotations for the newly created agent. Leave envVars unset here unless the dialog is collecting real per-agent overrides.
Useful? React with 👍 / 👎.
Summary
Validation
cd desktop && pnpm checkcd desktop && pnpm typecheck