[PR #4795] [MERGED] Main's parity: dedicated commands only on a dedicated server, /fetchprofile in command_exec #5855

Closed
opened 2026-11-03 05:15:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/dedicated-commands-tree


📝 Commits (2)

  • 1af0acf Commands: /op, /ban, /pardon, /deop and /whitelist only on a dedicated server
  • f2f768b command_exec harness: /fetchprofile answers on the next tick, as the oracle's

📊 Changes

7 files changed (+134 additions, -49 deletions)

View changed files

📝 crates/horizon-client/src/game/command_harness.rs (+9 -0)
📝 crates/horizon-client/src/game/commands/extra.rs (+9 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+3 -0)
📝 crates/horizon-command/src/tests.rs (+37 -3)
📝 crates/horizon-command/src/tree_extra.rs (+40 -34)
📝 crates/horizon-command/src/vanilla.rs (+32 -11)
📝 tools/test_command_exec_parity.py (+4 -1)

📄 Description

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

Fixes main's parity: chat_screen and command_exec fail on every PR. Two causes:

  1. #4680 (own-prs-1 flagged it at 23:02Z): ban in single player's Tab and /help.
  2. #4702: the two /fetchprofile #tick lines. The oracle's profile resolver answers at once (it has no services); the game asked Mojang over the network on a thread that the harness's back-to-back ticks outran. The probe now gets a discovery address that refuses at once (HORIZON_API_DISCOVERY=http://127.0.0.1:9/), and the harness waits for lookups still in flight before each scripted tick (profile_fetches_pending). This is harness-only; players see no change.

#4680 (levzzz5154) lets a dedicated server's operators run /op, /deop, /ban, /pardon and /whitelist in game. It registered them in the one tree every server uses, so single player's and a LAN world's /help and Tab offered them too (ban where vanilla suggests bossbar). Vanilla registers them only when Commands.CommandSelection.includeDedicated is set.

  • tree_extra::register_dedicated holds those commands; vanilla::build_for(dev, dedicated) adds them.
  • game_tree(dev, horizon, dedicated) caches each tree. set_dedicated_commands(true) turns them on, beside set_horizon_commands, and the dedicated server calls it in preflight. Single player's server thread never runs preflight, so it stays an integrated server.
  • release_dispatcher() and dispatcher() (the probes, the client) are the integrated tree again, as before #4680.
  • Test: only_a_dedicated_server_has_the_dedicated_commands; profile_commands_parse_like_vanilla now parses on the dedicated tree.

Everything #4680 added keeps working on a dedicated server. A follow-up adds /ban-ip, /pardon-ip and /banlist for operators, with an end-to-end check that has a Horizon client run the commands as an op.

Proof

Head f2f768bb3628f6d4b33e9211557d8c95d8f49251, on the Mac mini:

python3 tools/parity.py chat_screen command_exec command_parse
PASS chat_screen · PASS command_parse · PASS command_exec (925/925; was 922/925 on main)
python3 tools/parity.py dedicated_server server_ops_feedback server_player_targets   (previous head 1af0acfc3; the commit since touches only the command harness)
PASS server_ops_feedback · PASS dedicated_server · PASS server_player_targets

python3 tools/pr_ready.py --quick:

Check Result
Scope ✅ 7 files, +134 −49
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (50 s)
rustfmt ✅ (7 s)
clippy ✅ (11 s)
tests: horizon-client, horizon-command ✅ 1243 passed (3 min 8 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 35 affected, to run in CI (--quick): block_removal, chat_screen, command_exec, command_parse, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn and 23 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

proven f2f768bb36

🤖 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/4795 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dedicated-commands-tree` --- ### 📝 Commits (2) - [`1af0acf`](https://github.com/horizon-rust/horizon/commit/1af0acfc374a33528dfff11942e956be42311620) Commands: /op, /ban, /pardon, /deop and /whitelist only on a dedicated server - [`f2f768b`](https://github.com/horizon-rust/horizon/commit/f2f768bb3628f6d4b33e9211557d8c95d8f49251) command_exec harness: /fetchprofile answers on the next tick, as the oracle's ### 📊 Changes **7 files changed** (+134 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/command_harness.rs` (+9 -0) 📝 `crates/horizon-client/src/game/commands/extra.rs` (+9 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+3 -0) 📝 `crates/horizon-command/src/tests.rs` (+37 -3) 📝 `crates/horizon-command/src/tree_extra.rs` (+40 -34) 📝 `crates/horizon-command/src/vanilla.rs` (+32 -11) 📝 `tools/test_command_exec_parity.py` (+4 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes main's parity: `chat_screen` and `command_exec` fail on every PR. Two causes: 1. #4680 (own-prs-1 flagged it at 23:02Z): `ban` in single player's Tab and `/help`. 2. #4702: the two `/fetchprofile` `#tick` lines. The oracle's profile resolver answers at once (it has no services); the game asked Mojang over the network on a thread that the harness's back-to-back ticks outran. The probe now gets a discovery address that refuses at once (`HORIZON_API_DISCOVERY=http://127.0.0.1:9/`), and the harness waits for lookups still in flight before each scripted tick (`profile_fetches_pending`). This is harness-only; players see no change. #4680 (levzzz5154) lets a dedicated server's operators run `/op`, `/deop`, `/ban`, `/pardon` and `/whitelist` in game. It registered them in the one tree every server uses, so single player's and a LAN world's `/help` and Tab offered them too (`ban` where vanilla suggests `bossbar`). Vanilla registers them only when `Commands.CommandSelection.includeDedicated` is set. - `tree_extra::register_dedicated` holds those commands; `vanilla::build_for(dev, dedicated)` adds them. - `game_tree(dev, horizon, dedicated)` caches each tree. `set_dedicated_commands(true)` turns them on, beside `set_horizon_commands`, and the dedicated server calls it in `preflight`. Single player's server thread never runs `preflight`, so it stays an integrated server. - `release_dispatcher()` and `dispatcher()` (the probes, the client) are the integrated tree again, as before #4680. - Test: `only_a_dedicated_server_has_the_dedicated_commands`; `profile_commands_parse_like_vanilla` now parses on the dedicated tree. Everything #4680 added keeps working on a dedicated server. A follow-up adds `/ban-ip`, `/pardon-ip` and `/banlist` for operators, with an end-to-end check that has a Horizon client run the commands as an op. ## Proof Head `f2f768bb3628f6d4b33e9211557d8c95d8f49251`, on the Mac mini: ``` python3 tools/parity.py chat_screen command_exec command_parse PASS chat_screen · PASS command_parse · PASS command_exec (925/925; was 922/925 on main) python3 tools/parity.py dedicated_server server_ops_feedback server_player_targets (previous head 1af0acfc3; the commit since touches only the command harness) PASS server_ops_feedback · PASS dedicated_server · PASS server_player_targets ``` `python3 tools/pr_ready.py --quick`: | Check | Result | | --- | --- | | Scope | ✅ 7 files, +134 −49 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (50 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (11 s) | | tests: horizon-client, horizon-command | ✅ 1243 passed (3 min 8 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 35 affected, to run in CI (--quick): block_removal, chat_screen, command_exec, command_parse, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn and 23 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | proven f2f768bb3628f6d4b33e9211557d8c95d8f49251 🤖 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-03 05:15:28 +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#5855
No description provided.