feat: surface codex windows sandbox progress
This commit is contained in:
@@ -1525,8 +1525,9 @@ public final class BossUi {
|
||||
JSONObject tokenUsage = progress == null ? null : progress.optJSONObject("tokenUsage");
|
||||
JSONArray mcpServers = progress == null ? null : progress.optJSONArray("mcpServers");
|
||||
JSONObject remoteControl = progress == null ? null : progress.optJSONObject("remoteControl");
|
||||
JSONObject windowsSandbox = progress == null ? null : progress.optJSONObject("windowsSandbox");
|
||||
boolean hasRuntimeStatus = modelRoute != null || tokenUsage != null ||
|
||||
(mcpServers != null && mcpServers.length() > 0) || remoteControl != null;
|
||||
(mcpServers != null && mcpServers.length() > 0) || remoteControl != null || windowsSandbox != null;
|
||||
if (hasRuntimeStatus) {
|
||||
card.addView(divider(context));
|
||||
card.addView(sectionTitle(context, "运行状态"));
|
||||
@@ -1596,6 +1597,27 @@ public final class BossUi {
|
||||
));
|
||||
}
|
||||
}
|
||||
if (windowsSandbox != null) {
|
||||
String status = windowsSandbox.optString("status", "").trim();
|
||||
String setupMode = windowsSandbox.optString("setupMode", "").trim();
|
||||
String error = windowsSandbox.optString("error", "").trim();
|
||||
if (!TextUtils.isEmpty(status) || !TextUtils.isEmpty(setupMode)) {
|
||||
StringBuilder label = new StringBuilder("Windows 沙箱");
|
||||
if (!TextUtils.isEmpty(status)) {
|
||||
label.append(" ").append(status);
|
||||
}
|
||||
if (!TextUtils.isEmpty(setupMode)) {
|
||||
label.append(" · ").append(setupMode);
|
||||
}
|
||||
card.addView(detailRow(
|
||||
context,
|
||||
"⊞",
|
||||
label.toString(),
|
||||
error,
|
||||
"failed".equals(status)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray toolActivities = progress == null ? null : progress.optJSONArray("toolActivities");
|
||||
|
||||
@@ -1051,7 +1051,12 @@ public class ProjectDetailActivityUiTest {
|
||||
.put("remoteControl", new JSONObject()
|
||||
.put("status", "connected")
|
||||
.put("serverName", "Mac Studio")
|
||||
.put("environmentId", "env-prod")));
|
||||
.put("environmentId", "env-prod"))
|
||||
.put("windowsSandbox", new JSONObject()
|
||||
.put("status", "failed")
|
||||
.put("setupMode", "elevated")
|
||||
.put("error", "token=[redacted] failed")
|
||||
.put("sourcePath", "C:\\Users\\kris\\secret\\sandbox.log")));
|
||||
|
||||
View messageView = ReflectionHelpers.callInstanceMethod(
|
||||
activity,
|
||||
@@ -1065,8 +1070,11 @@ public class ProjectDetailActivityUiTest {
|
||||
assertTrue(viewTreeContainsText(messageView, "MCP github · failed"));
|
||||
assertTrue(viewTreeContainsText(messageView, "token=[redacted] failed to start"));
|
||||
assertTrue(viewTreeContainsText(messageView, "远控 connected · Mac Studio"));
|
||||
assertTrue(viewTreeContainsText(messageView, "Windows 沙箱 failed · elevated"));
|
||||
assertTrue(viewTreeContainsText(messageView, "token=[redacted] failed"));
|
||||
assertFalse(viewTreeContainsText(messageView, "install-secret"));
|
||||
assertFalse(viewTreeContainsText(messageView, "sk-secret"));
|
||||
assertFalse(viewTreeContainsText(messageView, "C:\\Users\\kris\\secret"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user