diff --git a/AGENTS.md b/AGENTS.md
index 0dd8a6b..b4c4599 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -54,6 +54,8 @@ This repo builds the Grill CLI and project setup tooling. The generated map-proj
## Test Commands
+Use `HotReloadTests` for Grill's hot-run and reload transaction. For automated Warcraft III engine tests, use the `wc3-e2e-harness` sibling and follow its `docs/AgentQuickstart.md` for launch, loading-screen input and cleanup.
+
Run the full WurstSetup suite before publishing:
```bash
diff --git a/README.md b/README.md
index b5101b0..9bc7bc6 100644
--- a/README.md
+++ b/README.md
@@ -135,9 +135,15 @@ A Lua project (`scriptMode: lua`) can change the code of a running single-player
> grill reload
```
-`run --hot` builds the map with the compiler's `-luaHotReload` flag, prepares a hot reload session for `_build`, and launches Warcraft III with a copy of the map in `_build/grill/hot-run`, so that the game does not hold the file each reload builds again. The new session and its saved build options become active only after the launcher succeeds. If launching fails, the previous session, unread payloads, and saved map/settings are restored. This requires a compiler supporting staged hot reload launches. After each edit, `reload` builds the project again, with the map and `--dev` setting of the hot run unless you name another map, and writes the next payload for the running map to pick up. It prints the payload and any warnings. When the edit cannot be hot reloaded (for example a field's type changed), or no map was started with `run --hot` (or a hot run from VS Code), it prints the reasons, writes nothing and exits with 1; rebuild and restart with `run --hot`.
+`run --hot` builds the map with the compiler's `-luaHotReload` flag, prepares a hot reload session for `_build`, and launches Warcraft III with a copy of the map in `_build/grill/hot-run`, so that the game does not hold the file each reload builds again. The new session and its saved build options become active only after the launcher succeeds. If launching fails, the previous session, unread payloads, and saved map/settings are restored. This requires a compiler supporting staged hot reload launches. After each edit, `reload` builds the project again, with the map and `--dev` setting of the hot run unless you name another map, and writes the next payload for the running map to pick up. It prints the payload and any warnings. A successful reload means the payload was written. Confirm application in the game.
-Payloads go to the `CustomMapData` folder of the Warcraft III documents folder (the same documents folder `run` uses), unless `--custom-map-data
` or the VS Code setting `wurst.customMapDataPath` names another folder. Hot reload is Lua only: Jass projects are rejected; use Jass Hot Code Reload (JHCR) for them. What can be reloaded is described in the compiler's `docs/LUA_HOT_RELOAD.md`.
+- **Build error.** Fix the reported errors and run `grill reload` again in the same session.
+- **Incompatible edit.** Grill reports the reason and exits with 1 without writing a payload. Undo the incompatible part and retry, or keep the edit and restart with `grill run --hot` to establish a fresh baseline.
+- **Missing session or no in-game change.** Start with `grill run --hot` if there is no active session. If Grill wrote a payload, check the in-game status and the payload directory before restarting.
+
+Payloads go to the `CustomMapData` folder of the Warcraft III documents folder (the same documents folder `run` uses), unless `--custom-map-data ` or the VS Code setting `wurst.customMapDataPath` names another folder. Hot reload is Lua only: Jass projects are rejected; use Jass Hot Code Reload (JHCR) for them. See the [compiler hot-reload guide](https://github.com/wurstscript/WurstScript/blob/master/docs/LUA_HOT_RELOAD.md) for compatibility and recovery.
+
+New projects receive hot-reload guidance in their generated `AGENTS.md`. For an existing project, merge the **Lua Hot Reload** section from the [current template](templates/AGENTS.md) into your project notes. A newer Grill warns about older template versions during install and preserves local edits.
## How it works
diff --git a/src/main/kotlin/file/SetupApp.kt b/src/main/kotlin/file/SetupApp.kt
index d3cff61..4625c0b 100644
--- a/src/main/kotlin/file/SetupApp.kt
+++ b/src/main/kotlin/file/SetupApp.kt
@@ -41,7 +41,7 @@ object SetupApp {
get() = "Tests: $passed/$total passed"
}
- internal const val AGENTS_TEMPLATE_VERSION = "2026-09-06"
+ internal const val AGENTS_TEMPLATE_VERSION = "2026-11-06"
private const val AGENTS_TEMPLATE_MARKER_PREFIX = ""
private const val AGENTS_TEMPLATE_SOURCE_HINT = "WurstScript Warcraft III map project notes"
@@ -1290,6 +1290,8 @@ object SetupApp {
fail("❌ Hot reload refused; no payload was written.")
if (result.output.any { it.contains("no map was started with hot run") }) {
detail("Try: start the map with `grill run --hot` first.")
+ } else if (result.output.any { it.startsWith("The edit cannot be hot reloaded") }) {
+ detail("Try: undo the incompatible part and run `grill reload` again, or keep the edit and restart with `grill run --hot`.")
} else {
detail("Try: rebuild and restart the map with `grill run --hot`.")
}
diff --git a/src/test/kotlin/HotReloadTests.kt b/src/test/kotlin/HotReloadTests.kt
index d3636b1..3f0dcfd 100644
--- a/src/test/kotlin/HotReloadTests.kt
+++ b/src/test/kotlin/HotReloadTests.kt
@@ -283,6 +283,7 @@ class HotReloadTests {
Assert.assertEquals(outcome.code, 1)
Assert.assertTrue(outcome.err.contains("the type of field Hello_Unit_hp changed"), outcome.err)
Assert.assertTrue(outcome.err.contains("Hot reload refused"), outcome.err)
+ Assert.assertTrue(outcome.err.contains("undo the incompatible part and run `grill reload` again"), outcome.err)
Assert.assertFalse(outcome.out.contains("payload"), outcome.out)
}
diff --git a/templates/AGENTS.md b/templates/AGENTS.md
index 7c04acf..0022013 100644
--- a/templates/AGENTS.md
+++ b/templates/AGENTS.md
@@ -1,4 +1,4 @@
-
+
# AGENTS.md - WurstScript Map Project Notes
WurstScript Warcraft III map project notes for editing `.wurst` code, dependencies, generated objects, tests, or map build logic.
@@ -46,6 +46,13 @@ Write semantic Wurst, not translated JASS or hand-built data plumbing.
Read `scriptMode` before adding `execute()` or timer chunking. Lua has no practical operation limit, so timers should represent real asynchronous delay. Jass has a per-thread operation limit, so genuinely heavy work may require `execute()` or chunking. The installed WC3 client affects launch compatibility, not the build/typecheck target.
+## Lua Hot Reload
+
+- For single-player Lua iteration, check that `grill help` lists `run --hot` and `reload`. Start with `grill run --hot ExampleMap.w3x`, then save edits and run `grill reload`. In VS Code, use **Hot run wurstscript map** and save, or invoke **Hot reload code**.
+- Fix compile errors and retry. If the reload refuses an incompatible change, read the reason. Undo the incompatible part and retry in the same game, or keep it and hot-run again for a fresh baseline.
+- Verify the behavior in game. If a payload was written but nothing changed, check the in-game status, active session and Warcraft III's `CustomMapData/Wurst` directory. See [Lua hot reload recovery](https://github.com/wurstscript/WurstScript/blob/master/docs/LUA_HOT_RELOAD.md).
+- Use `wc3-e2e-harness` for automated Warcraft III engine tests, including launch and loading-screen input.
+
## Validate
```bash