feat: surface codex runtime status
This commit is contained in:
@@ -1014,6 +1014,61 @@ public class ProjectDetailActivityUiTest {
|
||||
assertFalse(viewTreeContainsText(messageView, "v=0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void executionProgressMessageRendersCodexRuntimeStatusSections() throws Exception {
|
||||
Intent intent = new Intent()
|
||||
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_ID, "thread-runtime")
|
||||
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_NAME, "Boss开发主线程");
|
||||
TestProjectDetailActivity activity = Robolectric
|
||||
.buildActivity(TestProjectDetailActivity.class, intent)
|
||||
.setup()
|
||||
.get();
|
||||
|
||||
JSONObject message = new JSONObject()
|
||||
.put("id", "progress-runtime-1")
|
||||
.put("sender", "master")
|
||||
.put("senderLabel", "主 Agent")
|
||||
.put("body", "执行进度")
|
||||
.put("kind", "execution_progress")
|
||||
.put("sentAt", "2026-05-31T10:25:00+08:00")
|
||||
.put("executionProgress", new JSONObject()
|
||||
.put("status", "running")
|
||||
.put("steps", new JSONArray()
|
||||
.put(new JSONObject().put("text", "同步 Codex 运行状态").put("status", "running")))
|
||||
.put("modelRoute", new JSONObject()
|
||||
.put("fromModel", "gpt-5.4-mini")
|
||||
.put("toModel", "gpt-5.4")
|
||||
.put("reason", "highRiskCyberActivity"))
|
||||
.put("tokenUsage", new JSONObject()
|
||||
.put("totalTokens", 3000)
|
||||
.put("modelContextWindow", 200000)
|
||||
.put("contextPercent", 2))
|
||||
.put("mcpServers", new JSONArray()
|
||||
.put(new JSONObject()
|
||||
.put("name", "github")
|
||||
.put("status", "failed")
|
||||
.put("error", "token=[redacted] failed to start")))
|
||||
.put("remoteControl", new JSONObject()
|
||||
.put("status", "connected")
|
||||
.put("serverName", "Mac Studio")
|
||||
.put("environmentId", "env-prod")));
|
||||
|
||||
View messageView = ReflectionHelpers.callInstanceMethod(
|
||||
activity,
|
||||
"buildMessageView",
|
||||
ReflectionHelpers.ClassParameter.from(JSONObject.class, message)
|
||||
);
|
||||
|
||||
assertTrue(viewTreeContainsText(messageView, "运行状态"));
|
||||
assertTrue(viewTreeContainsText(messageView, "模型 gpt-5.4-mini → gpt-5.4"));
|
||||
assertTrue(viewTreeContainsText(messageView, "上下文 3,000 / 200,000 · 2%"));
|
||||
assertTrue(viewTreeContainsText(messageView, "MCP github · failed"));
|
||||
assertTrue(viewTreeContainsText(messageView, "token=[redacted] failed to start"));
|
||||
assertTrue(viewTreeContainsText(messageView, "远控 connected · Mac Studio"));
|
||||
assertFalse(viewTreeContainsText(messageView, "install-secret"));
|
||||
assertFalse(viewTreeContainsText(messageView, "sk-secret"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nativeRemoteExecutionProgressDoesNotRenderCodexSections() throws Exception {
|
||||
Intent intent = new Intent()
|
||||
|
||||
Reference in New Issue
Block a user