Skip to content

Commit 743dec0

Browse files
committed
chore(release): v0.23.0 — 8 bug fixes, cdp_native_errors tool, Android speed parity
Plugin: 0.22.0 → 0.23.0 MCP server (cdp-bridge): 0.17.0 → 0.18.0 Eight bugs fixed (B110-B118), one new MCP tool (cdp_native_errors), major performance wins on Android. All validated live through a full 8-phase rn-feature-dev run in workspace (Priority filter row on Tasks screen). Highlights - B118/D637: Android `cdp_interact` p95 went from 5343ms (timeout) to 45ms — 120× faster, zero false-negative timeouts. Whole Android flow: 16.11s → 7.2s (−55%). - B114/D642: new `cdp_native_errors` MCP tool reads `simctl log` / `adb logcat`. Fills the gap when native-module errors fire before __RN_AGENT injects. `cdp_status` auto-hints at it on suspicious state. - B111/D635: `cdp_connect` now accepts `targetId` + `bundleId` filters to disambiguate zombie Expo Go host pages from real app targets. - B112/D641: `device_snapshot action=open attachOnly=true` skips app launch when app is already running — saves ~12s and avoids bundle-race cascades. - B116/D639: `inferPlatforms` cross-checks `simctl listapps` + `adb pm list`; flags same-bundle-on-both with `ambiguousPlatform: true`. - B117/D638: `device_screenshot` accepts `platform` + inherits from CDP target. Session-bound dispatch routes correctly to the right device. - B115/D640: `cdp_nav_graph` flat-call fix for nested tab dispatch. - B113/D636: `device_screenshot` stopped sending the unsupported `--format` flag; uses `--out <path>` explicitly. - B110/D630: MCP server version read from package.json at module load; sync-versions.sh guards against hardcoded literals in src/. Refactors - cdp/connect.ts, cdp/helper-expr.ts, cdp/recovery.ts extracted — CDPClient facade shrunk further; every module now has a typed Context interface. - cdp/state.ts setter-based ResettableState interface replaces unsafe cast. - utils.ts freshness probe cached 2s per connectionGeneration. - RingBuffer gains optional indexKey for O(1) getByKey. - ResultEnvelope has optional structured ToolErrorCode. Test count: 158 → 249 (+91 this release cycle). Docs updated: README.md, CHANGELOG.md, docs-site/src/content/docs/changelog.md. Decisions D630-D642 logged in workspace docs/DECISIONS.md.
1 parent 0c35a42 commit 743dec0

7 files changed

Lines changed: 102 additions & 8 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "rn-dev-agent",
1111
"description": "AI agent that fully tests React Native features on simulator/emulator — navigates the app, verifies UI, walks user flows, and confirms internal state.",
12-
"version": "0.22.0",
12+
"version": "0.23.0",
1313
"source": "./",
1414
"category": "mobile-development",
1515
"homepage": "https://github.com/Lykhoyda/rn-dev-agent"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-dev-agent",
3-
"version": "0.22.0",
3+
"version": "0.23.0",
44
"description": "AI agent that fully tests React Native features on simulator/emulator — navigates the app, verifies UI, walks user flows, and confirms internal state.",
55
"author": {
66
"name": "Anton Lykhoyda",

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,44 @@ All notable changes to rn-dev-agent will be documented in this file.
44

55
Format follows [Keep a Changelog](https://keepachangelog.com/).
66

7+
## [0.23.0] — 2026-04-16
8+
9+
Major session of correctness and performance fixes surfaced by end-to-end benchmarks and a live feature-dev run. MCP server bumped to 0.18.0.
10+
11+
### Added
12+
- **`cdp_native_errors` MCP tool** — reads `xcrun simctl log show` on iOS / `adb logcat -d` on Android, parses known native-module / bundle-fetch / FATAL EXCEPTION patterns, dedupes by message body. Fills the gap when `cdp_error_log` / `cdp_console_log` stay empty because native errors fired before `__RN_AGENT` injected. `cdp_status` also emits a suspicion hint pointing at this tool when `connected && !helpersInjected && !hasRedBox && errorCount === 0` (B114/D642).
13+
- **`targetId` + `bundleId` filters on `cdp_connect`** — disambiguate zombie Expo Go host pages from real app targets (B111/D635).
14+
- **`attachOnly: true` on `device_snapshot`** — skip app launch when it's already running; verifies via `xcrun simctl spawn booted launchctl list` / `adb shell pidof`. Prevents the ~12s app-restart cascade. Exported `isAppRunning(platform, bundleId, probes?)` helper (B112/D641).
15+
- **Platform-aware CDP timeouts**`defaultTimeout(platform)` and `timeoutForMethod(method, platform)` apply a 2× Android multiplier via a single constant `ANDROID_MULTIPLIER`. `CDPClient` routes `Runtime.evaluate` paths through it using `this._connectedTarget?.platform`. iOS unchanged (B118/D637).
16+
- **`platform` param on `device_screenshot`** — inherits from `client.connectedTarget?.platform` or accepts explicit override. When no active session is open, the wrapper appends `--platform <p>` to agent-device CLI args. Session-bound dispatch remains the canonical path (B117/D638, partial — upstream agent-device CLI ignores `--platform` without a session; workaround via open session).
17+
- **`simctl listapps` cross-check in platform inference**`cdp/discovery.ts::inferPlatforms` now reads both `adb shell pm list packages` AND `xcrun simctl listapps booted`; targets installed on both platforms are flagged with `ambiguousPlatform: true`. Readers are injectable for unit testing (B116/D639).
18+
- **Tab-dispatch fix for `cdp_nav_graph`**`buildTabNavigateArgs(tab, screen, params)` emits the flat `ref.navigate(tab, params)` when target === tab, nested form when they differ. Prevents self-referential `navigate('TasksTab', { screen: 'TasksTab' })` that left RN stuck on the old tab (B115/D640).
19+
20+
### Fixed
21+
- **B110: MCP server reports stale version** — server version now read from `package.json` at module load; `sync-versions.sh` gained a regex guard against hardcoded `version:` literals in src/ (D630).
22+
- **B113: `device_screenshot --format` always rejected** — agent-device >= 0.8.0 doesn't accept `--format`. Refactored into `buildScreenshotArgs()` + thin delegate; now uses `--out <path>` explicitly, extension drives encoding (D636).
23+
- **Freshness probe caching** — 2s TTL per `connectionGeneration`, WeakMap-keyed. Saves 30-150ms per back-to-back tool call by skipping redundant `__RN_AGENT.__v` round-trips (D631).
24+
- **Structured error codes on `ResultEnvelope`**`ToolErrorCode` union (`STALE_TARGET`, `HELPERS_STALE`, `RECONNECT_TIMEOUT`, `NOT_CONNECTED`, `HELPERS_NOT_INJECTED`). Agents can branch on `code` instead of regex on error text. Back-compat preserved (D634).
25+
- **Extracted `cdp/recovery.ts`**`probeFreshness()` + `recoverFromStaleTarget()` moved out of `utils.ts`. Replaced error-string matching for stale detection with the `__RN_AGENT.__v` probe as the primary signal (D633).
26+
- **`RingBuffer` requestId index** — optional `indexKey` extractor builds a parallel `Map<key, item>`; `getByKey(id)` is O(1). Swapped 5 call sites (`event-handlers.ts` ×4, `tools/network-body.ts` ×1) from `findLast``getByKey` (D632).
27+
28+
### Refactors
29+
- **CDP module extraction continued**`cdp/connect.ts` (213 lines), `cdp/helper-expr.ts`, `cdp/recovery.ts` (99 lines). CDPClient facade shrunk further; every module now has a typed Context interface instead of reaching into the facade directly.
30+
- **`cdp/state.ts` setter-based `ResettableState` interface** — replaces `as unknown as CDPResettableState` cast. Renaming a private field on `CDPClient` now produces a real TypeScript error.
31+
32+
### Benchmarks validated live
33+
34+
Cross-platform benchmark (Task Power User flow + Priority Filter Row feature):
35+
- **iOS (iPhone 17 Pro, iOS 26.3)**: 3.37s / 29 calls / 0 failures (`cdp_interact` p50 7ms)
36+
- **Android (Pixel_9_Pro, API 37) pre-fix**: 16.11s / 32 calls / 3 failures (incl. 5.3s `typeText` timeout)
37+
- **Android post-fix**: ~7.2s / 24 calls / 0 failures — **55% faster, zero false-negative timeouts** (`cdp_interact` p50 16ms, p95 45ms)
38+
39+
### Test count
40+
158 → **249** (+91 this release cycle).
41+
42+
### Decisions logged
43+
D630 through D642 in `rn-dev-agent-workspace/docs/DECISIONS.md`.
44+
745
## [0.22.0] — 2026-04-16
846

947
### Added

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugin that turns Claude into a React Native development partner. It explores your codebase, designs architecture, implements features, then **verifies everything live on the simulator** — reading the component tree, store state, and navigation stack through Chrome DevTools Protocol.
44

5-
**52 MCP tools** | **5 agents** | **13 commands** | **148 tests** | **46 best-practice rules** | [Full documentation](https://lykhoyda.github.io/rn-dev-agent/)
5+
**53 MCP tools** | **5 agents** | **13 commands** | **249 tests** | **46 best-practice rules** | [Full documentation](https://lykhoyda.github.io/rn-dev-agent/)
66

77
---
88

@@ -103,14 +103,22 @@ if (__DEV__) {
103103

104104
## MCP Tools
105105

106-
52 tools across three layers. [Full reference](https://lykhoyda.github.io/rn-dev-agent/tools/)
106+
53 tools across three layers. [Full reference](https://lykhoyda.github.io/rn-dev-agent/tools/)
107107

108108
| Category | Count | Examples | Docs |
109109
|----------|-------|---------|------|
110-
| **CDP** (React internals) | 25 | `cdp_component_tree`, `cdp_store_state`, `cdp_evaluate`, `cdp_set_shared_value` | [CDP tools](https://lykhoyda.github.io/rn-dev-agent/tools/#cdp-tools) |
110+
| **CDP** (React internals) | 26 | `cdp_component_tree`, `cdp_store_state`, `cdp_evaluate`, `cdp_set_shared_value`, `cdp_native_errors` | [CDP tools](https://lykhoyda.github.io/rn-dev-agent/tools/#cdp-tools) |
111111
| **Device** (native interaction) | 14 | `device_find`, `device_press`, `device_fill`, `device_screenshot` | [Device tools](https://lykhoyda.github.io/rn-dev-agent/tools/#device-tools) |
112112
| **Testing** (E2E + proof) | 13 | `proof_step`, `cross_platform_verify`, `maestro_run` | [Testing tools](https://lykhoyda.github.io/rn-dev-agent/tools/#testing-tools) |
113113

114+
### What's new in v0.23.0 (2026-04-16)
115+
116+
- **`cdp_native_errors`** — surfaces `simctl log`/`adb logcat` entries for errors that fire before `__RN_AGENT` injects (missing native modules, bundle-fetch failures, FATAL EXCEPTIONs). `cdp_status` hints at it automatically when JS-layer signals are blank.
117+
- **Multi-device correctness**`cdp_connect` accepts `targetId`/`bundleId` filters to disambiguate zombie Expo Go pages; `inferPlatforms` cross-checks `simctl listapps` and `adb pm list`; `device_screenshot` accepts `platform` and inherits from the connected CDP target.
118+
- **Android speed parity** — platform-aware CDP timeouts (2× on Android emulator) eliminate `typeText` false-negatives; real Android flow went from **16.1s/3 fails to 7.2s/0 fails** in the same benchmark.
119+
- **`device_snapshot attachOnly: true`** — skip app launch when already running, saving the ~12s restart cascade.
120+
- **91 new unit tests** (158 → 249) locking in the extracted `cdp/*` modules, platform filters, and native-error parsers.
121+
114122
## Architecture
115123

116124
```

docs-site/src/content/docs/changelog.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,54 @@ All notable changes to rn-dev-agent will be documented in this file.
99

1010
Format follows [Keep a Changelog](https://keepachangelog.com/).
1111

12+
## [0.23.0] — 2026-04-16
13+
14+
Major session of correctness and performance fixes surfaced by end-to-end benchmarks and a live feature-dev run. MCP server bumped to 0.18.0.
15+
16+
### Added
17+
- **`cdp_native_errors` MCP tool** — reads `xcrun simctl log show` on iOS / `adb logcat -d` on Android, parses known native-module / bundle-fetch / FATAL EXCEPTION patterns, dedupes by message body. Fills the gap when `cdp_error_log` / `cdp_console_log` stay empty because native errors fired before `__RN_AGENT` injected. `cdp_status` also emits a suspicion hint pointing at this tool when `connected && !helpersInjected && !hasRedBox && errorCount === 0` (B114/D642).
18+
- **`targetId` + `bundleId` filters on `cdp_connect`** — disambiguate zombie Expo Go host pages from real app targets (B111/D635).
19+
- **`attachOnly: true` on `device_snapshot`** — skip app launch when it's already running; verifies via `xcrun simctl spawn booted launchctl list` / `adb shell pidof`. Prevents the ~12s app-restart cascade (B112/D641).
20+
- **Platform-aware CDP timeouts**`defaultTimeout(platform)` and `timeoutForMethod(method, platform)` apply a 2× Android multiplier. iOS unchanged (B118/D637).
21+
- **`platform` param on `device_screenshot`** — inherits from `client.connectedTarget?.platform` or accepts explicit override. When a device session is open, session-bound dispatch routes correctly (B117/D638).
22+
- **`simctl listapps` cross-check in platform inference**`inferPlatforms` reads both `adb shell pm list packages` AND `xcrun simctl listapps booted`; targets on both platforms are flagged with `ambiguousPlatform: true` (B116/D639).
23+
- **Tab-dispatch fix for `cdp_nav_graph`**`buildTabNavigateArgs` emits the flat `ref.navigate(tab, params)` when target === tab, nested form when they differ (B115/D640).
24+
25+
### Fixed
26+
- **B110: MCP server reports stale version** — server version now read from `package.json` at module load; `sync-versions.sh` guards against hardcoded `version:` literals (D630).
27+
- **B113: `device_screenshot --format` always rejected** — now uses `--out <path>` explicitly; extension drives encoding (D636).
28+
- **Freshness probe caching** — 2s TTL per `connectionGeneration`, WeakMap-keyed. Saves 30-150ms per back-to-back tool call (D631).
29+
- **Structured error codes on `ResultEnvelope`**`ToolErrorCode` union lets agents branch on `code` instead of regex on error text (D634).
30+
- **Extracted `cdp/recovery.ts`**`probeFreshness()` + `recoverFromStaleTarget()` moved out of `utils.ts`. Replaced error-string matching with the `__RN_AGENT.__v` probe (D633).
31+
- **`RingBuffer` requestId index**`getByKey(id)` is O(1); swapped 5 call sites from `findLast``getByKey` (D632).
32+
33+
### Benchmarks validated live
34+
35+
Cross-platform benchmark (Task Power User flow + Priority Filter Row feature):
36+
- **iOS**: 3.37s / 29 calls / 0 failures (`cdp_interact` p50 7ms)
37+
- **Android pre-fix**: 16.11s / 32 calls / 3 failures (incl. 5.3s `typeText` timeout)
38+
- **Android post-fix**: ~7.2s / 24 calls / 0 failures — **55% faster, zero false-negative timeouts** (`cdp_interact` p50 16ms, p95 45ms)
39+
40+
### Test count
41+
158 → **249** (+91 this release cycle).
42+
43+
## [0.22.0] — 2026-04-16
44+
45+
Proof-capture infrastructure, fast-runner robustness, and the `cdp_set_shared_value` tool for Reanimated animation proofs.
46+
47+
### Added
48+
- **`cdp_set_shared_value` tool** — Drive Reanimated SharedValue animations by testID for proof captures.
49+
- **Fast-runner auto-restart** — When fast-runner dies mid-session, `tryFastRunner` automatically attempts one restart.
50+
- **Reload counter + NativeWind corruption warning**`cdp_status` warns after 5+ `cdp_reload` calls in a session.
51+
- **Auto-open device session in Phase 5.5** — Pipeline mandates opening a device session at verification start.
52+
53+
### Fixed
54+
- **B103**: `cdp_navigate` false success — fallback now verifies target screen exists.
55+
- **B106**: `device_scroll`/`device_swipe` deadlock on Reanimated screens.
56+
- **B107**: `deviceId` parsing for agent-device v0.8.0.
57+
- **R2**: `device_screenshot` ignores requested path.
58+
- **R5**: Scroll amount semantics diverge.
59+
1260
## [0.19.2] — 2026-04-13
1361

1462
### Fixed

scripts/cdp-bridge/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/cdp-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-dev-agent-cdp",
3-
"version": "0.17.0",
3+
"version": "0.18.0",
44
"type": "module",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)