feat: added Codex saved reset-credit redemption flow to usage tooling

- Added Codex reset-credit models, endpoints, and redemption methods.
- Added reset-credit usage data and cache invalidation for successful redemption.
- Added `/reset-usage` slash command and interactive account selector flow.
- Added contract tests for reset-credit listing, fallback, and consume outcomes.
This commit is contained in:
can1357
2026-06-12 05:20:08 +02:00
parent 6091931b9d
commit 212e05dbbb
25 changed files with 902 additions and 6 deletions
@@ -325,6 +325,8 @@ function formatAccountHeader(
let header = `${icon} ${chalk.bold(redaction?.get(label) ?? label)}`;
const planType = report.metadata?.planType;
if (typeof planType === "string" && planType) header += chalk.dim(` · plan: ${planType}`);
const savedResets = report.resetCredits?.availableCount ?? 0;
if (savedResets > 0) header += chalk.cyan(` · ✦ ${savedResets} saved reset${savedResets === 1 ? "" : "s"}`);
if (report.fetchedAt && nowMs - report.fetchedAt > 90_000) {
header += chalk.dim(` · fetched ${formatDuration(nowMs - report.fetchedAt)} ago`);
}