Repository navigation
Conversation
Agents can add a folder inside a device's home as a Zeron project via the new add_project MCP tool, routed through a new AddProject RPC (capability add-project-v1 for remote devices). The host validates the path, returns the existing project when already added, and the UI notifies the user which chat added it.
An agent cannot see another device's disk, so a remote add_project only worked when someone dictated the exact path. Drop the remote path: the tool no longer takes a device, AddProject is no longer forwarded and refuses a targetDeviceId naming another device, and the add-project-v1 capability, sync wait and ready flag go away. To add a project on another device, a chat created there calls add_project itself.
# Conflicts: # crates/mcp/src/jsonrpc.rs # crates/mcp/src/tools.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents can now add a folder as a Zeron project through a new
add_projectMCP tool, so a flow like "clone this repo and start a chat in it" no longer stops at the UI.add_project {path, name?}adds folders on the device the chat runs on, where the agent has a shell and can see the disk. Passing another device fails with a pointer to the workaround: create a chat there and have it calladd_project. The newAddProjectRPC is not forwardable and refuses atargetDeviceIdnaming another device.~expanded and is canonicalized (symlinks and..resolved). It must be an existing folder inside the user's home, and not the home itself.created: false. The check and the insert run under one registry lock, so concurrent adds of the same folder make one project.create_space(the picker path) also treats/a/b/and/a/bas the same folder now.SpacegainscreatedByChatId. When an agent-added project appears, the UI shows a toast saying which chat added it, with Undo. Undo removes an empty project at once, and opens the usual confirm dialog if the project has sessions.toast::show_with_actionadds a trailing button. Toasts with an action never merge with a repeat.create_chat.Fixes along the way
chats_in_space, which skips both, so the dialog could say "0 sessions" and still delete some.Notes
createdByChatIdis a new optional field on space rows (both doc backends and the registry seed). Older readers ignore it.cargo fmt --checkreports diffs only in code this PR doesn't touch.Follow-ups
remove_projectfor agents: remove at once only when the project has no chats (archived and side chats included); otherwise ask through the Remove dialog. Never the calling chat's own project or its parent's.find_foldersif adding projects on another device is wanted again.Testing
cargo test -p zeron-mcp: 30 pass. They cover the local call, attribution, refusing another device, and side chats being refused.cargo test -p zeron-proto -p zeron-doc -p zeron-rpc -p zeron-client: pass.zeron-enginelib tests for path resolution (~,.., trailing slash, symlink escape, home itself, files, missing paths), dedupe on the resolved folder, 32 concurrent adds making one project, andAddProjectnot being forwardable.zeron-engine --test device_routing mcp_standalone_session_executes_on_the_selected_device: MCP refusesadd_projecttoward device B, a rawAddProjectaimed at B is not forwarded and adds nothing on B, andcreate_chatstill runs its turn on B.zeron-uilib tests: agent-added projects are announced once and only while watching, the delete count includes archived and side chats, and action toasts stack.zeron-uimarkdown drag/truncation tests fail under parallel runs onmaintoo, and pass with--test-threads=1. They are unrelated to this change.Need help on this PR? Tag
@codesmith-botwith what you need.