mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-06 14:33:11 +08:00
refactor: finish the microagent→skill rename in the frontend (#16672)
This commit is contained in:
@@ -78,14 +78,12 @@ async function assertActivatedSkills(
|
||||
|
||||
const diag = items.map((item: unknown) => {
|
||||
const e = item as Record<string, unknown>;
|
||||
return `${String(e.source)}:${String(e.event_type)}(skills=${JSON.stringify(e.activated_skills ?? e.activated_microagents ?? [])})`;
|
||||
return `${String(e.source)}:${String(e.event_type)}(skills=${JSON.stringify(e.activated_skills ?? [])})`;
|
||||
});
|
||||
|
||||
const found = items.some((item: unknown) => {
|
||||
const e = item as Record<string, unknown>;
|
||||
const skills =
|
||||
(e.activated_skills as string[] | undefined) ??
|
||||
(e.activated_microagents as string[] | undefined);
|
||||
const skills = e.activated_skills as string[] | undefined;
|
||||
return Array.isArray(skills) && skills.length > 0;
|
||||
});
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ function createCriticEvents(): CriticEvent[] {
|
||||
role: "user",
|
||||
content: [{ type: "text", text: "Please do the task." }],
|
||||
},
|
||||
activated_microagents: [],
|
||||
activated_skills: [],
|
||||
extended_content: [],
|
||||
},
|
||||
{
|
||||
@@ -174,7 +174,7 @@ function createCriticEvents(): CriticEvent[] {
|
||||
},
|
||||
],
|
||||
},
|
||||
activated_microagents: [],
|
||||
activated_skills: [],
|
||||
extended_content: [],
|
||||
critic_result: buildCriticResult(0.82, "critic-agent-message"),
|
||||
},
|
||||
|
||||
@@ -236,9 +236,7 @@ test.describe("skill loading: project, user, and deletion", () => {
|
||||
const body = (await resp.json()) as { items?: unknown[] };
|
||||
for (const item of body.items ?? []) {
|
||||
const e = item as Record<string, unknown>;
|
||||
const skills =
|
||||
(e.activated_skills as string[] | undefined) ??
|
||||
(e.activated_microagents as string[] | undefined);
|
||||
const skills = e.activated_skills as string[] | undefined;
|
||||
if (skills?.includes(PROJECT_SKILL_NAME)) return "FOUND";
|
||||
}
|
||||
return "NOT_FOUND";
|
||||
@@ -306,9 +304,7 @@ test.describe("skill loading: project, user, and deletion", () => {
|
||||
const body = (await resp.json()) as { items?: unknown[] };
|
||||
for (const item of body.items ?? []) {
|
||||
const e = item as Record<string, unknown>;
|
||||
const skills =
|
||||
(e.activated_skills as string[] | undefined) ??
|
||||
(e.activated_microagents as string[] | undefined);
|
||||
const skills = e.activated_skills as string[] | undefined;
|
||||
if (skills?.includes(USER_SKILL_NAME)) return "FOUND";
|
||||
}
|
||||
return "NOT_FOUND";
|
||||
@@ -381,9 +377,7 @@ test.describe("skill loading: project, user, and deletion", () => {
|
||||
|
||||
for (const item of items) {
|
||||
const e = item as Record<string, unknown>;
|
||||
const skills =
|
||||
(e.activated_skills as string[] | undefined) ??
|
||||
(e.activated_microagents as string[] | undefined);
|
||||
const skills = e.activated_skills as string[] | undefined;
|
||||
if (skills?.includes(USER_SKILL_NAME))
|
||||
return `UNEXPECTEDLY_FOUND`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user