Skip to content

feat(client): manage imported agents from Settings - #85

Merged
Jacksondr5 merged 13 commits into
feature/agent-persona-catalog-rpcfrom
feature/agent-persona-settings
Sep 14, 2026
Merged

Jacksondr5 merged 13 commits into
feature/agent-persona-catalog-rpcfrom
feature/agent-persona-settings

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Users can import portable JSON or YAML agents from an individual file or a folder into the selected environment, then edit, enable, disable, or remove the imported copies in Settings. Duplicate imports ask which agents to replace, preserving skipped copies and existing on/off settings.

The Import menu sits beside Scoped agents. Compact rows show availability beside the name, with edit and destructive trash controls; action feedback uses toasts. The editor changes only the imported copy. Model menus show only signed-in, enabled providers with available models; hovering opens their models to the side. Model and reasoning pickers sit side by side. Reasoning stays separate and offers every reasoning option advertised by the selected model; unrelated edits preserve existing values. Assigned tasks retain their saved persona and fixed model route in both composers.

Web and desktop share the Settings UI; mobile provides native file/folder pickers, replacement toggles, and editing. The rebase preserves upstream's new composer behavior and semantic mobile theme classes, and keeps editor actions visible while fields scroll.

Validation

  • 487 focused tests across 21 files passed after the rebase (including the corrected Claude runtime-prompt assertion).
  • Server, web, mobile, shared client runtime, and contract typechecks passed. Changed TypeScript files passed lint with existing upstream warnings.
  • Real web-client pass: YAML file and folder imports, imported-copy editing, silent off/on toggles, selective replacement, preserved disabled state, trash removal, and toast feedback. Source YAML stayed unchanged.
  • Model menu update: 20 focused helper tests, web/mobile/client-runtime typechecks, and targeted lint passed. Browser verification confirmed the provider-only menu, side submenus, compact picker layout, all advertised reasoning options, and persisted primary/fallback selections. Tests cover signed-out, unknown-auth, disabled, and uninstalled providers.
  • Native mobile, packaged desktop, and relay/tunnel interaction were not exercised.

UI evidence

Before: published original stack UI. After: rebased imported-agent Settings UI. Additional images show the editor and per-agent replacement choices.

agents-before agents-after agents-editor agents-replacement

Current editor: signed-in provider submenus and side-by-side model/reasoning controls. The earlier editor image above shows the previous layout.

agents-compact-pickers agents-compact-submenu

Reasoning menu before restoring all options:

Limited reasoning options

Reasoning menu after restoring all options:

agents-all-reasoning

Merge order

Part of GitHub stack 120. Merge from bottom to top:

#75 → #76 → #78 → #79 → #80 → #81 → #83 → #82 → #85 → #118

Stack rebuilt 2026-09-09 (stack pingdotgg#120): #84 and #86 were dropped, and fork-boundary refactors moved the persona RPCs, guards, and client wiring into J5-owned files. Review threads were preserved.

Generated with GPT-6 using the Codex desktop app.

2026-09-10 additions: a Create agent button beside Import authors a personal agent (name, stable ID, description, markdown instructions, runtime policy, primary/fallback models) stored as an imported definition, on web and mobile; and removed example or folder agents now stay listed as Removed with a Restore action (Tyler's review finding). Both ride the existing J5 RPC group with no new upstream files.

Later on 2026-09-10: the edit dialog and sheet now load and save instructions; every row gains a more menu with Duplicate as personal agent (prefilled create dialog with a fresh ID, the way to build on a bundled example) and Export YAML; and acceptedInput, inputArtifacts, and outputArtifact are optional in the definition schema so personal agents carry no synthetic artifact. One new read RPC in the J5 group serves all three.

Also on 2026-09-10: every catalog entry carries its content digest, and the assignment lock controls on web and mobile show a Changed badge when a thread's launch snapshot no longer matches the current definition (roadmap item 4).

Later on 2026-09-10 (roadmap items 1, 2, 4, 5, then 7, 8, 9): editing instructions in the app through a readAgentPersona RPC, Duplicate as personal agent and Export YAML, a Changed drift badge on locked threads, and optional handoff-artifact fields for personal agents. The final pass adds a per-agent usage line (tasks, runs, completed/failed, mean duration, provider-reported tokens, last launch, resolved routes) aggregated on request from the existing thread, run, and provider-turn projections; an origin badge plus a Library sources section that lists, adds, and removes folders in agent-personas.json with read-only git nudges (uncommitted changes, remote ahead) and open-in-editor on web; and Copy to environment in the row menu. Three more methods on the J5 RPC group, no new upstream touches. Verified with the server J5 suite (88 tests), client-runtime (39), web (22), and mobile (4), plus typecheck and lint on every touched package.

2026-09-11: Add folder in Library sources opens a folder picker that browses the environment's filesystem through the existing filesystem browse RPC (web dialog, mobile sheet) instead of a typed path field; the resolved absolute path is what gets saved.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fbbbfbd0-c9e3-49d3-bb53-33ebeca11ba7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Sep 3, 2026
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from 3edb0f6 to 0136636 Compare September 3, 2026 18:45
@bryantderosier bryantderosier self-assigned this Sep 3, 2026
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from 0136636 to ef60657 Compare September 8, 2026 14:32
@github-actions github-actions Bot added size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). and removed size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Sep 8, 2026
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from ef60657 to e144154 Compare September 8, 2026 14:53
@bryantderosier bryantderosier changed the title feat(client): Show built-in agents in Settings feat(client): manage imported agents from Settings Sep 8, 2026
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from e9de0a9 to 4f84fa7 Compare September 9, 2026 12:52
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Closing: the two subagent label helpers existed only to feed the Agents panel restyle in #86, which is dropped from this stack to keep upstream rebases clean. The branch is kept as a pass-through pointing at #84's tip so #118 keeps a correct base; GitHub's stack feature refuses base changes through the API.

@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch 2 times, most recently from 272c15e to cc49038 Compare September 9, 2026 15:58
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from cc49038 to 9af806b Compare September 9, 2026 16:29

@tyler-barton-horizon tyler-barton-horizon 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.

Found one functional issue in the stack review:

Settings exposes the destructive remove action for every persona row, including bundled examples, and the server-side complete removal records the id in removed-source-agent-personas.json before deleting any imported override. That makes the agent disappear from future catalogs. The docs say users can restore by using Import -> Agent file with the original definition, but imports only accept .yaml/.yml while the bundled examples in this stack are shipped as JSON (apps/server/src/j5/agents/examples/*.json).

So removing a bundled agent like scout or builder is effectively irreversible from Settings unless the user manually converts/recreates YAML or edits environment state. That feels like a one-way door in a normal Settings workflow.

Suggested fixes: add an explicit Restore/Reset action for removed source/bundled agents, hide/remove-disable the trash action for bundled examples until restore exists, or ship supported YAML copies of the bundled definitions and point the docs at that supported restore path.

I checked the existing Bryant-stack comments before posting this. The earlier #75 review themes appear addressed in the combined stack, and I did not see this specific issue already raised.

@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Thanks for the catch, Tyler. Agreed it was a one-way door once imports went YAML-only. Fixed in 789a499cf with an explicit Restore action:

  • The catalog now lists removed source and bundled definitions as removed entries (availability unavailable/removed), so they never disappear from the library view and never appear in the @agent picker.
  • A new restoreSourceAgentPersona RPC in the J5 group clears the exclusion; it requires orchestration-operate like the other mutations.
  • Web and mobile Settings show a Restore button in place of the trash for those rows. Imported copies still have no restore, since their content lived only in the deleted import, and the docs now say so instead of pointing at Import.
  • Library tests cover remove, list, restore, the not-removed error, and that an imported override hides the removed source; the RPC scope test covers the new method.

Zero new upstream-file lines: the RPC rides the J5 group that is already merged into WsRpcGroup.

@bryantderosier
bryantderosier dismissed tyler-barton-horizon’s stale review September 10, 2026 22:36

requested a followup review after pushing a new commit.

@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch 2 times, most recently from 2969c37 to 95cfbff Compare September 11, 2026 18:22
bryantderosier and others added 13 commits September 14, 2026 08:05
…wned files

Web and mobile now read the persona library through J5 atoms instantiated in
src/j5/agents/agentPersonaAtoms.ts, the assignment lock controls move into J5
components that the composers render with one conditional, and the mobile
library screen draws its own header row so the shared SettingsSection stays
at its upstream shape. FORK.md rows point at the new locations.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The web file picker accepts only YAML, the mobile picker test uses YAML
names, and the user, operations, product, and FORK docs describe the
YAML-only import and source-folder behavior.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Removing a bundled or folder-loaded agent used to be reversible only by
importing its original file, which YAML-only imports made impossible for
the compiled-in examples. The catalog now lists excluded source definitions
as removed entries, a restoreSourceAgentPersona RPC in the J5 group clears
the exclusion, and both settings screens show Restore in place of the
trash for those rows. Docs describe the new path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A Create agent button beside Import opens a dialog (web) or sheet (mobile)
for a name, stable ID, description, markdown instructions, runtime policy,
and primary/fallback models. The server builds a version-1 definition with
a declared Response artifact and stores it as an imported agent, so it is
editable, switchable, and removable like any import. The route and policy
fields are shared with the edit dialogs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ttings

The edit dialog and sheet load an agent's instructions on open and save them
with the other fields. Every listed agent, including bundled examples and
removed sources, gains a more menu with Duplicate as personal agent, which
prefills the create dialog with a fresh ID, and Export YAML, which downloads
or shares the definition. A new read RPC in the J5 group serves all three.
The handoff fields acceptedInput, inputArtifacts, and outputArtifact are now
optional in the definition schema, so personal agents carry no synthetic
artifact.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every catalog entry now carries its content digest, so the assignment lock
controls on web and mobile compare the thread's launch snapshot with the
current library and show a Changed badge with the remedy when they differ.
Legacy snapshots without a digest and agents no longer listed show nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nvironment

Three saved-agent library enhancements, all in the J5 module and the J5 settings
screens, with no new upstream touches.

Usage: a getAgentPersonaUsage RPC aggregates tasks, runs, completed and failed
counts, mean completed-run duration, provider-reported tokens, last launch, and
the resolved routes per agent from the existing thread, run, and provider-turn
projections through json_extract on payload_json. Nothing is persisted. Each row
in Settings shows the summary once the agent has launched a task.

Library sources: catalog entries carry an origin (bundled, imported, or the
source folder file), shown as a badge. A Library sources section lists the
configured folders with existence and definition counts, adds and removes them
by rewriting agent-personas.json through setAgentPersonaLibraryFolders, and
surfaces two read-only git nudges (uncommitted changes, remote ahead) plus an
open-in-editor action on web. The server only runs git status.

Copy to environment: the row's more menu imports the agent's YAML into another
connected environment through the existing import and conflict flow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bryantderosier
bryantderosier force-pushed the feature/agent-persona-settings branch from 95cfbff to a56b373 Compare September 14, 2026 12:08
@Jacksondr5
Jacksondr5 merged commit 5581ef4 into j5/main Sep 14, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants