Skip to content

fix(menu): show HUD status line when menu runs non-interactively - #57

Merged
duyetbot merged 1 commit into
mainfrom
cli/launcher-non-tty-status
Sep 6, 2026
Merged

fix(menu): show HUD status line when menu runs non-interactively#57
duyetbot merged 1 commit into
mainfrom
cli/launcher-non-tty-status

Conversation

@duyetbot

@duyetbot duyetbot commented Sep 6, 2026

Copy link
Copy Markdown
Member

What

A piped anyr menu (no TTY, not --dump-tui) used to print only the bare action list with no account/model/agent/credits context. The status line is the whole payoff of the 'preflight' launcher, but the non-interactive path dropped it.

Now it prints the status line first, then the actions:

anyr  ● default  ·  anyrouter/auto  ·  claude  ·  -
Launch claude
Config
Models
Quit

Why

Scripts, CI, and smoke checks run anyr menu (or bare anyr) off a TTY. Without the status line there's no preflight signal — no account, no model, no signed-in dot. The launcher's job is to confirm account/model/agent before launch; the non-interactive path was silently dropping that confirmation.

Scope

One path in run_menu (the !term::is_interactive() branch): print status before the action list. ANSI stays suppressed off-TTY; secrets stay masked. No change to the interactive HUD or the --dump-tui path.

Verification

  • cargo test --locked --all-targets — 287 passed (new menu_non_tty_prints_status_before_actions asserts the status leads, names anyr, and never leaks a secret).
  • cargo clippy clean (exit 0), cargo fmt --check clean.
  • cargo build --no-default-features (wasm) + --release (3.07 MiB) green.
  • Smoke: ANYROUTER_HOME=… anyr menu in a pipe shows the status line with no ANSI and a masked key.

Built on top of #48's split (this branch is off main).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

anyr size and startup

Startup is wall time for a cold anyr --version / anyr --help (median of 21 runs). Size is the stripped release binary, or the .wasm for the browser demo.

Size budget: anyr-linux-x86_64 must stay ≤ 4.0 MiB (4194304 bytes) stripped.

Asset Kind Size --version median --help median
anyr-darwin-arm64 native 2.8 MiB 2.88 ms 2.49 ms
anyr-darwin-x86_64 native 3.0 MiB 29.72 ms 31.26 ms
anyr-linux-arm64 native 2.8 MiB 0.72 ms 0.74 ms
anyr-linux-x86_64 native 3.1 MiB 1.17 ms 0.99 ms
anyr-windows-x86_64.exe native 2.6 MiB 9.23 ms 9.17 ms
anyr.wasm wasm 176.0 KiB

Budget check: ok

raw timings
[
  {
    "asset": "anyr-darwin-arm64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
    "bytes": 2927832,
    "size": "2.8 MiB",
    "version": "0.1.11 (built 2026-09-06 13:19:50)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 2.76,
      "median_ms": 2.88,
      "p95_ms": 3.24,
      "mean_ms": 2.92
    },
    "startup_help": {
      "n": 21,
      "min_ms": 2.4,
      "median_ms": 2.49,
      "p95_ms": 2.73,
      "mean_ms": 2.52
    }
  },
  {
    "asset": "anyr-darwin-x86_64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
    "bytes": 3133760,
    "size": "3.0 MiB",
    "version": "0.1.11 (built 2026-09-06 13:20:01)",
    "target": "x86_64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 29.3,
      "median_ms": 29.72,
      "p95_ms": 32.31,
      "mean_ms": 30.02
    },
    "startup_help": {
      "n": 21,
      "min_ms": 28.73,
      "median_ms": 31.26,
      "p95_ms": 31.68,
      "mean_ms": 31.15
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2888744,
    "size": "2.8 MiB",
    "version": "0.1.11 (built 2026-09-06 13:19:37)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.69,
      "median_ms": 0.72,
      "p95_ms": 0.82,
      "mean_ms": 0.74
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.7,
      "median_ms": 0.74,
      "p95_ms": 0.83,
      "mean_ms": 0.75
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 3230848,
    "size": "3.1 MiB",
    "version": "0.1.11 (built 2026-09-06 13:19:49)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 1.0,
      "median_ms": 1.17,
      "p95_ms": 1.5,
      "mean_ms": 1.27
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.95,
      "median_ms": 0.99,
      "p95_ms": 1.05,
      "mean_ms": 1.0
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2675200,
    "size": "2.6 MiB",
    "version": "0.1.11 (built 2026-09-06T13:21:27Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 8.94,
      "median_ms": 9.23,
      "p95_ms": 10.04,
      "mean_ms": 9.32
    },
    "startup_help": {
      "n": 21,
      "min_ms": 8.89,
      "median_ms": 9.17,
      "p95_ms": 9.51,
      "mean_ms": 9.23
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 180265,
    "size": "176.0 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

…eractively

A piped Launch claude
Launch grok
Config
Models
Quit (no TTY, not --dump-tui) used to print only the bare
action list — Launch claude / Config / Models / Quit — with no account,
model, agent, or credits context. The status line is the whole payoff of
the 'preflight' launcher, so print it first, then the actions. ANSI stays
suppressed off-TTY, and secrets are still masked (verified by a new test).
@duyetbot
duyetbot force-pushed the cli/launcher-non-tty-status branch from f7bf773 to cba16c3 Compare September 6, 2026 13:17
@duyetbot
duyetbot merged commit d54ffbe into main Sep 6, 2026
9 checks passed
@duyetbot
duyetbot deleted the cli/launcher-non-tty-status branch September 6, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants