agy-cli 0.1.65: usage windows name the model ids they cover (#1180)

A usage window from `agy usage` now carries the model ids it covers, taken
from the catalog `agy models` listed: each display name in the group's
"Models within this group:" line (or the group's own name) maps to the
family id and every effort variant the catalog serves. With no catalog yet,
or a name the catalog doesn't have, a window has no ids. The windows stay
aside, so routing is unchanged; agy-cli 0.1.65.

Run at 8acf7ffb5 on macOS (mote), CI-style with a temp HOME:
bun test packages/agy-cli, 35 pass, 0 fail; bun scripts/check.mjs agy-cli
passes. Not tried: a real agy account (the local one answers 403).

Co-authored-by: Ruining Yang <ArmedHelicopter@users.noreply.github.com>
This commit is contained in:
Ruining Yang
2026-11-15 20:31:27 +08:00
committed by GitHub
co-authored by Ruining Yang
parent 6b5c19d50e
commit f4c2f2fb2b
6 changed files with 202 additions and 2 deletions
+3
View File
@@ -3,6 +3,7 @@ import fs from "node:fs/promises"
import os from "node:os"
import path from "node:path"
import { agySpawnSpec, childEnv as agyChildEnv } from "./platform.mjs"
import { modelsInGroup } from "./model-ids.mjs"
import { cannotSignIn, isDead, noteDead, storedSignIn } from "./signin.mjs"
const DEFAULT_TIMEOUT_MS = 15_000
@@ -90,10 +91,12 @@ export function parseUsageReport(value) {
?? (remaining?.case === "remainingFraction" ? remaining.value : undefined)
const known = typeof fraction === "number" && Number.isFinite(fraction) && fraction >= 0 && fraction <= 1
const resetsAt = resetTime(field(bucket, "resetTime", "reset_time"))
const ids = modelsInGroup(group)
windows.push({
name: `${pool} · ${period.name}`,
// This feature displays quota only; it must not change model routing.
aside: true,
...(ids.length ? { models: ids } : {}),
...(known ? { used: Math.round((1 - fraction) * 1e8) / 1e6 } : { display: "Limits not available" }),
...(period.span ? { span: period.span } : {}),
...(resetsAt ? { resetsAt } : {}),