[PR #1250] [MERGED] Fix slash-command argument suggestions after connecting #3455

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

📋 Pull Request Information

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

Base: main ← Head: t3/fix-slash-command-autocomplete


📝 Commits (2)

  • 15b8514 Fix registry-backed slash command suggestions on connected clients
  • d67779d Make completion regression deterministic and include screenshots

📊 Changes

5 files changed (+61 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+5 -0)
➕ docs/media/command-suggestions/after.png (+0 -0)
➕ docs/media/command-suggestions/before.png (+0 -0)
📝 tools/agent_control_e2e.py (+46 -2)
📝 tools/test_chat_screen_parity.py (+10 -0)

📄 Description

What and why

Fresh single-player and multiplayer connections skipped command-registry initialization. Command names could complete, but item and block arguments had empty registries: /give @s diamond_sw showed an unknown-item error and Tab did nothing. Single player is affected because its client connects to the integrated server through memory.

Initialize fresh client command registries in the shared connection path before receiving the server's command tree. Add a fresh-launch control scenario covering eight completions and 21 fixed vanilla chat-screen cases for suggestion lists, Tab cycling and replacement ranges.

Vanilla reference

  • ClientPacketListener.handleCommands instantiates the received command tree with CommandBuildContext.simple(this.registryAccess, this.enabledFeatures).
  • BlockPosArgument.listSuggestions obtains coordinates from the client suggestion provider.
  • References inspected with tools/rea_vanilla.py; tools/test_chat_screen_parity.py drives the real vanilla ChatScreen and CommandSuggestions.

Validation

  • Reproduced with the unpatched client: command-name and coordinate completion work; /give @s diamond_sw stays unchanged after Tab.
  • Live client: all eight checks pass after a fresh launch into a creative superflat world, including /give, /fill, /setblock, block properties, /clear and /execute run.
  • python3 tools/test_chat_screen_parity.py --count 300: 321/321 match, zero oracle errors.
  • The broader affected parity suite is left to CI by pr_ready --quick.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 022600481, 2 min 41 s)

Check Result
Scope ✅ 5 files, +61 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 290 passed (30 s)
rustfmt ✅ (7 s)
clippy ✅
tests: horizon-client ✅ 1108 passed (1 min 57 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 264 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 252 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

Before: missing item suggestions

Before

After: the matching item suggestion appears and Tab applies it

After


🔄 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/1250 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-slash-command-autocomplete` --- ### 📝 Commits (2) - [`15b8514`](https://github.com/horizon-rust/horizon/commit/15b85145845f2c500dcee979d1401217093426b6) Fix registry-backed slash command suggestions on connected clients - [`d67779d`](https://github.com/horizon-rust/horizon/commit/d67779d5a17432e553a36013e5ba3970cb6f9a20) Make completion regression deterministic and include screenshots ### 📊 Changes **5 files changed** (+61 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+5 -0) ➕ `docs/media/command-suggestions/after.png` (+0 -0) ➕ `docs/media/command-suggestions/before.png` (+0 -0) 📝 `tools/agent_control_e2e.py` (+46 -2) 📝 `tools/test_chat_screen_parity.py` (+10 -0) </details> ### 📄 Description ## What and why Fresh single-player and multiplayer connections skipped command-registry initialization. Command names could complete, but item and block arguments had empty registries: `/give @s diamond_sw` showed an unknown-item error and Tab did nothing. Single player is affected because its client connects to the integrated server through memory. Initialize fresh client command registries in the shared connection path before receiving the server's command tree. Add a fresh-launch control scenario covering eight completions and 21 fixed vanilla chat-screen cases for suggestion lists, Tab cycling and replacement ranges. ## Vanilla reference - `ClientPacketListener.handleCommands` instantiates the received command tree with `CommandBuildContext.simple(this.registryAccess, this.enabledFeatures)`. - `BlockPosArgument.listSuggestions` obtains coordinates from the client suggestion provider. - References inspected with `tools/rea_vanilla.py`; `tools/test_chat_screen_parity.py` drives the real vanilla `ChatScreen` and `CommandSuggestions`. ## Validation - Reproduced with the unpatched client: command-name and coordinate completion work; `/give @s diamond_sw` stays unchanged after Tab. - Live client: all eight checks pass after a fresh launch into a creative superflat world, including `/give`, `/fill`, `/setblock`, block properties, `/clear` and `/execute run`. - `python3 tools/test_chat_screen_parity.py --count 300`: **321/321 match, zero oracle errors**. - The broader affected parity suite is left to CI by `pr_ready --quick`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 022600481, 2 min 41 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +61 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 290 passed (30 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ | | tests: horizon-client | ✅ 1108 passed (1 min 57 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 264 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 252 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots Before: missing item suggestions ![Before](https://raw.githubusercontent.com/rdbtCVS/horizon/d67779d5a17432e553a36013e5ba3970cb6f9a20/docs/media/command-suggestions/before.png) After: the matching item suggestion appears and Tab applies it ![After](https://raw.githubusercontent.com/rdbtCVS/horizon/d67779d5a17432e553a36013e5ba3970cb6f9a20/docs/media/command-suggestions/after.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:40 +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#3455
No description provided.