You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document immediate-reload stress test and streamline stress tool (immediate refresh, precondition SHA, EOF edits); revert to manage_script.read for compatibility
Copy file name to clipboardExpand all lines: README-DEV.md
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,33 +68,54 @@ Note: In recent builds, the Python server sources are also bundled inside the pa
68
68
69
69
## MCP Bridge Stress Test
70
70
71
-
An on-demand stress utility exercises the MCP bridge with multiple concurrent clients while triggering periodic asset refreshes and script reloads.
71
+
An on-demand stress utility exercises the MCP bridge with multiple concurrent clients while triggering real script reloads via immediate script edits (no menu calls required).
72
72
73
73
### Script
74
74
-`tools/stress_mcp.py`
75
75
76
76
### What it does
77
77
- Starts N TCP clients against the Unity MCP bridge (default port auto-discovered from `~/.unity-mcp/unity-mcp-status-*.json`).
78
-
- Sends a mix of framed `ping`, `execute_menu_item` (e.g., `Assets/Refresh`), and small `manage_gameobject` requests.
79
-
- In parallel, toggles a comment in a large C# file to encourage domain reloads, and triggers `Assets/Refresh` via MCP.
78
+
- Sends lightweight framed `ping` keepalives to maintain concurrency.
79
+
- In parallel, appends a unique marker comment to a target C# file using `manage_script.apply_text_edits` with:
80
+
-`options.refresh = "immediate"` to force an import/compile immediately (triggers domain reload), and
81
+
-`precondition_sha256` computed from the current file contents to avoid drift.
82
+
- Uses EOF insertion to avoid header/`using`-guard edits.
- The tool sets `options.refresh = "immediate"` so changes compile instantly. If you only need churn (not per-edit confirmation), switch to debounced to reduce mid-reload failures.
109
+
- Precondition required:
110
+
-`apply_text_edits` requires `precondition_sha256` on larger files. The tool reads the file first to compute the SHA.
111
+
- Edit location:
112
+
- To avoid header guards or complex ranges, the tool appends a one-line marker at EOF each cycle.
113
+
- Read API:
114
+
- The bridge currently supports `manage_script.read` for file reads. You may see a deprecation warning; it's harmless for this internal tool.
115
+
- Transient failures:
116
+
- Occasional `apply_errors` often indicate the connection reloaded mid-reply. Edits still typically apply; the loop continues on the next iteration.
117
+
118
+
### CI guidance
98
119
- Keep this out of default PR CI due to Unity/editor requirements and runtime variability.
99
120
- Optionally run it as a manual workflow or nightly job on a Unity-capable runner.
0 commit comments