[PR #1100] [MERGED] agent_control_e2e: wait for the world, start below a tree's crown #3047

Closed
opened 2026-11-02 16:01:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1100
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @ludovic111

Base: main ← Head: fix/agent-e2e-wait-loaded


📝 Commits (2)

  • 5f0e924 agent_control_e2e: wait for the world, and start below a tree's crown
  • 1bd1d57 agent_control_e2e survival: a tree whose log is hidden is skipped

📊 Changes

1 file changed (+27 additions, -9 deletions)

View changed files

📝 tools/agent_control_e2e.py (+27 -9)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Three fixes to tools/agent_control_e2e.py, found while running it in both modes for #1072:

  1. survival and ui wait for the world. Both asserted that the Create New World click itself answered screen: playing. Since 7f4193f8 (2026-10-19, local world initialization off the UI thread), the in-frame world is prepared behind the title screen, so the click answers title. Both scenarios failed in the frame, which is main's default, on every run (checked on plain main: --scenario survival --mode cli fails the same way). They now wait_for loaded, as options, events, consume and pick already do.

  2. survival starts below a tree's crown. The spawn is random within the spawn radius, on the first full top face below the MOTION_BLOCKING height (PlayerSpawnFinder.getLevelRespawnPos). Leaves qualify, so the player can start on a crown (y=70 over a trunk at 65–70), and then no tree is reachable within goto's three-block drops ("no reachable tree near spawn"). The scenario now teleports the player down to the ground under the leaves first.

  3. survival skips a tree whose log is hidden. Low leaves can hide every face of the trunk's bottom log from where the walk stops (break: "no face of block … is visible from here"). The scenario now breaks inside the tree loop and moves on to the next tree, as it already did for one it can't reach.

How tested (Mac mini, main's binary, in the frame)

  • --scenario ui --mode both: 2/2 (0/2 before).
  • --scenario survival --mode both: with fixes 1 and 2 only, three runs: world creation passed in all of them, and one run that spawned on a crown was dropped from y=72 to 66 and passed. Two drivers failed later on a hidden trunk face, which fix 3 handles, and one on "no free spot beside … to place a block" (the #1072 switch branch already retries hidden spots for that). With all three fixes: 3 runs × 2 drivers, 6/6.
  • python3 -m py_compile. Test tool only, no Rust changes.

Labels: skip-release.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1100 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/agent-e2e-wait-loaded` --- ### 📝 Commits (2) - [`5f0e924`](https://github.com/horizon-rust/horizon/commit/5f0e92422143bddc89f2467e9a187c039ce8712a) agent_control_e2e: wait for the world, and start below a tree's crown - [`1bd1d57`](https://github.com/horizon-rust/horizon/commit/1bd1d57fb3949dde2759f2697a75fa48b60aaf8a) agent_control_e2e survival: a tree whose log is hidden is skipped ### 📊 Changes **1 file changed** (+27 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tools/agent_control_e2e.py` (+27 -9) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Three fixes to `tools/agent_control_e2e.py`, found while running it in both modes for #1072: 1. **`survival` and `ui` wait for the world.** Both asserted that the Create New World click itself answered `screen: playing`. Since 7f4193f8 (2026-10-19, local world initialization off the UI thread), the in-frame world is prepared behind the title screen, so the click answers `title`. Both scenarios failed in the frame, which is main's default, on every run (checked on plain main: `--scenario survival --mode cli` fails the same way). They now `wait_for loaded`, as `options`, `events`, `consume` and `pick` already do. 2. **`survival` starts below a tree's crown.** The spawn is random within the spawn radius, on the first full top face below the `MOTION_BLOCKING` height (`PlayerSpawnFinder.getLevelRespawnPos`). Leaves qualify, so the player can start on a crown (y=70 over a trunk at 65–70), and then no tree is reachable within `goto`'s three-block drops ("no reachable tree near spawn"). The scenario now teleports the player down to the ground under the leaves first. 3. **`survival` skips a tree whose log is hidden.** Low leaves can hide every face of the trunk's bottom log from where the walk stops (`break`: "no face of block … is visible from here"). The scenario now breaks inside the tree loop and moves on to the next tree, as it already did for one it can't reach. ## How tested (Mac mini, main's binary, in the frame) - `--scenario ui --mode both`: 2/2 (0/2 before). - `--scenario survival --mode both`: with fixes 1 and 2 only, three runs: world creation passed in all of them, and one run that spawned on a crown was dropped from y=72 to 66 and passed. Two drivers failed later on a hidden trunk face, which fix 3 handles, and one on "no free spot beside … to place a block" (the #1072 switch branch already retries hidden spots for that). With all three fixes: 3 runs × 2 drivers, 6/6. - `python3 -m py_compile`. Test tool only, no Rust changes. Labels: `skip-release`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3047
No description provided.