Merged
Conversation
问题: - Packy API 返回的积分单位被错误地当作 cents 处理(÷100) - 导致显示的金额比实际高约 5000 倍(如显示 $2395 实际是 $0.48) - remaining 计算错误:total_available 已经是剩余额度,不应再减 total_used 修复: - 使用正确的转换因子:500000 积分 = 1 美元 - 修正 remaining_tokens 直接使用 total_available - 统一转换为 cents 单位,与 88code 显示层兼容 修复后效果: - 修复前:packy $2395.75/$5000 剩$208.50 - 修复后:packy $0.48/$1 ▓▓▓▓▓░░░░░ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
remaining_tokens计算逻辑(total_available已经是剩余额度)问题描述
Packy API 返回的数据结构:
{ "total_granted": 500000, // 套餐总额度(积分) "total_used": 239575, // 已使用(积分) "total_available": 260425 // 剩余可用(积分) }原代码将这些值除以 100(假设是 cents),导致:
$2395.75/$5000 剩$208.50$0.48/$1.00 剩$0.52修复内容
total_available本身就是剩余额度,不需要再减total_used修复效果
Test plan
🤖 Generated with Claude Code