Skip to content

Add minimax-token-health cron job - #6289

Merged
intentionally-left-nil merged 4 commits into
mainfrom
minimax
Sep 17, 2026
Merged

intentionally-left-nil merged 4 commits into
mainfrom
minimax

Conversation

@intentionally-left-nil

Copy link
Copy Markdown
Contributor

Daily job to query the usage URL for each provisioned api key for minimax, to determine whether the API key is healthy or not. Reports the status as a slack message

Comment thread apps/web/src/lib/coding-plans/minimax-token-health.ts Outdated
Comment thread apps/web/src/lib/coding-plans/minimax-token-health.ts
Comment thread apps/web/src/lib/coding-plans/minimax-token-health.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change at fb90a5fe7 extracts classifyHttpErrorStatus so only 401/403 map to denied, 408/429/5xx map to unreachable, and other non-OK statuses (400/404/422) map to bad_response, matching the requested classification; the new table-driven unit test covers every branch and no new issues were found in the changed lines.

Files Reviewed (2 files)
  • apps/web/src/lib/coding-plans/minimax-token-health.ts - no issues
  • apps/web/src/lib/coding-plans/minimax-token-health.test.ts - no issues
Previous Review Summaries (2 snapshots, latest commit f847899)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit f847899)

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental changes at f8478998 (a per-key dedupe in getMiniMaxTokenHealthTargets, Slack mrkdwn escaping, and the invalid-response classification fix) resolve the three previously reported findings, and no new issues were found in the changed lines.

Files Reviewed (2 files)
  • apps/web/src/lib/coding-plans/minimax-token-health.ts - no new issues (previous findings addressed: model_remains absent now maps to invalid_response; the leftJoin fan-out is collapsed by dedupeByMostRecentLiveSubscription; upstreamPlanId/subscriptionId/plan label are escaped via escapeSlackText/escapeSlackLabel)
  • apps/web/src/lib/coding-plans/minimax-token-health.test.ts - no issues (new unit test covers the dedupe path)

Previous review (commit e6ad4f9)

Status: 3 Issues Found | Recommendation: Address before merge

Executive Summary

The inventory-to-subscription leftJoin has no uniqueness guarantee per key, so a duplicate live subscription row would re-probe the same MiniMax key and double-count it; two smaller diagnostic and Slack-escaping issues round out the findings.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/coding-plans/minimax-token-health.ts 134 leftJoin can return multiple live subscriptions per key; duplicate probes and inflated totals

SUGGESTION

File Line Issue
apps/web/src/lib/coding-plans/minimax-token-health.ts 94 Absent model_remains mislabeled provider_plan_inactive instead of invalid_response
apps/web/src/lib/coding-plans/minimax-token-health.ts 250 DB-derived values interpolated into Slack mrkdwn without escaping
Files Reviewed (6 files)
  • apps/web/src/app/api/cron/minimax-token-health/route.ts - no issues
  • apps/web/src/app/api/cron/minimax-token-health/route.test.ts - no issues
  • apps/web/src/lib/coding-plans/minimax-token-health.ts - 3 issues
  • apps/web/src/lib/coding-plans/minimax-token-health.test.ts - no issues
  • apps/web/src/lib/coding-plans/minimax-usage.ts - no issues (export-only change)
  • apps/web/vercel.json - no issues (new 0 13 * * * entry, no schedule collision)

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@pandemicsyn pandemicsyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt , looks like robot just flagged a minor one

Comment thread apps/web/src/lib/coding-plans/minimax-token-health.ts Outdated
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