Skip to content

refactor: replace rawViewHierarchy tool with raw flag on observe#1373

Merged
kaeawc merged 4 commits intomainfrom
work/1351-refactor--replace-rawviewhierarchy-tool-
Feb 24, 2026
Merged

refactor: replace rawViewHierarchy tool with raw flag on observe#1373
kaeawc merged 4 commits intomainfrom
work/1351-refactor--replace-rawviewhierarchy-tool-

Conversation

@kaeawc
Copy link
Owner

@kaeawc kaeawc commented Feb 23, 2026

Summary

  • Removes the debug-only rawViewHierarchy MCP tool
  • Adds raw?: boolean option to the observe tool — when true, appends unprocessed view hierarchy to the result, available to all users without a debug flag
  • Raw fetch runs once after observe settles (not on every waitFor poll), uses timer abstraction for testability, and handles both Android (accessibility service) and iOS (XCTestService)

Test Plan

  • Tests pass locally (2785 pass)
  • Build passes
  • Schemas regenerated
  • New unit tests for raw flag schema and tool registration

Closes #1351

🤖 Generated with Claude Code

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>
@kaeawc kaeawc enabled auto-merge (squash) February 23, 2026 03:47
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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>
@github-actions
Copy link

github-actions bot commented Feb 23, 2026

MCP Benchmarks

Overall Status: ✅ PASSED
Status by Benchmark: Context Thresholds: ✅ | Tool Call Throughput: ✅ | Startup: ✅ | NPM Unpacked Size: ✅

Context Thresholds

Category Actual Threshold Usage Status
Tools 10,506 14,000 75%
Resources 440 1,000 44%
Resource Templates 1,563 2,000 78%
Total 12,509 17,000 74%

Overall Status: ✅ PASSED

Generated at 2026-02-23T04:30:18.891Z

Tool Call Throughput

Sample Size: 50 iterations per tool
Total Duration: 10.95s
Average Throughput: 31.97 ops/second

Fast Operations (<100ms)

Tool P50 P95 Mean Success Status
listDevices 0.0ms 0.0ms 0.0ms 100%
pressButton 0.1ms 0.2ms 0.1ms 100%

Medium Operations (100ms-1s)

Tool P50 P95 Mean Success Status
observe 22.5ms 38.5ms 24.2ms 100%
tapOn 0.1ms 0.1ms 0.1ms 100%
inputText 59.1ms 71.3ms 61.4ms 100%

Slow Operations (1s+)

Tool P50 P95 Mean Success Status
launchApp 16.1ms 24.6ms 16.7ms 100%
installApp 0.0ms 0.1ms 0.0ms 100%

Summary: 7/7 tools passed
Overall Status: ✅ PASSED

Generated at 2026-02-23T04:28:38.132Z

Startup Performance

MCP Server (stdio)

Mode Ready First Tool Call Heap Used
cold 526.0ms n/a 35.2MB
warm 526.0ms n/a 35.2MB

Device discovery: skipped (not run)

Daemon

Mode Spawn Ready Responsive Heap Used
cold 3.0ms 541.0ms 673.0ms 38.1MB
warm 2.0ms 542.0ms 674.0ms 38.1MB

Overall Status: ✅ PASSED

Generated at 2026-02-23T04:32:05Z

NPM Unpacked Size

Metric Actual Threshold Usage Status
Unpacked Size 12.5MB 30.0MB 42%

Package: @kaeawc/auto-mobile@0.0.13
Tarball Size: 2.6MB

Overall Status: ✅ PASSED

Generated at 2026-02-23T04:31:38.594Z

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@kaeawc kaeawc disabled auto-merge February 23, 2026 04:10
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>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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>
@kaeawc kaeawc merged commit fc482a2 into main Feb 24, 2026
99 of 100 checks passed
@kaeawc kaeawc deleted the work/1351-refactor--replace-rawviewhierarchy-tool- branch February 24, 2026 04:30
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.

refactor: replace rawViewHierarchy tool with raw flag on observe

1 participant