feat(virtual-mcp): attach files and skills to agents as knowledge#3948
Open
rafavalls wants to merge 2 commits into
Open
feat(virtual-mcp): attach files and skills to agents as knowledge#3948rafavalls wants to merge 2 commits into
rafavalls wants to merge 2 commits into
Conversation
Add a "Files and skills" section to agent settings where users upload files or pick existing Library files/skills. Items are stored in the org filesystem (home volume + public skill sets), recorded on metadata.knowledge, and surfaced to the agent in a <knowledge> system prompt block that lists each item's sandbox path and inlines small text docs. Also reorders the settings sections (Connections, Instructions, Files and skills, Sub-agents) and tidies the Sub-agents description. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The knowledge block was only added in the cluster system-prompt assembler, so agents running through the sandbox/desktop daemon (which assembles its own prompt) never saw their attached files. Fold the knowledge inventory into the agent's served instructions via the passthrough client's getInstructions(), and have the /mcp/virtual-mcp endpoint serve those instructions, so both run paths get it uniformly. The block now lists each item's exact sandbox mount path (files are mounted into the agent fs), so the agent can read them directly; drop the cluster-only inlining. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b5509fb to
6823561
Compare
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.
What is this contribution about?
Adds a Files and skills section to agent settings so users can attach reference material an agent always has access to. Files upload to the org filesystem (the Library's
homevolume underknowledge/, persistent and mounted into every agent sandbox), and users can also pick existing recent Library files or any Claude Code skill folder (reusing the existinghasSkilldetection). Selections are stored onmetadata.knowledgeand surfaced to the agent in a<knowledge>system-prompt block that lists each item's exact sandbox path and inlines small text documents. The settings sections were also reordered to Connections → Instructions → Files and skills → Sub-agents, and the Sub-agents description moved under its title.Screenshots/Demonstration
Agent settings now show a "Files and skills" section with an "Add" dropdown (Upload file / Select file or folder / Select skill), file-type icons, and drag-and-drop.
How to Test
bun run dev, open an agent's settings, and in Files and skills upload a.mdfile (or drag-drop).home/knowledge/, and that "Select file or folder" / "Select skill" list recent Library files and org skills.Migration Notes
No database migrations.
metadata.knowledgeis a new optional field on the existing virtual-MCP metadata (loose schema).Review Checklist
Summary by cubic
Adds a “Files and skills” section to agent settings so you can attach Library files/folders and Claude Code skills. Attached items are stored in the org Library and surfaced to the model via a
<knowledge>block appended to served instructions with exact sandbox paths.New Features
home/knowledge/.metadata.knowledgeusingKnowledgeFile(exported inpackages/mesh-sdk); skills are detected viahasSkillacrosshomeand public sets.<knowledge>block that lists each item with its sandbox path (viaorgFsSandboxPath); the agent reads files directly (no content inlining).Bug Fixes
Written for commit 6823561. Summary will update on new commits.