Skip to content

Fix MCP identifiers and detail reads for SwiftUI virtual nodes - #46

Merged
Kyle-Ye merged 2 commits into
mainfrom
fix/mcp-virtual-node-identifiers
Oct 29, 2026
Merged

Kyle-Ye merged 2 commits into
mainfrom
fix/mcp-virtual-node-identifiers

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

SwiftUI virtual nodes were serialized through the native-object identifier path, so every node without a UIView/CALayer appeared as 0x0. A caller could not reliably address individual Text nodes, and custom-only attribute groups were incorrectly reported as uncached.

Use the deferred detail oid when available, the existing SwiftUI handle for older inline payloads, and a separate host-local namespace for other custom nodes. Hierarchy serialization and lookup now share this mapping. read_view_details returns older inline details without sending an invalid RPC 203, while read_attributes recognizes custom groups and fetched empty groups as cached.

Identifiers remain scoped to the current hierarchy; clients must rediscover nodes after a refresh.

Validation

  • Host build and Scripts/test-mcp-bridge.sh passed, including a run with PATH=/usr/bin:/bin:/usr/sbin:/sbin. The script uses system find so CI does not require ripgrep.
  • Regression coverage exercises 105 virtual nodes, deferred and legacy inline IDs, generic custom nodes, native IDs and cache state.
  • iPhone 17 / iOS 27 end-to-end: all 117 detailed-mode nodes and all 30 compact-mode nodes had unique nonzero identifiers.
  • All seven Text nodes succeeded through read_view_details with no failed identifiers, and subsequent read_attributes calls reported detailsCached: true.

Related changes

Use deferred detail IDs for virtual nodes and namespaced handles for older inline payloads. Route lookup through the same identifier mapping, serve inline details without an invalid RPC, and recognize custom attribute groups as cached details.

Validation: Host build and MCP bridge tests passed, including 105 virtual nodes. iOS 27 end-to-end checks found 117 unique detailed-mode nodes and 30 unique compact-mode nodes; all seven Text nodes returned details and cached attributes.
Use the system find command to enumerate core model sources on CI runners without ripgrep. Validated the entire MCP bridge test script with PATH restricted to macOS system directories.
@Kyle-Ye
Kyle-Ye merged commit 92f7cde into main Oct 29, 2026
2 checks passed
@Kyle-Ye
Kyle-Ye deleted the fix/mcp-virtual-node-identifiers branch October 29, 2026 13:40
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