[PR #809] [MERGED] Command suggestions: ask the server for nodes the tree marks ask_server #2827

Closed
opened 2026-11-02 15:59:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/ask-server-suggestions


📝 Commits (1)

  • ff6e01d Command suggestions: ask the server for nodes the tree marks ask_server

📊 Changes

7 files changed (+257 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/chat.rs (+83 -5)
📝 crates/horizon-client/src/chat_tests.rs (+55 -0)
📝 crates/horizon-client/src/command/mod.rs (+23 -4)
📝 crates/horizon-client/src/command/network.rs (+5 -6)
📝 crates/horizon-client/src/game/chat.rs (+17 -0)
📝 crates/horizon-client/src/game/remote.rs (+55 -0)
📝 tools/lan_e2e.py (+19 -1)

📄 Description

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

What

The chat of a client on a server now asks the server for completions when the command tree marks a node minecraft:ask_server, as vanilla does. This is one of the server-thread gaps: guests, a client on the dedicated server, and single player on its server thread (where the window is a client too).

  • Vanilla 26.3 (ClientSuggestionProvider.customSuggestion and completeCustomSuggestions, CommandSuggestions.updateCommandInfo):
    • For such a node, the client sends ServerboundCommandSuggestionPacket: a new id and the command up to the cursor.
    • The pending suggestions are done when ClientboundCommandSuggestionsPacket comes back with that id. The server's completions join those of the other nodes (Suggestions.merge); then the usage line and the list update.
    • A newer request makes the older reply useless: its id no longer matches.
    • Around 114 nodes use it: bossbar ids, data ... storage, datapacks, team and objective names in scoreboard and execute, random sequences, functions, and others.
  • Horizon before:
    • The server half was there: the hub answers these requests (guest_suggestions, from #708).
    • The client never asked. It gave such a node the local tree's provider, or the argument type's own suggestions, which for these nodes know only the client's side. /bossbar get <Tab> offered nothing on a server.
  • Now:
    • Suggests::AskServer stands for the provider.
    • ChatScreen keeps the local completions while it waits for the reply with the same id, then merges them and shows the list.
    • The remote client sends the request once per frame, at most, and hands the reply to the chat.
    • The remote tree takes each node's provider from the packet only. A local provider the server never sent no longer stands in for the server's (ArgumentNodeStub keeps only the packet's).

Proof

  • tools/lan_e2e.py commands now also checks this:
    • the host creates the bossbar pt6:check;
    • the guest types /bossbar get pt, waits for the reply and presses Tab.
build commands
main FAIL: Tab after /bossbar get pt: '/bossbar get pt'
this branch pass: /bossbar get pt6:check, plus the literal and argument completions as before
this branch, --server-thread pass: /bossbar get pt6:check
  • New unit test ask_server_nodes_wait_for_the_servers_completions (chat_tests.rs) covers:
    • the request text;
    • nothing to complete before the reply;
    • a reply with an older id is dropped;
    • the UTF-16 range is converted;
    • the local tree never asks.

Checks

  • cargo fmt --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib: all pass, including the new test.
  • tools/parity.py --changed origin/main: 89 passed, 0 failed (on 9b97ba09; world_spawn was rerun on its own after another session's pkill stopped it).
  • Rebased onto ce571f78. Run on the integration of this PR with #793, #806, #807, #808 and #813: clippy clean, 851 lib tests pass, and lan_e2e commands passes with ask_server: /bossbar get pt6:check.

Needs Ludovic

Nothing.

🤖 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/809 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ask-server-suggestions` --- ### 📝 Commits (1) - [`ff6e01d`](https://github.com/horizon-rust/horizon/commit/ff6e01de03f5d3df0bb51b2bdc945955fbd01aca) Command suggestions: ask the server for nodes the tree marks ask_server ### 📊 Changes **7 files changed** (+257 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/chat.rs` (+83 -5) 📝 `crates/horizon-client/src/chat_tests.rs` (+55 -0) 📝 `crates/horizon-client/src/command/mod.rs` (+23 -4) 📝 `crates/horizon-client/src/command/network.rs` (+5 -6) 📝 `crates/horizon-client/src/game/chat.rs` (+17 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+55 -0) 📝 `tools/lan_e2e.py` (+19 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What The chat of a client on a server now asks the server for completions when the command tree marks a node `minecraft:ask_server`, as vanilla does. This is one of the server-thread gaps: guests, a client on the dedicated server, and single player on its server thread (where the window is a client too). - **Vanilla 26.3** (`ClientSuggestionProvider.customSuggestion` and `completeCustomSuggestions`, `CommandSuggestions.updateCommandInfo`): - For such a node, the client sends `ServerboundCommandSuggestionPacket`: a new id and the command up to the cursor. - The pending suggestions are done when `ClientboundCommandSuggestionsPacket` comes back with that id. The server's completions join those of the other nodes (`Suggestions.merge`); then the usage line and the list update. - A newer request makes the older reply useless: its id no longer matches. - Around 114 nodes use it: bossbar ids, `data ... storage`, datapacks, team and objective names in `scoreboard` and `execute`, `random` sequences, functions, and others. - **Horizon before:** - The server half was there: the hub answers these requests (`guest_suggestions`, from #708). - The client never asked. It gave such a node the local tree's provider, or the argument type's own suggestions, which for these nodes know only the client's side. `/bossbar get <Tab>` offered nothing on a server. - **Now:** - `Suggests::AskServer` stands for the provider. - `ChatScreen` keeps the local completions while it waits for the reply with the same id, then merges them and shows the list. - The remote client sends the request once per frame, at most, and hands the reply to the chat. - The remote tree takes each node's provider from the packet only. A local provider the server never sent no longer stands in for the server's (`ArgumentNodeStub` keeps only the packet's). ## Proof - `tools/lan_e2e.py` `commands` now also checks this: - the host creates the bossbar `pt6:check`; - the guest types `/bossbar get pt`, waits for the reply and presses Tab. | build | `commands` | |---|---| | main | FAIL: `Tab after /bossbar get pt: '/bossbar get pt'` | | this branch | pass: `/bossbar get pt6:check`, plus the literal and argument completions as before | | this branch, `--server-thread` | pass: `/bossbar get pt6:check` | - New unit test `ask_server_nodes_wait_for_the_servers_completions` (chat_tests.rs) covers: - the request text; - nothing to complete before the reply; - a reply with an older id is dropped; - the UTF-16 range is converted; - the local tree never asks. ## Checks - `cargo fmt --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib`: all pass, including the new test. - `tools/parity.py --changed origin/main`: 89 passed, 0 failed (on 9b97ba09; `world_spawn` was rerun on its own after another session's `pkill` stopped it). - Rebased onto ce571f78. Run on the integration of this PR with #793, #806, #807, #808 and #813: clippy clean, 851 lib tests pass, and `lan_e2e` `commands` passes with `ask_server: /bossbar get pt6:check`. ## Needs Ludovic Nothing. 🤖 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 15:59:22 +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#2827
No description provided.