feat: surface codex tool activity progress
This commit is contained in:
@@ -1598,6 +1598,47 @@ public final class BossUi {
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray toolActivities = progress == null ? null : progress.optJSONArray("toolActivities");
|
||||
if (toolActivities != null && toolActivities.length() > 0) {
|
||||
card.addView(divider(context));
|
||||
card.addView(sectionTitle(context, "工具活动"));
|
||||
int shown = 0;
|
||||
for (int i = 0; i < toolActivities.length(); i += 1) {
|
||||
JSONObject activity = toolActivities.optJSONObject(i);
|
||||
String kind = activity == null ? "" : activity.optString("kind", "").trim();
|
||||
String name = activity == null ? "" : activity.optString("name", "").trim();
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
continue;
|
||||
}
|
||||
String status = activity.optString("status", "").trim();
|
||||
String detail = activity.optString("detail", "").trim();
|
||||
String label;
|
||||
if ("mcp".equals(kind)) {
|
||||
label = "MCP " + name;
|
||||
} else if ("dynamic".equals(kind)) {
|
||||
label = "动态工具 " + name;
|
||||
} else if ("web_search".equals(kind)) {
|
||||
label = "搜索 " + name;
|
||||
} else if ("image_view".equals(kind)) {
|
||||
label = "图片 " + name;
|
||||
} else if ("review".equals(kind)) {
|
||||
label = "Review " + name;
|
||||
} else if ("command".equals(kind)) {
|
||||
label = "命令 " + name;
|
||||
} else {
|
||||
label = "工具 " + name;
|
||||
}
|
||||
if (!TextUtils.isEmpty(status)) {
|
||||
label += " · " + status;
|
||||
}
|
||||
card.addView(detailRow(context, "◇", label, detail, "failed".equals(status)));
|
||||
shown += 1;
|
||||
if (shown >= 6) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray warnings = progress == null ? null : progress.optJSONArray("warnings");
|
||||
if (warnings != null && warnings.length() > 0) {
|
||||
card.addView(divider(context));
|
||||
|
||||
Reference in New Issue
Block a user