Skip to content

Commit 5e642c8

Browse files
dennys246claude
andcommitted
fix: revert --interactive to boolean True/False, update all surfaces
The display simplification changed --interactive to auto/on/off, but the runtime consumers (selfy.py, media_loop.py, input_handlers.py) all need a boolean — they gate input processing loops. Decision: --interactive stays boolean (True/False) for the CLI and runtime. The 'auto' concept (DM campaigns prompt, generative sims don't) is handled internally by the simulation layer based on campaign type, not exposed as a CLI flag value. Changes: - cli_parser.py: --interactive back to True/False (removed duplicate) - cli_utils.py: validate as boolean - cli.py: convert bool to on/off for sim display layer - api.py: configure() docstring updated (on/off, not auto) - display_simplification_plan.md: documented the decision - test defaults updated Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c5e8f2a commit 5e642c8

6 files changed

Lines changed: 21 additions & 17 deletions

File tree

docs/plans/display_simplification_plan.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
**Goal:** Replace 4 overlapping output systems and 5+ display flags with two orthogonal flags that control what the user sees and how they interact. Default should be clean narrative with smart interactive behavior.
44

5-
**Status:** Planning
5+
**Status:** Partially shipped (DisplayTier + sim_logger display system). `--interactive` reverted to boolean True/False — "auto" detection belongs in the simulation layer, not the CLI flag.
66
**Priority:** First post-publication UX improvement (v1.0.1)
77
**Estimated effort:** ~500 LOC across ~15 files
88

9+
> **Decision (2026-04-09):** `--interactive` stays as a boolean (True/False) controlling whether the runtime accepts user input. The "auto" concept (DM campaigns prompt, generative sims don't) is handled by the simulation layer internally based on campaign type — not exposed as a CLI flag value. The `InteractiveMode` enum in `sim_logger.py` still supports auto/on/off for the display system's internal use via `maxim.configure(interactive="on"/"off")`.
10+
911
---
1012

1113
## The Problem Today

src/maxim/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def configure(
6666
display: Output detail level. ``"clean"`` (narrative only, default),
6767
``"bio"`` (+ memory/learning annotations), ``"debug"``
6868
(+ full system traces).
69-
interactive: Input mode. ``"auto"`` (context-dependent, default),
70-
``"on"`` (always prompt), ``"off"`` (never prompt).
69+
interactive: Input prompting. ``"on"`` (prompt for user input),
70+
``"off"`` (headless — no prompts, use policy defaults).
7171
7272
Example::
7373

src/maxim/cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,10 @@ def _force_exit_handler(signum, frame):
710710
if display_arg == "debug":
711711
set_show_channels("all")
712712

713-
# Apply --interactive mode
714-
interactive_arg = getattr(args, "interactive", "auto")
715-
set_interactive_mode(interactive_arg)
713+
# Apply --interactive mode to simulation display layer
714+
# Runtime --interactive is boolean; sim display uses auto/on/off
715+
_interactive_bool = bool(getattr(args, "interactive", True))
716+
set_interactive_mode("on" if _interactive_bool else "off")
716717

717718
# Apply --show channel filter (legacy, overrides if explicit)
718719
show_channels = getattr(args, "show_channels", None)
@@ -1307,7 +1308,7 @@ def get_internet_policy():
13071308
mode=mode,
13081309
audio=audio_enabled,
13091310
audio_len=float(getattr(args, "audio_len", 5.0) or 5.0),
1310-
interactive=getattr(args, "interactive", "auto") != "off",
1311+
interactive=bool(getattr(args, "interactive", True)),
13111312
)
13121313

13131314
if mode == "sleep":

src/maxim/cli_parser.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ def _build_parser() -> argparse.ArgumentParser:
2525
core.add_argument(
2626
"--interactive",
2727
type=str,
28-
default="auto",
29-
choices=["auto", "on", "off"],
30-
help="Input mode: auto (DM campaigns prompt, generative sims don't, DEFAULT), "
31-
"on (always prompt), off (never prompt — use policy defaults).",
28+
default="true",
29+
help="Enable interactive terminal input (True/False). Default: true.",
3230
)
3331
core.add_argument(
3432
"--verbosity",

src/maxim/cli_utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ def normalize_args(args: argparse.Namespace) -> None:
3232
else:
3333
raise SystemExit(f"Invalid --audio value: {args.audio!r} (expected True/False)")
3434

35-
# --interactive: "auto" (default), "on", or "off"
36-
interactive_raw = str(getattr(args, "interactive", "auto")).strip().lower()
37-
if interactive_raw not in ("auto", "on", "off"):
38-
raise SystemExit(f"Invalid --interactive value: {args.interactive!r} (expected auto/on/off)")
35+
interactive_raw = str(getattr(args, "interactive", "true")).strip().lower()
36+
if interactive_raw in ("1", "true", "t", "yes", "y", "on"):
37+
args.interactive = True
38+
elif interactive_raw in ("0", "false", "f", "no", "n", "off"):
39+
args.interactive = False
40+
else:
41+
raise SystemExit(f"Invalid --interactive value: {args.interactive!r} (expected True/False)")
3942

4043
if str(getattr(args, "mode", "active")).strip().lower() == "sleep":
4144
args.audio = True
@@ -285,7 +288,7 @@ def reexec_with_mode(args: argparse.Namespace, *, mode: str) -> None:
285288
"--audio_len",
286289
str(float(getattr(args, "audio_len", 5.0) or 5.0)),
287290
"--interactive",
288-
str(getattr(args, "interactive", "auto")),
291+
"true" if bool(getattr(args, "interactive", True)) else "false",
289292
]
290293
language_model = str(getattr(args, "language_model", "") or "").strip()
291294
if language_model:

tests/unit/test_cli_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TestNormalizeArgs:
3838
def _make_args(self, **kwargs):
3939
defaults = {
4040
"audio": "true",
41-
"interactive": "auto",
41+
"interactive": "true",
4242
"mode": "active",
4343
"epochs": 0,
4444
"language_model": None,

0 commit comments

Comments
 (0)