Skip to content

MCP live-sync silently drops mutations when no active scene is bound #725

Description

@Aymericr

Found by @Srujanreddy1234 while investigating chat/prompt persistence (#561) — the PR went stale but the underlying observation is correct and still unfixed on main.

packages/mcp/src/operations/live-sync.ts:33:

if (!(active && operations.canAppendSceneEvents)) return

When a store is attached but no scene is bound, publishLiveSceneSnapshot returns silently: mutations vanish with no error, no log, and no signal to the caller. The failure mode sends people hunting in the wrong layer (chat, prompts, transport) when the real cause is an unbound scene.

Design decision needed before fixing (the question #561 never resolved): throw a typed no_active_scene error, or lazily bind a draft scene so the mutation lands somewhere recoverable. Constraints:

  • src/bin/pascal-mcp.ts attaches a store unconditionally and never calls setActiveScene in the plain --stdio flow, so a bare throw would break the README quick start on the first create_wall.
  • Main already has the narrower canAppendSceneEvents gate (scene-operations.ts:103), which is the seam a correct fix should build on.
  • Whatever the choice, it needs a test — which also means teaching InMemorySceneStore (tools/scene-lifecycle/test-utils.ts) appendSceneEvent/listSceneEvents, which it currently lacks.

Related: #706 fixed the this-binding bug on the same appendSceneEvent path (shipped in 263b4ab6, #489).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions