Skip to content

feat(scene): route Scene MCP commands to PinK editor runtimes - #873

Draft
YuchenWell wants to merge 3 commits into
cocos:mainfrom
YuchenWell:0.1.34/fix/aiChatSceneRefresh
Draft

feat(scene): route Scene MCP commands to PinK editor runtimes#873
YuchenWell wants to merge 3 commits into
cocos:mainfrom
YuchenWell:0.1.34/fix/aiChatSceneRefresh

Conversation

@YuchenWell

Copy link
Copy Markdown
Contributor

Problem

Scene MCP calls always used the cocos-cli-owned Scene Worker, even when invoked from PinK. This created a second Scene Runtime, so file changes could be saved without updating the scene tree or Inspector displayed in PinK.

Solution

  • Introduce a pluggable SceneCommandBackend.
  • Preserve WorkerSceneCommandBackend for standalone cocos-cli usage.
  • Add a PinK backend that routes Scene RPC through host-provided callbacks.
  • Scope route capabilities and operation IDs to each MCP tool call with AsyncLocalStorage.
  • Complete each multi-RPC tool operation exactly once.

Compatibility and safety

  • Standalone cocos-cli continues using the existing Scene Worker.
  • PinK requests fail closed when the route context is missing, expired, or invalid.
  • Failed PinK requests never fall back to the Scene Worker.
  • Route capability tokens remain isolated between concurrent calls and are not logged.

@YuchenWell
YuchenWell force-pushed the 0.1.34/fix/aiChatSceneRefresh branch from 0aa4349 to d9907de Compare August 20, 2026 10:21
@YuchenWell
YuchenWell force-pushed the 0.1.34/fix/aiChatSceneRefresh branch from d9907de to 8b8916a Compare August 21, 2026 02:05
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