[PR #2140] [MERGED] Quiet commands: the server runs a mod's batch of commands with no chat #4040

Closed
opened 2026-11-03 04:14:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/quiet-commands-server


📝 Commits (1)

  • 145c4c8 Quiet commands: the server runs a mod's batch of commands with no chat

📊 Changes

11 files changed (+591 additions, -40 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/commands.rs (+18 -3)
📝 crates/horizon-client/src/game/lan.rs (+11 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+55 -35)
📝 crates/horizon-client/src/game/lan_chat.rs (+5 -1)
➕ crates/horizon-client/src/game/lan_quiet.rs (+165 -0)
📝 crates/horizon-client/src/game/net_harness.rs (+23 -1)
📝 crates/horizon-client/src/lan/conn.rs (+11 -0)
📝 crates/horizon-protocol/src/lib.rs (+1 -0)
➕ crates/horizon-protocol/src/quiet.rs (+166 -0)
➕ tools/quiet_commands_e2e.py (+135 -0)

📄 Description

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

The server half of mods' quiet commands: Horizon's server can run a batch of a client mod's commands as the player who sent them, with nothing in the chat. The mod API function (command.run-quiet, level 3) and the client follow in the next PR.

Why: a ported Orbital Laser strike runs about 5,000 vanilla commands, and about 4,100 of them are fills that change nothing. Through command.run, each one prints "No blocks were filled" in red. Failures ignore send_command_feedback, so a single strike prints about 5,500 chat lines.

What

  • Protocol (horizon_protocol::quiet): a horizon:quiet_commands custom payload carrying the mod's id and the lines.
    • At most 256 lines of 256 characters, within vanilla's 32 KiB serverbound payload. A payload that breaks a cap is refused whole and logged.
    • encode splits a long batch into as few payloads as fit.
  • Announcement: in the configuration phase, the server sends an empty horizon:quiet_commands payload, only to a client whose brand is horizon. A vanilla client is sent nothing, so the dedicated-server parity harness still sees vanilla's configuration packets exactly.
  • Permissions don't change. Each line runs through guest_command's own checks (Allow Commands, the LAN's guest commands, the player's permission level at the moment it runs), exactly as if that player had typed it.
    • The only difference is the source: the player's own source with vanilla's withSuppressedOutput (Source.silent, which functions already use), so no feedback and no failure reach anyone.
    • A line that carries a chat message (say, msg…) is refused: it would need the player's signature.
  • Rate: batches wait in a queue on the server.
    • Each player runs at most 64 lines a tick.
    • At most 4,096 lines may wait per player; lines past that are dropped and counted.
  • Audit: each finished batch writes one line to the server log, for example Tester ran 3 quiet command(s) from mod orbital: 2 failed. Nothing goes to the chat.
  • Refactor: run_guest_commands keeps the loop, and the body becomes run_guest_command, which reports success. run_command now returns whether the command succeeded, so failures can be counted.

Tests

  • horizon-protocol quiet: a round trip; splitting by lines and by bytes; every cap refused (too many lines, a line too long, a negative count, trailing bytes).
  • lan_quiet: the log line.
  • End to end: tools/quiet_commands_e2e.py --bin-dir target/fast, with Horizon's dedicated server and the headless net harness (HORIZON_NET_QUIET), all 7 pass:
    • as a non-op, a quiet setblock is refused: the console's execute if block fails, nothing reaches the chat, and the log reads "1 failed";
    • as an op, the setblock runs ("Test passed"), a fill that changes nothing fails silently, say is refused, the chat is empty, and the log reads "ran 3 … 2 failed".

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 5a9e07301, 7 min 59 s)

Check Result
Scope ⚠️ 11 files, +591 −40; 631 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 310 run, FAILED (errors=2) (1 min 0 s)
rustfmt ✅ (8 s)
clippy ✅ (51 s)
tests: horizon-client, horizon-protocol ✅ 1400 passed (5 min 49 s)
doc tests ✅ 0 passed (5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 109 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera, cauldron, chat_screen and 97 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The two Python errors are this Mac's, not the change's: test_rust_parity trips on /private/var vs /var, and test_parity_runner's fake java exits 127. 631 lines: the 180 of them in the e2e tool and the tests are what checks it.

skip-release: players see nothing until a mod uses it (next PR).

🤖 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/2140 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/quiet-commands-server` --- ### 📝 Commits (1) - [`145c4c8`](https://github.com/horizon-rust/horizon/commit/145c4c877b23e65e471b0cc99cf5b34a4999c8c2) Quiet commands: the server runs a mod's batch of commands with no chat ### 📊 Changes **11 files changed** (+591 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+18 -3) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+55 -35) 📝 `crates/horizon-client/src/game/lan_chat.rs` (+5 -1) ➕ `crates/horizon-client/src/game/lan_quiet.rs` (+165 -0) 📝 `crates/horizon-client/src/game/net_harness.rs` (+23 -1) 📝 `crates/horizon-client/src/lan/conn.rs` (+11 -0) 📝 `crates/horizon-protocol/src/lib.rs` (+1 -0) ➕ `crates/horizon-protocol/src/quiet.rs` (+166 -0) ➕ `tools/quiet_commands_e2e.py` (+135 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. The server half of mods' **quiet commands**: Horizon's server can run a batch of a client mod's commands as the player who sent them, with nothing in the chat. The mod API function (`command.run-quiet`, level 3) and the client follow in the next PR. Why: a ported Orbital Laser strike runs about 5,000 vanilla commands, and about 4,100 of them are fills that change nothing. Through `command.run`, each one prints "No blocks were filled" in red. Failures ignore `send_command_feedback`, so a single strike prints about 5,500 chat lines. ## What - **Protocol** (`horizon_protocol::quiet`): a `horizon:quiet_commands` custom payload carrying the mod's id and the lines. - At most 256 lines of 256 characters, within vanilla's 32 KiB serverbound payload. A payload that breaks a cap is refused whole and logged. - `encode` splits a long batch into as few payloads as fit. - **Announcement:** in the configuration phase, the server sends an empty `horizon:quiet_commands` payload, only to a client whose brand is `horizon`. A vanilla client is sent nothing, so the dedicated-server parity harness still sees vanilla's configuration packets exactly. - **Permissions don't change.** Each line runs through `guest_command`'s own checks (Allow Commands, the LAN's guest commands, the player's permission level at the moment it runs), exactly as if that player had typed it. - The only difference is the source: the player's own source with vanilla's `withSuppressedOutput` (`Source.silent`, which functions already use), so no feedback and no failure reach anyone. - A line that carries a chat message (`say`, `msg`…) is refused: it would need the player's signature. - **Rate:** batches wait in a queue on the server. - Each player runs at most 64 lines a tick. - At most 4,096 lines may wait per player; lines past that are dropped and counted. - **Audit:** each finished batch writes one line to the server log, for example `Tester ran 3 quiet command(s) from mod orbital: 2 failed`. Nothing goes to the chat. - **Refactor:** `run_guest_commands` keeps the loop, and the body becomes `run_guest_command`, which reports success. `run_command` now returns whether the command succeeded, so failures can be counted. ## Tests - `horizon-protocol` quiet: a round trip; splitting by lines and by bytes; every cap refused (too many lines, a line too long, a negative count, trailing bytes). - `lan_quiet`: the log line. - **End to end:** `tools/quiet_commands_e2e.py --bin-dir target/fast`, with Horizon's dedicated server and the headless net harness (`HORIZON_NET_QUIET`), all 7 pass: - as a non-op, a quiet `setblock` is refused: the console's `execute if block` fails, nothing reaches the chat, and the log reads "1 failed"; - as an op, the `setblock` runs ("Test passed"), a `fill` that changes nothing fails silently, `say` is refused, the chat is empty, and the log reads "ran 3 … 2 failed". **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 5a9e07301, 7 min 59 s) | Check | Result | | --- | --- | | Scope | ⚠️ 11 files, +591 −40; 631 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 310 run, FAILED (errors=2) (1 min 0 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (51 s) | | tests: horizon-client, horizon-protocol | ✅ 1400 passed (5 min 49 s) | | doc tests | ✅ 0 passed (5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 109 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera, cauldron, chat_screen and 97 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The two Python errors are this Mac's, not the change's: `test_rust_parity` trips on `/private/var` vs `/var`, and `test_parity_runner`'s fake `java` exits 127. 631 lines: the 180 of them in the e2e tool and the tests are what checks it. `skip-release`: players see nothing until a mod uses it (next PR). 🤖 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 04:14:14 +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#4040
No description provided.