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
Copy file name to clipboardExpand all lines: README-DEV.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,59 @@ To find it reliably:
66
66
67
67
Note: In recent builds, the Python server sources are also bundled inside the package under `UnityMcpServer~/src`. This is handy for local testing or pointing MCP clients directly at the packaged server.
68
68
69
+
## MCP Bridge Stress Test
70
+
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
+
73
+
### Script
74
+
-`tools/stress_mcp.py`
75
+
76
+
### What it does
77
+
- Starts N TCP clients against the Unity MCP bridge (default port auto-discovered from `~/.unity-mcp/unity-mcp-status-*.json`).
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.
83
+
84
+
### Usage (local)
85
+
```bash
86
+
# Recommended: use the included large script in the test project
- 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
119
+
- Keep this out of default PR CI due to Unity/editor requirements and runtime variability.
120
+
- Optionally run it as a manual workflow or nightly job on a Unity-capable runner.
121
+
69
122
## CI Test Workflow (GitHub Actions)
70
123
71
124
We provide a CI job to run a Natural Language Editing mini-suite against the Unity test project. It spins up a headless Unity container and connects via the MCP bridge.
0 commit comments