[PR #1342] [MERGED] No AI: one switch that turns off agent control (socket, horizon-ctl, both MCP servers) #3488

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

📋 Pull Request Information

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

Base: main ← Head: feat/no-ai-switch


📝 Commits (1)

  • b117930 No AI: one switch that turns off agent control (socket, horizon-ctl, both MCP servers)

📊 Changes

11 files changed (+296 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+3 -2)
📝 crates/horizon-client/src/bin/horizon-ctl/main.rs (+43 -1)
📝 crates/horizon-client/src/extras.rs (+7 -1)
📝 crates/horizon-client/src/game.rs (+7 -1)
📝 crates/horizon-core/src/lib.rs (+1 -0)
➕ crates/horizon-core/src/no_ai.rs (+97 -0)
📝 launcher/src/backend.rs (+11 -0)
📝 launcher/src/cli.rs (+23 -1)
📝 launcher/src/mcp.rs (+4 -0)
📝 tools/agent_control_e2e.py (+67 -5)
📝 tools/launcher_mcp_e2e.py (+33 -1)

📄 Description

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

What

One No AI switch that turns off every AI surface, shared by the launcher and the game (brief agent-control-2, section 5):

  • horizon_core::no_ai: reads and writes the noAi line of the game's horizon-extras.txt (in the game home, beside options.txt). Missing means off: AI features are available (the default).
  • The game's extras keep the key when they rewrite the file (Extras::no_ai).
  • While it is on:
    • the game never opens its control socket, even with --control/--control-socket (it logs control socket not opened: AI features are off: ...);
    • horizon-ctl refuses every command with {"error": "AI features are off: turn off No AI in the launcher's settings", "kind": "denied"} and exit status 4 (help still prints);
    • horizon-ctl mcp and horizon-launcher mcp refuse to start with that line, and refuse calls if it is turned on mid-session.
  • horizon-launcher no-ai [on|off] shows or sets it (it stays usable under No AI, or there would be no way back from a terminal).

--benchmark keeps its in-process control channel: it is not an agent surface.

Why

Ludovic (2026-10-23): one switch must cover every AI function, not just the companion. The companion drafts (#1068) had their own copy of the helper (sync_extras, extras_no_ai); this brings one shared helper to main so they can use it. The launcher and game UI for the switch come in the follow-up PRs (Settings, and the game's Horizon settings).

Tests

  • Unit: no_ai read/write/keep-other-lines, horizon-ctl refusal (exit 4, kind denied).
  • tools/agent_control_e2e.py --scenario no-ai: in a scratch game home, horizon-ctl state, launch, logs refuse; horizon-ctl mcp refuses to start; a running MCP session refuses once it is turned on; a real game started with --control-socket under No AI exits normally and never creates the socket.
  • tools/launcher_mcp_e2e.py: no-ai on writes the file, a running horizon-launcher mcp refuses its next call, mcp refuses to start, versions still works, no-ai off restores.
  • The harness now sets HORIZON_HOME to its scratch folder, so the player's own No AI never affects it.

Self-check

Run once on an integration commit of the agent-control PRs (No AI switch, horizon-ctl table, launcher MCP), on the Mac mini:

cargo fmt --all --check                                              ok
cargo clippy --workspace --all-targets -- -D warnings                ok
launcher: cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings   ok
cargo test -p horizon-core -p horizon-client                         ok (1013 + 101 + 18 horizon-ctl + ...)
launcher: cargo test --features gpui/runtime_shaders                 ok (97 lib + 23 bin + 1)
tools/agent_control_e2e.py (fast build, offscreen)                   18/18: survival ui options events consume pick suggestions manage no-ai, cli and mcp
tools/launcher_mcp_e2e.py                                            PASS: 134 tools (46 launcher + 88 game), No AI refused
tools/parity.py --changed origin/main                                selects all 327 (game.rs is an input of every harness); ran the 10 that cover
                                                                     the touched areas: options world_options world_reopen world menu_click
                                                                     screen_layout chat_screen container_screen pack_screen pack_selection: 10 passed

Needs Ludovic

Nothing to decide here. Note for the companion PRs (#1068 and its stack): use horizon_core::no_ai instead of their own sync_extras/extras_no_ai, and Extras::no_ai already exists (their noAi extras key is the same). Left in companion-notes.md.

🤖 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/1342 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/no-ai-switch` --- ### 📝 Commits (1) - [`b117930`](https://github.com/horizon-rust/horizon/commit/b117930ae493b00e4d1a8ef44555b449bddfa967) No AI: one switch that turns off agent control (socket, horizon-ctl, both MCP servers) ### 📊 Changes **11 files changed** (+296 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+3 -2) 📝 `crates/horizon-client/src/bin/horizon-ctl/main.rs` (+43 -1) 📝 `crates/horizon-client/src/extras.rs` (+7 -1) 📝 `crates/horizon-client/src/game.rs` (+7 -1) 📝 `crates/horizon-core/src/lib.rs` (+1 -0) ➕ `crates/horizon-core/src/no_ai.rs` (+97 -0) 📝 `launcher/src/backend.rs` (+11 -0) 📝 `launcher/src/cli.rs` (+23 -1) 📝 `launcher/src/mcp.rs` (+4 -0) 📝 `tools/agent_control_e2e.py` (+67 -5) 📝 `tools/launcher_mcp_e2e.py` (+33 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What One **No AI** switch that turns off every AI surface, shared by the launcher and the game (brief agent-control-2, section 5): - `horizon_core::no_ai`: reads and writes the `noAi` line of the game's `horizon-extras.txt` (in the game home, beside `options.txt`). Missing means off: AI features are available (the default). - The game's extras keep the key when they rewrite the file (`Extras::no_ai`). - While it is on: - the game never opens its control socket, even with `--control`/`--control-socket` (it logs `control socket not opened: AI features are off: ...`); - `horizon-ctl` refuses every command with `{"error": "AI features are off: turn off No AI in the launcher's settings", "kind": "denied"}` and exit status 4 (help still prints); - `horizon-ctl mcp` and `horizon-launcher mcp` refuse to start with that line, and refuse calls if it is turned on mid-session. - `horizon-launcher no-ai [on|off]` shows or sets it (it stays usable under No AI, or there would be no way back from a terminal). `--benchmark` keeps its in-process control channel: it is not an agent surface. ## Why Ludovic (2026-10-23): one switch must cover every AI function, not just the companion. The companion drafts (#1068) had their own copy of the helper (`sync_extras`, `extras_no_ai`); this brings one shared helper to main so they can use it. The launcher and game UI for the switch come in the follow-up PRs (Settings, and the game's Horizon settings). ## Tests - Unit: `no_ai` read/write/keep-other-lines, `horizon-ctl` refusal (exit 4, kind denied). - `tools/agent_control_e2e.py --scenario no-ai`: in a scratch game home, horizon-ctl `state`, `launch`, `logs` refuse; `horizon-ctl mcp` refuses to start; a running MCP session refuses once it is turned on; a real game started with `--control-socket` under No AI exits normally and never creates the socket. - `tools/launcher_mcp_e2e.py`: `no-ai on` writes the file, a running `horizon-launcher mcp` refuses its next call, `mcp` refuses to start, `versions` still works, `no-ai off` restores. - The harness now sets `HORIZON_HOME` to its scratch folder, so the player's own No AI never affects it. ## Self-check Run once on an integration commit of the agent-control PRs (No AI switch, horizon-ctl table, launcher MCP), on the Mac mini: ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok launcher: cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings ok cargo test -p horizon-core -p horizon-client ok (1013 + 101 + 18 horizon-ctl + ...) launcher: cargo test --features gpui/runtime_shaders ok (97 lib + 23 bin + 1) tools/agent_control_e2e.py (fast build, offscreen) 18/18: survival ui options events consume pick suggestions manage no-ai, cli and mcp tools/launcher_mcp_e2e.py PASS: 134 tools (46 launcher + 88 game), No AI refused tools/parity.py --changed origin/main selects all 327 (game.rs is an input of every harness); ran the 10 that cover the touched areas: options world_options world_reopen world menu_click screen_layout chat_screen container_screen pack_screen pack_selection: 10 passed ``` ## Needs Ludovic Nothing to decide here. Note for the companion PRs (#1068 and its stack): use `horizon_core::no_ai` instead of their own `sync_extras`/`extras_no_ai`, and `Extras::no_ai` already exists (their `noAi` extras key is the same). Left in companion-notes.md. 🤖 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:09:53 +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#3488
No description provided.