Skip to content

fix: save MCP settings edits written under a missing parent - #2467

Merged
kpal81xd merged 2 commits into
mainfrom
fix/driver-settings-new-objects
Oct 29, 2026
Merged

kpal81xd merged 2 commits into
mainfrom
fix/driver-settings-new-objects

Conversation

@kpal81xd

Copy link
Copy Markdown
Contributor

What's Changed

  • The MCP settings:modify, project:settings:modify and scene:settings:modify methods now save values written under a parent that doesn't exist yet. Before, { "layers.1000": { name: "Water" } } or layers.1000.name became leaf writes such as layers.1000.name. The realtime server rejects those (Referenced element not an object), so the method returned success but the layer only existed until reload.
  • Edits whose parent is missing are merged into a single write of the first missing ancestor (nestEdits). Edits whose parent exists are applied as before.
  • Added tests that run the real ObserverSync against an in-memory ShareDB: leaf writes lose the layer, nested writes keep it.

The MCP server already sends whole objects for modify_project_settings (playcanvas/editor-mcp-server#124). This fixes the same problem for any client and for explicit leaf paths sent through modify_settings.

Smoke test

  1. Open a test project and connect an MCP client.
  2. Call modify_settings with scope project and edits [{ "path": "layers.1001.name", "value": "Foam" }, { "path": "layers.1001.opaqueSortMode", "value": 2 }]. Expected: success, and no Referenced element not an object error in the browser console.
  3. Reload the Editor and open Settings > Layers. Expected: Foam is listed and can be deleted.

Checks

@kpal81xd kpal81xd added bug Something isn't working area: editor interface release: next patch Ticket marked for next patch release labels Oct 29, 2026
@kpal81xd kpal81xd self-assigned this Oct 29, 2026
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
editor Ready Ready Preview Oct 29, 2026 6:12pm UTC

Request Review

@kpal81xd
kpal81xd merged commit 1518e7d into main Oct 29, 2026
8 checks passed
@kpal81xd
kpal81xd deleted the fix/driver-settings-new-objects branch October 29, 2026 18:14

This branch was successfully deployed

1 active deployment
Preview — fc72a7a8 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor interface bug Something isn't working release: next patch Ticket marked for next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant