[PR #1353] [MERGED] Horizon Settings > AI Agent: agent control on or off, connection status, copy the details #3491

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

📋 Pull Request Information

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

Base: main ← Head: feat/agent-connect-game


📝 Commits (2)

  • 768f149 Horizon Settings > AI Agent: turn agent control on, see who is connected, copy the details
  • 0623d41 Merge remote-tracking branch 'origin/main' into m1353

📊 Changes

9 files changed (+369 additions, -19 deletions)

View changed files

📝 crates/horizon-client/src/control.rs (+52 -2)
📝 crates/horizon-client/src/extras.rs (+23 -2)
📝 crates/horizon-client/src/game.rs (+8 -12)
➕ crates/horizon-client/src/game/agent_settings.rs (+140 -0)
📝 crates/horizon-client/src/game/control.rs (+7 -0)
📝 crates/horizon-client/src/game/options.rs (+7 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+2 -1)
📝 crates/horizon-client/src/options_ui.rs (+64 -0)
📝 tools/agent_control_e2e.py (+66 -2)

📄 Description

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

Stacked on #1342 (No AI). Part of the agent-control-2 brief: connect an agent from the game.

What changes

  • Horizon Settings gets a new row: AI Agent... and No AI: Off. With No AI on, only the No AI switch shows. Turning it on in the game closes the control socket at once.
  • AI Agent page (vanilla style):
    • Agent Control: On/Off (agentControl in horizon-extras.txt, off by default). When it is on, the game the player starts opens the default control endpoint ($HORIZON_CONTROL, else horizon-control.sock in the runtime dir), so horizon-ctl and MCP clients reach it without --control. A game an agent launched (--control, --control-socket) opens it as before.
    • Turning the switch off closes the endpoint immediately. control::Server's Drop now also stops its listener thread (it wakes it with one connect).
    • Status lines: Connected: N agent connection(s), last command N s ago, Waiting for an agent. or Off: agents can't reach this game., then the socket name, then "Local only: agents on this computer, never the network."
    • Copy Connection Details copies the full socket path, a horizon-ctl --socket ... state line to try, and an mcpServers config for this game's horizon-ctl mcp.
  • horizon-ctl options agent opens the page. The agent value is added to the MCP enum in #1343.

Screenshots (offscreen, 1280x720)

The Mac mini's session is locked, so these come from the game's own offscreen screenshot. They are not attached here, but sit at ~/code/horizon-parity/screenshots/agent-control-2/ on the Mac mini (cli-horizon-settings.png, cli-ai-agent.png). The vanilla-style menus have no light or dark variant.

Tested (Mac mini)

  • cargo test -p horizon-client: lib 1014 passed. The test horizon_settings_hang_off_options_and_reach_every_horizon_page now covers the AI Agent page, that No AI hides it, and its switch and Copy button.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check: clean.
  • tools/agent_control_e2e.py --scenario setting (new): Agent Control on opens the endpoint without --control, both pages list their widgets, Copy works, and switching it off removes the endpoint while the game keeps running. PASS.
  • --scenario no-ai, CLI and MCP: PASS. The start_agent_control refactor still skips the socket under No AI.
  • Parity: options, screen_layout, menu_click and world_options all PASS.

🤖 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/1353 **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/agent-connect-game` --- ### 📝 Commits (2) - [`768f149`](https://github.com/horizon-rust/horizon/commit/768f14919038fa03e6e5a7d6d51772c75b09c212) Horizon Settings > AI Agent: turn agent control on, see who is connected, copy the details - [`0623d41`](https://github.com/horizon-rust/horizon/commit/0623d419540c0f5cf74506bad0caf4e51d4f61c7) Merge remote-tracking branch 'origin/main' into m1353 ### 📊 Changes **9 files changed** (+369 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/control.rs` (+52 -2) 📝 `crates/horizon-client/src/extras.rs` (+23 -2) 📝 `crates/horizon-client/src/game.rs` (+8 -12) ➕ `crates/horizon-client/src/game/agent_settings.rs` (+140 -0) 📝 `crates/horizon-client/src/game/control.rs` (+7 -0) 📝 `crates/horizon-client/src/game/options.rs` (+7 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+2 -1) 📝 `crates/horizon-client/src/options_ui.rs` (+64 -0) 📝 `tools/agent_control_e2e.py` (+66 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1342 (No AI). Part of the agent-control-2 brief: connect an agent from the game. ## What changes - **Horizon Settings** gets a new row: `AI Agent...` and `No AI: Off`. With No AI on, only the No AI switch shows. Turning it on in the game closes the control socket at once. - **AI Agent page** (vanilla style): - `Agent Control: On/Off` (`agentControl` in horizon-extras.txt, off by default). When it is on, the game the player starts opens the default control endpoint (`$HORIZON_CONTROL`, else `horizon-control.sock` in the runtime dir), so `horizon-ctl` and MCP clients reach it without `--control`. A game an agent launched (`--control`, `--control-socket`) opens it as before. - Turning the switch off closes the endpoint immediately. `control::Server`'s Drop now also stops its listener thread (it wakes it with one connect). - Status lines: `Connected: N agent connection(s), last command N s ago`, `Waiting for an agent.` or `Off: agents can't reach this game.`, then the socket name, then "Local only: agents on this computer, never the network." - `Copy Connection Details` copies the full socket path, a `horizon-ctl --socket ... state` line to try, and an `mcpServers` config for this game's `horizon-ctl mcp`. - `horizon-ctl options agent` opens the page. The `agent` value is added to the MCP enum in #1343. ## Screenshots (offscreen, 1280x720) The Mac mini's session is locked, so these come from the game's own offscreen `screenshot`. They are not attached here, but sit at `~/code/horizon-parity/screenshots/agent-control-2/` on the Mac mini (`cli-horizon-settings.png`, `cli-ai-agent.png`). The vanilla-style menus have no light or dark variant. ## Tested (Mac mini) - `cargo test -p horizon-client`: lib 1014 passed. The test `horizon_settings_hang_off_options_and_reach_every_horizon_page` now covers the AI Agent page, that No AI hides it, and its switch and Copy button. - `cargo clippy --workspace --all-targets -D warnings` and `cargo fmt --check`: clean. - `tools/agent_control_e2e.py --scenario setting` (new): Agent Control on opens the endpoint without `--control`, both pages list their widgets, Copy works, and switching it off removes the endpoint while the game keeps running. PASS. - `--scenario no-ai`, CLI and MCP: PASS. The `start_agent_control` refactor still skips the socket under No AI. - Parity: options, screen_layout, menu_click and world_options all PASS. 🤖 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:55 +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#3491
No description provided.