[PR #350] [MERGED] Agent control: read and set every option by key #2514

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

📋 Pull Request Information

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

Base: main ← Head: feat/agent-options


📝 Commits (1)

  • 1a067b3 Agent control: read and set every option by key

📊 Changes

7 files changed (+266 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+7 -0)
📝 crates/horizon-client/src/game/control.rs (+4 -0)
📝 crates/horizon-client/src/game/options.rs (+58 -0)
📝 crates/horizon-client/src/game/ui_control.rs (+2 -1)
📝 crates/horizon-client/src/options_file.rs (+157 -0)
📝 docs/native-client.md (+6 -0)
📝 tools/agent_control_e2e.py (+32 -3)

📄 Description

What. Step 3 of docs/agent-control.md (#321). Stacked on #349.

  • options-get [KEY...]: every options.txt option (193) by its vanilla key, with its value and what it accepts: {"type": "int", "min": 30, "max": 110, "value": 70}, step where the option rounds, enums with choices and their value by name, key bindings as key.keyboard.w, lists as lists
  • options-set KEY VALUE: parsed by the option's type, validated by its own OptionInstance rule (Spec::validate), applied at once and saved exactly as the options screen does (Event::Changed; lang reloads the language, resourcePacks the packs). Unlike loading options.txt, a refused value is an error naming what the option accepts and changes nothing
  • after a set, ui reads the redrawn screen
  • horizon-ctl and its MCP gain both; tools/agent_control_e2e.py gains an options scenario (typed read, set, refused value, options.txt on disk, the options screen's slider moved, GUI scale applied at once)

Horizon's own option files (graphics, controller, extras) are the next step (listed in the doc).

How tested.

cargo fmt --all --check: ok
cargo clippy --workspace --all-targets -- -D warnings: ok
cargo test -p horizon-client: 721 passed, 0 failed (at the top of the stack)
tools/parity.py --changed origin/main on the stack top (ui + options + waits, one integration run): 80 harnesses, 80 passed, 0 failed
  (the UI-tree branch alone: 80/80 before its last one-line tweak, then 60/78 of the rerun before the stack run took over)
tools/agent_control_e2e.py on the Mac mini, real game offscreen, CLI and MCP: survival PASS, ui PASS, options PASS, events PASS

Unit tests: options_file::control_tests (every key describes itself; valid, rounded and refused sets).

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/350 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/agent-options` --- ### 📝 Commits (1) - [`1a067b3`](https://github.com/horizon-rust/horizon/commit/1a067b3d9ef1e02fcd300720eeb219cdfc133fc9) Agent control: read and set every option by key ### 📊 Changes **7 files changed** (+266 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+7 -0) 📝 `crates/horizon-client/src/game/control.rs` (+4 -0) 📝 `crates/horizon-client/src/game/options.rs` (+58 -0) 📝 `crates/horizon-client/src/game/ui_control.rs` (+2 -1) 📝 `crates/horizon-client/src/options_file.rs` (+157 -0) 📝 `docs/native-client.md` (+6 -0) 📝 `tools/agent_control_e2e.py` (+32 -3) </details> ### 📄 Description **What.** Step 3 of `docs/agent-control.md` (#321). Stacked on #349. - `options-get [KEY...]`: every `options.txt` option (193) by its vanilla key, with its value and what it accepts: `{"type": "int", "min": 30, "max": 110, "value": 70}`, `step` where the option rounds, enums with `choices` and their value by name, key bindings as `key.keyboard.w`, lists as lists - `options-set KEY VALUE`: parsed by the option's type, validated by its own `OptionInstance` rule (`Spec::validate`), applied at once and saved exactly as the options screen does (`Event::Changed`; `lang` reloads the language, `resourcePacks` the packs). Unlike loading `options.txt`, a refused value is an error naming what the option accepts and changes nothing - after a set, `ui` reads the redrawn screen - `horizon-ctl` and its MCP gain both; `tools/agent_control_e2e.py` gains an `options` scenario (typed read, set, refused value, `options.txt` on disk, the options screen's slider moved, GUI scale applied at once) Horizon's own option files (graphics, controller, extras) are the next step (listed in the doc). **How tested.** ``` cargo fmt --all --check: ok cargo clippy --workspace --all-targets -- -D warnings: ok cargo test -p horizon-client: 721 passed, 0 failed (at the top of the stack) tools/parity.py --changed origin/main on the stack top (ui + options + waits, one integration run): 80 harnesses, 80 passed, 0 failed (the UI-tree branch alone: 80/80 before its last one-line tweak, then 60/78 of the rerun before the stack run took over) tools/agent_control_e2e.py on the Mac mini, real game offscreen, CLI and MCP: survival PASS, ui PASS, options PASS, events PASS ``` Unit tests: `options_file::control_tests` (every key describes itself; valid, rounded and refused sets). **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:56:49 +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#2514
No description provided.