Skip to content

fix(tui): bind model/account/key per coding agent - #39

Merged
duyetbot merged 2 commits into
mainfrom
cursor/per-agent-tui-bindings-5fb7
Sep 3, 2026
Merged

fix(tui): bind model/account/key per coding agent#39
duyetbot merged 2 commits into
mainfrom
cursor/per-agent-tui-bindings-5fb7

Conversation

@duyet

@duyet duyet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

CONFIGURE model… / account… / key… now persist on the current coding agent (header agent / last launch) instead of only the session-wide profile. Pickers stay inline — same screens as before, no extra “which agent?” step. Launch uses those bindings; a stored per-agent key is not silently replaced by the default profile key.

Logo restore and “don’t flash CONFIGURE over LAUNCH” stay on #36.

What changed

  • New agents: section in config.yaml (profile, api_key, default_model per tool id).
  • anyr claude / anyr grok (and the rest) resolve key/account/model from that agent’s binding first.
  • TUI model… / account… / key… write the current agent (last_tool) without an extra picker. Detail text is per agent · claude.
  • CLI: account use work --agent claude, models use stealth/ox-alpha --agent claude (caller-supplied ids only — does not invent catalog ids).
  • Existing anyr claude --model "stealth/ox-alpha[1m]" --yolo still works (catalog id is stored; Claude still gets [1m] at spawn).

Verification

control-anyr doctor was clean. Artifacts: .cursor/skills/verify-anyr/artifacts/per-agent-bindings/.

  • CLI bind: account use work --agent claude left active_profile: default and wrote agents.claude.profile: work.
  • CLI model: models use stealth/ox-alpha --agent claude wrote the catalog id (no [1m] in config).
  • Dry-run: claude ANTHROPIC_AUTH_TOKEN=sk-ar-...cccc + ANTHROPIC_MODEL=stealth/ox-alpha[1m]; grok GROK_CODE_XAI_API_KEY=sk-ar-...dddd. Neither used the default profile key.
  • --yolo still expands to --dangerously-skip-permissions.
  • menu --dump-tui: per agent · claude on model/account/key; LAUNCH claude shows stealth/ox-alpha.
  • PTY: typing acc + Enter opens claude account immediately (no extra agent screen). Selecting a profile wrote agents.claude.profile.

Checklist

  • Version stays on 0.1.x (do not introduce 0.2 / 1.0)
  • Do not auto-merge release-please PRs

Closes #35.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 3, 2026 06:02
CONFIGURE model/account/key stay inline (no extra agent picker) and
persist on the current agent. Launch uses those bindings; a stored
per-agent key is not replaced by the default profile key.

Closes #35.

Co-authored-by: duyet <duyet@users.noreply.github.com>
control-anyr drive of account/model bind, claude vs grok dry-run keys,
menu dump, and an inline TUI account picker write.

Co-authored-by: duyet <duyet@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 3, 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.7 MiB 4.93 ms 4.69 ms
anyr-darwin-x86_64 native 2.9 MiB 31.2 ms 30.22 ms
anyr-linux-arm64 native 2.7 MiB 0.8 ms 0.88 ms
anyr-linux-x86_64 native 3.0 MiB 1.03 ms 1.0 ms
anyr-windows-x86_64.exe native 2.5 MiB 9.39 ms 9.33 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": 2866392,
    "size": "2.7 MiB",
    "version": "0.1.11 (built 2026-09-03 06:06:46)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 3.9,
      "median_ms": 4.93,
      "p95_ms": 8.85,
      "mean_ms": 5.58
    },
    "startup_help": {
      "n": 21,
      "min_ms": 3.17,
      "median_ms": 4.69,
      "p95_ms": 9.82,
      "mean_ms": 5.35
    }
  },
  {
    "asset": "anyr-darwin-x86_64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
    "bytes": 3072976,
    "size": "2.9 MiB",
    "version": "0.1.11 (built 2026-09-03 06:06:37)",
    "target": "x86_64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 29.94,
      "median_ms": 31.2,
      "p95_ms": 37.26,
      "mean_ms": 32.43
    },
    "startup_help": {
      "n": 21,
      "min_ms": 27.91,
      "median_ms": 30.22,
      "p95_ms": 37.4,
      "mean_ms": 31.33
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2823208,
    "size": "2.7 MiB",
    "version": "0.1.11 (built 2026-09-03 06:06:01)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.72,
      "median_ms": 0.8,
      "p95_ms": 0.92,
      "mean_ms": 0.81
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.81,
      "median_ms": 0.88,
      "p95_ms": 0.91,
      "mean_ms": 0.87
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 3170048,
    "size": "3.0 MiB",
    "version": "0.1.11 (built 2026-09-03 06:06:15)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 1.0,
      "median_ms": 1.03,
      "p95_ms": 1.11,
      "mean_ms": 1.04
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.97,
      "median_ms": 1.0,
      "p95_ms": 1.1,
      "mean_ms": 1.01
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2625536,
    "size": "2.5 MiB",
    "version": "0.1.11 (built 2026-09-03T06:07:34Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 8.97,
      "median_ms": 9.39,
      "p95_ms": 11.12,
      "mean_ms": 9.68
    },
    "startup_help": {
      "n": 21,
      "min_ms": 8.96,
      "median_ms": 9.33,
      "p95_ms": 10.05,
      "mean_ms": 9.41
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 180243,
    "size": "176.0 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

@duyetbot
duyetbot marked this pull request as ready for review September 3, 2026 08:18
@duyetbot
duyetbot merged commit 97d3370 into main Sep 3, 2026
9 checks passed
@duyetbot
duyetbot deleted the cursor/per-agent-tui-bindings-5fb7 branch September 3, 2026 08:18
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.

TUI model/account/key switches are global; keys fall back to default

3 participants