Commit 020fe3f
Fix critical regression: restore dict return for reload preflight
The previous commit (2cf6608) introduced a critical regression by returning
MCPResponse instead of dict when Unity is reloading. This broke the reload
retry loop because _is_reloading_response() only handles dict responses and
immediately returns False for non-dict types, causing the retry helper to
exit instead of waiting through domain reloads.
Changes:
- Revert reload preflight return from MCPResponse to dict format
- Restore return type annotation to dict[str, Any] (remove | MCPResponse)
- Preserve all reload detection fields: success, state, retry_after_ms, error
- Applied to both Server/ and MCPForUnity/ versions
The dict return format ensures _is_reloading_response() correctly detects
reload state via resp.get("state") == "reloading" check, maintaining the
polite retry loop behavior during Unity domain reloads.
Addresses CodeRabbit critical feedback:
- #360 (review)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 2cf6608 commit 020fe3f
File tree
2 files changed
+14
-14
lines changed- MCPForUnity/UnityMcpServer~/src
- Server
2 files changed
+14
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
0 commit comments