Skip to content

Fix mesh agent creation: permissions reload + project context#656

Open
zeedann wants to merge 2 commits intomainfrom
fix/mesh-agent-creation-bugs
Open

Fix mesh agent creation: permissions reload + project context#656
zeedann wants to merge 2 commits intomainfrom
fix/mesh-agent-creation-bugs

Conversation

@zeedann
Copy link
Copy Markdown
Collaborator

@zeedann zeedann commented Apr 8, 2026

Summary

  • Reload permissions after agent creation: /mesh/fleet/apply and /mesh/agents/create write permissions to disk but never called permissions.reload(), so newly created agents got 403 Forbidden on all mesh API calls (e.g. LLM proxy). The dashboard's create endpoint already did this correctly.
  • Pass PROJECT_MD_PATH to mesh-created agents: Agents created via mesh endpoints (by the operator) never received PROJECT_MD_PATH/PROJECT_NAME env vars, so they launched without PROJECT.md even when assigned to a project. Now mirrors the CLI startup behavior.

Test plan

  • Verify pytest tests/test_dashboard.py tests/test_permissions.py -x passes
  • Create agents via operator → confirm no 403 on LLM calls
  • Create project, assign agents, then create new agent via operator → confirm PROJECT.md is mounted

🤖 Generated with Claude Code

zeedann added 2 commits April 8, 2026 18:22
The /mesh/fleet/apply and /mesh/agents/create endpoints write agent
permissions to disk but never reload the in-memory PermissionManager,
causing 403 errors for newly created agents. The dashboard's create
endpoint already does this correctly — add the same reload call to the
two mesh endpoints.
The /mesh/fleet/apply and /mesh/agents/create endpoints start agent
containers but never set PROJECT_MD_PATH or PROJECT_NAME in
env_overrides. This means agents created at runtime through the mesh
never get their project's PROJECT.md mounted, even when assigned to a
project. The CLI startup path (src/cli/runtime.py) already does this
correctly — this change mirrors that logic in both mesh endpoints by
checking _agent_projects for the agent and injecting the project env
vars when a mapping exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant