refactor: replace rawViewHierarchy tool with raw flag on observe#1373
refactor: replace rawViewHierarchy tool with raw flag on observe#1373
Conversation
Removes the debug-only rawViewHierarchy MCP tool and instead exposes the same capability via a raw?: boolean option on the observe tool, making unprocessed hierarchy data available to all users without a debug flag. - Add `raw?: boolean` to observe schema; when true, appends raw hierarchy to the result via a new `appendRawViewHierarchy()` interface method - Raw fetch runs once after observe settles (not on every waitFor poll) - Android: accessibility service with disableAllFiltering=true - iOS: XCTestService with disableAllFiltering=true - Uses timer abstraction (not Date.now) for testability - Delete RawViewHierarchy class (dead code) - Update FakeObserveScreen and FakeObserveScreenForSetUIState to implement the updated ObserveScreen interface - Add unit tests for the raw flag schema and tool registration - Regenerate schemas Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33f66d6d7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Switch from getAccessibilityHierarchy (minTimestamp=0 accepts any cached result, so disableAllFiltering is never applied to the fresh request) to requestHierarchySync which always fetches directly from the device. Also remove incorrect test asserting identifyInteractions is registered without debug mode (it is debugOnly=true). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MCP BenchmarksOverall Status: ✅ PASSED Context Thresholds
Overall Status: ✅ PASSED Generated at 2026-02-23T04:30:18.891Z Tool Call ThroughputSample Size: 50 iterations per tool Fast Operations (<100ms)
Medium Operations (100ms-1s)
Slow Operations (1s+)
Summary: 7/7 tools passed Generated at 2026-02-23T04:28:38.132Z Startup PerformanceMCP Server (stdio)
Device discovery: skipped (not run) Daemon
Overall Status: ✅ PASSED Generated at 2026-02-23T04:32:05Z NPM Unpacked Size
Package: @kaeawc/auto-mobile@0.0.13 Overall Status: ✅ PASSED Generated at 2026-02-23T04:31:38.594Z |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ec7a5f809
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
P1: After fetching raw (disableAllFiltering=true) on Android/iOS, requestHierarchySync updates the shared cache with the unfiltered snapshot. Invalidate the cache immediately after so subsequent normal observe calls are not served unfiltered data. P2: Thread AbortSignal through appendRawViewHierarchy into both platform sync calls so cancellation is respected instead of blocking until the default 10s (Android) or 5s (iOS) timeout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc92eadb39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keeps validator, IDE plugin, and quick-fix allowlists in sync with the server-side removal so test plans that reference rawViewHierarchy fail validation rather than silently passing and then failing at runtime. Also updates KDoc on disableAllFiltering params to reference the new observe raw:true flag instead of the removed tool. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
rawViewHierarchyMCP toolraw?: booleanoption to theobservetool — whentrue, appends unprocessed view hierarchy to the result, available to all users without a debug flagwaitForpoll), usestimerabstraction for testability, and handles both Android (accessibility service) and iOS (XCTestService)Test Plan
rawflag schema and tool registrationCloses #1351
🤖 Generated with Claude Code