feat: surface codex account runtime notices
This commit is contained in:
@@ -1437,6 +1437,65 @@ public final class BossUi {
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject accountStatus = progress == null ? null : progress.optJSONObject("accountStatus");
|
||||
JSONObject modelVerification = progress == null ? null : progress.optJSONObject("modelVerification");
|
||||
JSONArray verifications = modelVerification == null ? null : modelVerification.optJSONArray("verifications");
|
||||
boolean hasAccountStatus = accountStatus != null ||
|
||||
(verifications != null && verifications.length() > 0);
|
||||
if (hasAccountStatus) {
|
||||
card.addView(divider(context));
|
||||
card.addView(sectionTitle(context, "账号状态"));
|
||||
if (accountStatus != null) {
|
||||
String authMode = accountStatus.optString("authMode", "").trim();
|
||||
String planType = accountStatus.optString("planType", "").trim();
|
||||
if (!TextUtils.isEmpty(authMode) || !TextUtils.isEmpty(planType)) {
|
||||
String label = !TextUtils.isEmpty(authMode) && !TextUtils.isEmpty(planType)
|
||||
? "认证 " + authMode + " · " + planType
|
||||
: !TextUtils.isEmpty(authMode) ? "认证 " + authMode : "套餐 " + planType;
|
||||
card.addView(detailRow(context, "◇", label, "", false));
|
||||
}
|
||||
String limitName = accountStatus.optString("limitName", "").trim();
|
||||
int usedPercent = accountStatus.optInt("usedPercent", -1);
|
||||
if (!TextUtils.isEmpty(limitName) || usedPercent >= 0) {
|
||||
String label = "额度";
|
||||
if (!TextUtils.isEmpty(limitName)) {
|
||||
label += " " + limitName;
|
||||
}
|
||||
if (usedPercent >= 0) {
|
||||
label += " · " + usedPercent + "%";
|
||||
}
|
||||
card.addView(detailRow(context, "◷", label, "", false));
|
||||
}
|
||||
int windowDurationMins = accountStatus.optInt("windowDurationMins", 0);
|
||||
if (windowDurationMins > 0) {
|
||||
card.addView(detailRow(context, "", "窗口 " + windowDurationMins + " 分钟", "", false, true));
|
||||
}
|
||||
String creditsBalance = accountStatus.optString("creditsBalance", "").trim();
|
||||
if (!TextUtils.isEmpty(creditsBalance)) {
|
||||
card.addView(detailRow(context, "", "余额 " + creditsBalance, "", false, true));
|
||||
}
|
||||
}
|
||||
if (verifications != null && verifications.length() > 0) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < verifications.length(); i += 1) {
|
||||
String verification = verifications.optString(i, "").trim();
|
||||
if (TextUtils.isEmpty(verification)) {
|
||||
continue;
|
||||
}
|
||||
if (builder.length() > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(verification);
|
||||
if (builder.length() > 120) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (builder.length() > 0) {
|
||||
card.addView(detailRow(context, "◇", "模型校验 " + builder, "", false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject modelRoute = progress == null ? null : progress.optJSONObject("modelRoute");
|
||||
JSONObject tokenUsage = progress == null ? null : progress.optJSONObject("tokenUsage");
|
||||
JSONArray mcpServers = progress == null ? null : progress.optJSONArray("mcpServers");
|
||||
|
||||
Reference in New Issue
Block a user