fix(auto-fix): show clear insufficient-credits message - #5077
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of Files Reviewed (2 files)
Previous Review Summaries (4 snapshots, latest commit 2cac687)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2cac687)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of Files Reviewed (9 files)
Previous review (commit 1f0f69d)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of Files Reviewed (1 file)
Previous review (commit af21e1b)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryAll four previous findings are fixed at HEAD, but merging Overview
Issue Details (click to expand)WARNING
Files Reviewed (9 files)
Fix these issues in Kilo Cloud Previous reviewStatus: 4 Issues Found | Recommendation: Address before merge Executive SummaryThe centralized insufficient-credits formatting works end to end, but the broad Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (7 files)
Reviewed by kimi-k3 · Input: 58.5K · Output: 4.4K · Cached: 266.4K Review guidance: REVIEW.md from base branch |
…essage Add AUTO_FIX_INSUFFICIENT_CREDITS_MESSAGE next to the cloud-agent-next billing-error helpers so the web app and auto-fix-infra can share one source of truth for the user-facing copy. Addresses review feedback on #5077.
Import AUTO_FIX_INSUFFICIENT_CREDITS_MESSAGE from @kilocode/worker-utils in the web formatter (re-exported for existing consumers) and in auto-fix-infra, replacing the byte-identical local copies that could drift apart. Addresses review feedback on #5077.
The substring matched non-billing failures (e.g. version requirements), mislabeling them as insufficient-credits errors. The known 402 payloads are already caught by 'insufficient credits' and 'payment_required'. Addresses review feedback on #5077.
The formatted credits message replaced the original tRPC envelope for billing failures, making production diagnosis harder. Log the raw errorMessage; the formatted message stays on user-facing surfaces. Addresses review feedback on #5077.
Balance-check failures describe a failed verification call, not a
confirmed low balance. Merging them into the insufficient-credits branch
asserted the wrong diagnosis and remediation. Restore the pre-existing
hedged copy ('the account balance check failed' / 'Confirm your Kilo
account has available credits, then retry').
Addresses review feedback on #5077.
Centralize auto-fix error formatting so web and auto-fix-infra share one user-facing insufficient-credits message, while keeping raw billing payloads in server logs. Keep balance-check failures on their own hedged copy instead of treating them as confirmed low-balance errors, and drop the overly broad 'minimum required' matcher that mislabeled non-billing failures. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
1f0f69d to
2cac687
Compare
Route review-comment billing replies through isAutoFixBillingErrorMessage so they pick up the same patterns as formatAutoFixErrorMessage. Log the raw status-route error payload before formatting, matching pr-callback.
Summary
initiateFromKilocodeSessionV2tRPC envelope.