aws / aws/amazon-q-developer-cli

/usage command shows capped credits (100%) in --no-interactive mode but correct overage (153%) in interactive mode

Aperta
#3,867 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Checks
- [x] I have searched github.com/aws/amazon-q-developer-cli/issues and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

## Operating system

macOS 15.5 (Apple Silicon)

## Expected behaviour

`/usage` in `--no-interactive` mode should report the same credit values as interactive mode. When the account is in overage (usage > plan limit), both modes should show the real total (e.g. `15312.32 of 10000`).

## Actual behaviour

**Interactive mode** (correct):
```
Estimated Usage | resets on 2026-08-01 | KIRO POWER
Credits (15312.32 of 10000 covered in plan)
██████████████████████████████████████████████████ 153.1%
```

**Non-interactive mode** (incorrect — capped at 100%):
```
kiro-cli chat --no-interactive --agent meshclaw-lite "/usage"

Estimated Usage | resets on 2026-08-01 | KIRO POWER
Credits (10000.00 of 10000 covered in plan)
████████████████████████████████████████████████████████████████████████████████ 100%
```

The non-interactive output caps `current_usage` at the plan limit instead of showing the real overage total. This breaks programmatic consumers that parse `/usage` output to display credit usage (e.g. editor extensions, dashboards).

## Steps to reproduce

1. Have a Kiro Power account that is in overage (usage > 10000 credits)
2. Run interactively: `kiro-cli chat` then type `/usage` — shows correct overage (e.g. 15312.32 of 10000)
3. Run non-interactively: `kiro-cli chat --no-interactive "/usage"` — shows capped 10000.00 of 10000

Also reproducible without `--agent`:
```
kiro-cli chat --no-interactive "/usage"
```

## Impact

Any tool that programmatically fetches credit usage via `--no-interactive` mode cannot detect overage state. The `GetUsageLimits` API returns the correct data (including `current_overages`), but the `/usage` text rendering in non-interactive mode truncates it.

## Environment

```
[q-details]
version = "2.12.1"

[system-info]
os = "macOS 15.5"
chip = "Apple M1 Max"
memory = "64.00 GB"

[environment]
shell = "zsh 5.9"
terminal = "iTerm2"
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal comando `/usage` e dal relativo percorso di rendering del testo non interattivo, quindi confrontalo con l'output interattivo. Verifica come vengono gestiti la risposta di `GetUsageLimits` e `current_overages`; il lavoro è completo quando i valori di overage, come `15312.32 of 10000` e 153.1%, compaiono in modo coerente in entrambe le modalità.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.