Skip to content

fix(cli): keep [1m]/[500k] on Claude virtual ANTHROPIC_MODEL - #69

Merged
duyetbot merged 1 commit into
mainfrom
fix/claude-virtual-floor-suffix
Sep 15, 2026
Merged

duyetbot merged 1 commit into
mainfrom
fix/claude-virtual-floor-suffix

Conversation

@duyetbot

Copy link
Copy Markdown
Member

Why

anyr claude --model anyrouter/auto[1m] showed Claude status anyrouter/auto[200k] (low) because model_id_for_tool peeled the floor and set ANTHROPIC_MODEL=anyrouter/auto. Claude Code then invented [200k] from its default window. Extra-body min_context does not fix the HUD label.

What

  • Claude + virtual presets (anyrouter/auto, free, byok, …): re-apply [1m] / [500k] on ANTHROPIC_MODEL from the peeled suffix or routing.min_context.
  • Concrete catalog ids still strip the suffix (stealth/ox-alpha[1m]stealth/ox-alpha) so they do not 404.
  • Virtual auto with floor ≥ 1M also sets CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000.
  • Do not use catalog context_length (often 200k) as the HUD suffix.

Proof

  • cargo test --locked --all-targets green locally.
  • Dry-run (anyr claude --dry-run --model anyrouter/auto[1m]):
    • ANTHROPIC_MODEL=anyrouter/auto[1m]
    • CLAUDE_CODE_EXTRA_BODY={"provider":{"min_context":1000000}}
    • CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000
  • Concrete: ANTHROPIC_MODEL=stealth/ox-alpha (suffix stripped).

Parent squash-merges. Release-please can bump after merge.

Claude Code's HUD invents [200k] when ANTHROPIC_MODEL is bare
anyrouter/auto. Re-apply the peeled floor on virtual presets only;
concrete catalog ids still strip the suffix so they do not 404.
Also set CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 when the virtual
floor is at least 1M.
@github-actions

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 7.9 ms 7.8 ms
anyr-darwin-x86_64 native 3.0 MiB 35.55 ms 37.23 ms
anyr-linux-arm64 native 2.8 MiB 0.76 ms 0.79 ms
anyr-linux-x86_64 native 3.1 MiB 0.99 ms 1.09 ms
anyr-windows-x86_64.exe native 2.6 MiB 8.02 ms 8.0 ms
anyr.wasm wasm 179.6 KiB

Budget check: ok

raw timings
[
  {
    "asset": "anyr-darwin-arm64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
    "bytes": 2927912,
    "size": "2.8 MiB",
    "version": "0.1.13 (built 2026-09-15 19:26:21)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 5.3,
      "median_ms": 7.9,
      "p95_ms": 10.9,
      "mean_ms": 7.99
    },
    "startup_help": {
      "n": 21,
      "min_ms": 4.27,
      "median_ms": 7.8,
      "p95_ms": 11.52,
      "mean_ms": 7.97
    }
  },
  {
    "asset": "anyr-darwin-x86_64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
    "bytes": 3137904,
    "size": "3.0 MiB",
    "version": "0.1.13 (built 2026-09-15 19:25:58)",
    "target": "x86_64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 31.03,
      "median_ms": 35.55,
      "p95_ms": 42.5,
      "mean_ms": 36.88
    },
    "startup_help": {
      "n": 21,
      "min_ms": 32.86,
      "median_ms": 37.23,
      "p95_ms": 50.9,
      "mean_ms": 39.74
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2888744,
    "size": "2.8 MiB",
    "version": "0.1.13 (built 2026-09-15 19:25:37)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.7,
      "median_ms": 0.76,
      "p95_ms": 0.84,
      "mean_ms": 0.76
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.73,
      "median_ms": 0.79,
      "p95_ms": 0.83,
      "mean_ms": 0.78
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 3234008,
    "size": "3.1 MiB",
    "version": "0.1.13 (built 2026-09-15 19:25:41)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 0.94,
      "median_ms": 0.99,
      "p95_ms": 1.1,
      "mean_ms": 1.0
    },
    "startup_help": {
      "n": 21,
      "min_ms": 1.02,
      "median_ms": 1.09,
      "p95_ms": 1.18,
      "mean_ms": 1.12
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2682368,
    "size": "2.6 MiB",
    "version": "0.1.13 (built 2026-09-15T19:26:51Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 7.94,
      "median_ms": 8.02,
      "p95_ms": 8.59,
      "mean_ms": 8.14
    },
    "startup_help": {
      "n": 21,
      "min_ms": 7.72,
      "median_ms": 8.0,
      "p95_ms": 8.28,
      "mean_ms": 8.06
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 183905,
    "size": "179.6 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

@duyetbot
duyetbot merged commit 9507bef into main Sep 15, 2026
9 checks passed
@duyetbot
duyetbot deleted the fix/claude-virtual-floor-suffix branch September 15, 2026 19:30
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