Skip to content

Commit aad4b2c

Browse files
committed
docs: document R4 rename and bugs found during MCP testing
1 parent bc3dd88 commit aad4b2c

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

ISSUES.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,109 @@
1010
| R1 | **get_errors simplified** — Removed event stream subscription, 300ms heuristic, `streamListen('Extension')`, and `FlutterError.resetErrorCount()` evaluate call. Now just calls `ext.flutter.inspector.getErrorInfo` directly. | [`lib/src/tools/get_errors.dart` rewritten] | 2026-07-18 |
1111
| R2 | **TraceLog test group removed** from integration tests. | [`test/integration_test.dart` cleaned up] | 2026-07-18 |
1212
| R3 | **Agent aliases added** — New agents try `launch` or `run_app` instead of `flutter_run`, causing stalls. Now all three names are registered as aliases sharing the same handler. | [`flutter_run.dart` + `server.dart`] | 2026-07-18 |
13+
| R4 | **`connect``attach` renamed** with `connect` as alias. `launch` → primary, with `run` + `flutter_run` as aliases. | [`connect.dart` refactored, `flutter_run.dart` primary changed] | 2026-07-18 |
14+
15+
---
16+
17+
## 🔴 Bugs Found via MCP Testing (WorxVPN audit session)
18+
19+
_These were discovered during a live MCP debugging session against WorxVPN on 2026-07-18._
20+
21+
### B1. `screenshot` response format prevents reliable parsing
22+
23+
When `_mcp_content_type: 'image'` is set, `mcp_transport.dart` wraps the response
24+
as `content: [{type: 'image', data: '...', mimeType: 'image/png'}]`. When the flag
25+
is NOT set, the response is `content: [{type: 'text', text: '{"data":"...",...}'}]`.
26+
Tools that call `screenshotImpl` and expect to set `_mcp_content_type` may miss it,
27+
causing inconsistent response shapes across different callers.
28+
29+
**Found in**: Manual testing with WorxVPN — had to try 3 different parsing paths
30+
to extract base64 PNG data from the response.
31+
32+
**Fix**: Ensure all `screenshot` callers set `result['_mcp_content_type'] = 'image'`
33+
before returning, or move the flag into `screenshotImpl` itself.
34+
35+
**Files**: `lib/src/tools/screenshot.dart`, `lib/src/mcp_transport.dart:136-146`
36+
37+
**Priority**: 🔴 High — breaks programmatic screenshot consumers.
38+
39+
---
40+
41+
### B2. `text:Connect` ambiguous — 2 matches blocks navigation
42+
43+
WorxVPN's NavigationRail has a "Connect" nav item, and ConnectionScreen has HTML-like
44+
text "Connect" in its content. Selecting `text:Connect` always fails with
45+
`SelectorError: Ambiguous: 2 nodes match`. The agent cannot navigate back to the
46+
Connection tab without guessing `index:Text:0` or `index:Text:1`.
47+
48+
**Found in**: Testing nav flow — `text:Connect` Error while `text:Log` continued.
49+
50+
**Fix**: Add context-aware selector priority: prefer NavigationRail destinations
51+
over body content, or detect ambiguous navigation matches and hint at index-based
52+
selectors in the error message.
53+
54+
**Files**: `lib/src/selectors.dart`
55+
56+
**Priority**: 🟡 Medium — workaround exists (index:Text:N) but breaks agent flows.
57+
58+
---
59+
60+
### B3. Tap actionability check timeouts on deep trees
61+
62+
`tap(text:Log)` returned `TimeoutException after 0:00:05.000000: tap(text:Log)
63+
failed after 41 attempts`, yet the Log screen **did load** — the tap was injected
64+
successfully. The failure is in `checkActionability` or `getBounds` where the
65+
retry loop expires before the screen transition completes.
66+
67+
**Found in**: Navigating between WorxVPN screens — every text-selector tap on
68+
nav items timed out, but the screen change was confirmed by subsequent `widget_tree`.
69+
70+
**Fix**: Reduce retry complexity for taps that don't need bounds confirmation,
71+
or increase default timeout for `withRetry` on text selector taps.
72+
73+
**Files**: `lib/src/retry.dart`, `lib/src/tools/tap.dart`, `lib/src/actions.dart`
74+
75+
**Priority**: 🟡 Medium — causes false errors; actual gesture succeeds.
76+
77+
---
78+
79+
### B4. `get_errors` crashes on release-mode Flutter apps
80+
81+
Release-mode Flutter apps (including WorxVPN compiled with `--release` or
82+
`flutter build macos --release`) don't support `ext.flutter.inspector.getErrorInfo`.
83+
The tool returns raw error: `"ext.flutter.inspector.getErrorInfo: (-32601) Unknown method"`.
84+
85+
**Found in**: Testing `get_errors` on WorxVPN release build — always returns error.
86+
87+
**Fix**: Catch `-32601` / "Unknown method" response and return a graceful message:
88+
`"errors not available in this build mode (debug mode required)"`.
89+
90+
**Files**: `lib/src/tools/get_errors.dart`
91+
92+
**Priority**: 🟡 Medium — tool breaks in release mode; expected to work by agents.
93+
94+
---
95+
96+
### B5. Response envelope inconsistency across tools
97+
98+
| Tool | Content format |
99+
|---|---|
100+
| `widget_tree` | `content[0].text` → JSON → direct tree data |
101+
| `get_render_tree` | `content[0].text` → JSON → `content[0].text` → nested data |
102+
| `screenshot` (no image flag) | `content[0].text` → JSON → `data` field |
103+
| `screenshot` (with image flag) | `content[0]` has `type: 'image'` + `data` |
104+
| `get_memory` | `content[0].text` → direct JSON |
105+
106+
**Found in**: Writing Python parser — had to add per-tool unwrapping logic.
107+
108+
**Fix**: Standardise: all tools should return direct JSON in `content[0].text`
109+
(no nested content wrapper). The double-wrapping comes from `McpServer.handleToolCall`
110+
in `mcp_transport.dart` which wraps `text: json.encode(result)` — and some tools
111+
return `{'content': [...]}` instead of the result map.
112+
113+
**Files**: `lib/src/mcp_transport.dart:125-165`
114+
115+
**Priority**: 🟢 Low — cosmetic but increases integration complexity.
13116

14117
---
15118

0 commit comments

Comments
 (0)