Skip to content

feat(agents): pick library folders by browsing the environment's filesystem - #124

Merged
Jacksondr5 merged 2 commits into
feature/agent-subagent-invocationfrom
feature/agent-library-folder-picker
Sep 14, 2026
Merged

Jacksondr5 merged 2 commits into
feature/agent-subagent-invocationfrom
feature/agent-library-folder-picker

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Adding a library source folder in Settings → Agents → Library sources used a bare path field. That was easy to get wrong because the folder has to exist on the environment's machine, not the device running the client, and a typed ~ would never have been expanded by the library configuration.

Add folder now opens a folder picker (web dialog, mobile sheet) that walks the environment's own directory listing through the existing filesystem browse RPC, the same server listing the add-project flow uses. It starts at the environment's add-project base directory or home folder, lists subfolders with a parent row, accepts a typed or pasted path, and saves the resolved absolute directory to agent-personas.json through the existing setAgentPersonaLibraryFolders RPC. Both pickers are J5-owned files; no upstream file changes.

Validation

  • Lint, web and mobile typecheck, and the web J5 agent tests pass.
  • Native mobile and a real browser pass were not exercised.

Merge order

Part of GitHub stack 120, on top of #118: #75 → #76 → #78 → #79 → #80 → #81 → #83 → #82 → #85 → #118 → this PR.

🤖 Generated with Claude Code

Second commit: configured source folders are read recursively (sorted walk, dot-directories skipped, depth-capped), so choosing a repository root in the picker picks up every agent YAML beneath it, matching Import → Folder. The Library sources count covers the whole tree.

@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 11, 2026
@Jacksondr5

Copy link
Copy Markdown
Owner

Just putting all my manual testing stuff here because I figure thats easier.

Bug: when I select a model in the primary/fallback config, the dropdown stays open
image

When I launched this using the PR launch script, it seems to be looking for an agents folder and not finding it, is this expected? I did not add this dir
image

Why are these blocked?
image

Possible gap: It does not look like the spawn_agent MCP tool has persona functionality built into it. I feel like this is the natural way to tell an agent to spawn a given persona. Is there some other way I should do that? I tried to @scout, but that just appeared to bring up random files. Am I misunderstanding how to spawn a persona?

I think your invoke_agent should probably be folded into delegate_task. That's Upstream's subagent wrapper. I had originally removed it because it felt like a weird middle ground between provider subagents and peer agents. But, since you now have personas, we need a way to spawn subagents with them. That means that delegate_task has a purpose again. I think we probably benefit from folding personas into those instead of making a new MCP tool.

Personas should also be an optional parameter on spawn_agent so that you can have the agent make peer agents that follow a persona. I feel like thats needed to spawn Crews with personas.

I cant disable the built-in agents. Shouldn't I be able to?

AFAIK, the artifacts documented in #75 haven't been implemented. I feel like we need to pick a direction on that.

@bryantderosier

bryantderosier commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks for the manual pass, Jackson. Working through these in order.

Personas on spawn_agent: this is covered by the crews work I have in flight on temp/crews. There, spawn_agent takes an optional agent parameter (a saved agent ID); the server resolves the definition, pins the same immutable launch snapshot and model route a composer launch gets, and the peer agent runs under that persona's runtime policy. Crews compose seats from the same parameter, so persona-backed peer agents and crews share one path. That lands with the crews PRs rather than in this stack.

@scout bringing up files: the mention form is @agent:scout; a bare @ opens the file picker. That's a discoverability problem on our side and we'll make the picker list saved agents too, plus state the syntax in Settings → Agents.

Fixes queued as a follow-up PR on this stack: the model dropdown staying open after a pick (Base UI radio items default to staying open), on/off for bundled and folder agents, the misleading "Missing" badge on the default personas folder when nothing is configured (bundled examples are in use there), and specific per-route reasons behind the Blocked badge (which models or providers are missing, or that diagnostic/publish-only are not enforceable yet).

invoke_agent → delegate_task: agreed. We'll re-enable upstream's delegate_task in the J5 toolkit with an optional agent parameter and remove invoke_agent, as its own PR.

Artifacts: agreed the #75 contracts weren't implemented. Now that #109 landed, we'll bind persona outputArtifact/inputArtifacts to the shared artifacts system: instructions tell the agent to write its declared handoff with write_artifact under handoffs/<agent>/, the server verifies it at run end and fails the run when it's missing, and the handoff shows up on the agent's identity chip and in the Artifacts panel. Also its own PR, after rebasing the stack onto current j5/main.

bryantderosier and others added 2 commits September 14, 2026 08:06
…system

Adding a library source folder now opens a picker instead of a bare path field.
The picker walks the environment's own directory listing through the existing
filesystem browse RPC, so it works the same for local, remote, and mobile
clients, and it saves the resolved absolute path so a typed ~ never reaches
agent-personas.json. Typing or pasting a path in the picker still works.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A configured source folder now yields every agent YAML in its tree, walking
subfolders in sorted order and skipping dot-directories such as .git, so a team
repository root works as a library source the same way Import → Folder does.
The Library sources count reflects the whole tree, and duplicate ids across
subfolders still fail the read rather than picking a winner.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

2 participants