[PR #1875] [MERGED] Fix/client mods server thread #3834

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

📋 Pull Request Information

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

Base: main ← Head: fix/client-mods-server-thread


📝 Commits (3)

  • da15040 Complete and color mod commands in the chat on the server thread
  • fdfa3d5 Merge branch 'ludovic111:main' into fix/client-mods-server-thread
  • d63d0c1 Merge origin/main into fix/client-mods-server-thread

📊 Changes

3 files changed (+27 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/chat.rs (+1 -1)
📝 crates/horizon-client/src/game/mods.rs (+25 -0)
📝 crates/horizon-client/src/game/remote.rs (+1 -0)

📄 Description

Written with Claude (AI assistant) and opened by @kaicsm.

What and why

Follow-up to #1674 (issue #1602).

With the single-player world on the server thread, the chat box uses the command tree the server sends (chat_tree in game/chat.rs). That tree never contains the commands registered by client mods, so while typing, a mod command (e.g. /hello) is shown in red, is not tab-completed and gets an Unknown or incomplete command error under the box, even though the command runs fine when sent.

#1674 made mod commands run on the server thread. This PR makes the chat box see them: it merges the running mods' commands into the server's tree when it arrives and whenever the set of mod commands changes (merge_remote_tree in game/mods.rs), and chat_tree uses that merged tree. Without the mods feature nothing changes.

Tested by hand with a code mod that registers a command, on the server thread (no --in-frame): the command is now highlighted and completed while typing.

Vanilla reference

Horizon-only: client code mods have no vanilla counterpart.

Self-check

pr_ready (tools/pr_ready.py on SM, against origin/main at 7ab91a4d2, 5 min 27 s)

Check Result
Scope ✅ 3 files, +27 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (13 s)
clippy ✅ (1 min 15 s)
tests: horizon-client ❌ 1087 passed, 3 failed (3 min 50 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 ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The 3 failing horizon-client tests (crash::tests::stacks_start_at_the_panicking_frame, packs::cache::tests::directory_inputs_config_and_owned_output_recovery, save::tests::session_lock_is_exclusive) fail the same way on a clean origin/main (7ab91a4d) on my Windows machine: a path-separator mismatch in the crash test, and file permission/locking errors in the other two. They don't touch the files changed here.

Screenshots

Before (the command is red and not completed):
image

After:
image


🔄 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/1875 **Author:** [@kaicsm](https://github.com/kaicsm) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/client-mods-server-thread` --- ### 📝 Commits (3) - [`da15040`](https://github.com/horizon-rust/horizon/commit/da150409ea6b63f8a70450d5d7a62ac00a8c2ed1) Complete and color mod commands in the chat on the server thread - [`fdfa3d5`](https://github.com/horizon-rust/horizon/commit/fdfa3d568d5347fc273ebce65958c9659c387480) Merge branch 'ludovic111:main' into fix/client-mods-server-thread - [`d63d0c1`](https://github.com/horizon-rust/horizon/commit/d63d0c174494774b5dc9f691a180246ad3d7df8e) Merge origin/main into fix/client-mods-server-thread ### 📊 Changes **3 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/chat.rs` (+1 -1) 📝 `crates/horizon-client/src/game/mods.rs` (+25 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -0) </details> ### 📄 Description > Written with Claude (AI assistant) and opened by @kaicsm. ## What and why Follow-up to #1674 (issue #1602). With the single-player world on the server thread, the chat box uses the command tree the server sends (`chat_tree` in `game/chat.rs`). That tree never contains the commands registered by client mods, so while typing, a mod command (e.g. `/hello`) is shown in red, is not tab-completed and gets an `Unknown or incomplete command` error under the box, even though the command runs fine when sent. #1674 made mod commands run on the server thread. This PR makes the chat box see them: it merges the running mods' commands into the server's tree when it arrives and whenever the set of mod commands changes (`merge_remote_tree` in `game/mods.rs`), and `chat_tree` uses that merged tree. Without the `mods` feature nothing changes. Tested by hand with a code mod that registers a command, on the server thread (no `--in-frame`): the command is now highlighted and completed while typing. ## Vanilla reference Horizon-only: client code mods have no vanilla counterpart. ## Self-check **pr_ready** (`tools/pr_ready.py` on SM, against origin/main at 7ab91a4d2, 5 min 27 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +27 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (13 s) | | clippy | ✅ (1 min 15 s) | | tests: horizon-client | ❌ 1087 passed, 3 failed (3 min 50 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 | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The 3 failing `horizon-client` tests (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`) fail the same way on a clean `origin/main` (7ab91a4d) on my Windows machine: a path-separator mismatch in the crash test, and file permission/locking errors in the other two. They don't touch the files changed here. ## Screenshots Before (the command is red and not completed): <img width="1270" height="291" alt="image" src="https://github.com/user-attachments/assets/4110275e-e15f-42e0-b0b1-f2ba906e2979" /> After: <img width="1108" height="165" alt="image" src="https://github.com/user-attachments/assets/23a1620d-b1b0-416c-9ebe-bd647680a7ce" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:39 +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#3834
No description provided.