feat: add master-agent takeover controls
This commit is contained in:
@@ -53,10 +53,11 @@ public class ConversationInfoActivityTest {
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(1), "线程状态摘要"));
|
||||
assertTrue(viewTreeContainsTextFragment(content.getChildAt(1), "当前进度:已经记录最近 2 条进展"));
|
||||
assertTrue(viewTreeContainsTextFragment(content.getChildAt(1), "建议下一步:继续同步 Android 只读页"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(2), "发起群聊"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(2), "选择其他线程加入新群"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(3), "线程详情"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(3), "查看当前线程聊天与项目"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(2), "主 Agent 协同接管"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(3), "发起群聊"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(3), "选择其他线程加入新群"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(4), "线程详情"));
|
||||
assertTrue(viewTreeContainsText(content.getChildAt(4), "查看当前线程聊天与项目"));
|
||||
assertTrue(viewTreeContainsText(content, "参与线程"));
|
||||
assertTrue(viewTreeContainsText(content, "硬件审计协作"));
|
||||
assertFalse(viewTreeContainsText(content, "从当前会话选择其他线程,创建新的独立群聊"));
|
||||
@@ -173,7 +174,11 @@ public class ConversationInfoActivityTest {
|
||||
.put("isGroup", false)
|
||||
.put("deviceIds", new JSONArray().put("mac-studio").put("macbook"))
|
||||
.put("threadMeta", threadMeta);
|
||||
return new JSONObject().put("project", project);
|
||||
return new JSONObject()
|
||||
.put("project", project)
|
||||
.put("agentControls", new JSONObject()
|
||||
.put("effectiveTakeoverEnabled", true)
|
||||
.put("takeoverInheritedFromGlobal", true));
|
||||
}
|
||||
|
||||
private static JSONObject buildParticipantsPayload() throws Exception {
|
||||
|
||||
@@ -54,7 +54,8 @@ public class MasterAgentPromptActivityTest {
|
||||
.put("userPrompt", new JSONObject().put("content", "用户私有主提示词"))
|
||||
.put("projectControls", new JSONObject()
|
||||
.put("promptOverride", "当前对话提示词")
|
||||
.put("backendOverride", "claw-runtime"));
|
||||
.put("backendOverride", "claw-runtime")
|
||||
.put("globalTakeoverEnabled", true));
|
||||
|
||||
ReflectionHelpers.callInstanceMethod(
|
||||
activity,
|
||||
@@ -68,6 +69,7 @@ public class MasterAgentPromptActivityTest {
|
||||
assertTrue(viewTreeContainsText(content, "用户私有主提示词"));
|
||||
assertTrue(viewTreeContainsText(content, "当前对话提示词"));
|
||||
assertTrue(viewTreeContainsText(content, "执行后端"));
|
||||
assertTrue(viewTreeContainsText(content, "全局主 Agent 协同接管"));
|
||||
assertTrue(viewTreeContainsText(content, "合成预览"));
|
||||
}
|
||||
|
||||
@@ -283,6 +285,18 @@ public class MasterAgentPromptActivityTest {
|
||||
void rememberIdentity(JSONObject json) {
|
||||
// JVM 单测不需要落 Android 侧身份缓存。
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse updateProjectTakeoverSettings(String projectId, Boolean takeoverEnabled, Boolean globalTakeoverEnabled) {
|
||||
try {
|
||||
return new ApiResponse(
|
||||
200,
|
||||
new JSONObject().put("ok", true)
|
||||
);
|
||||
} catch (Exception error) {
|
||||
throw new IllegalStateException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final class InMemorySharedPreferences implements android.content.SharedPreferences {
|
||||
|
||||
Reference in New Issue
Block a user