feat(web): 工作台 - 优化 Agent 工作区与技能库

This commit is contained in:
ddcat666
2026-09-27 08:21:08 +08:00
parent b4111a8721
commit 5df5e09c63
22 changed files with 1681 additions and 196 deletions

View File

@@ -43,6 +43,19 @@ describe("backend API request error semantics", () => {
expect(thrown).toMatchObject({ status: 502, message: "后端服务暂时不可用,请稍后重试", retryable: true });
});
test("marks transport failures without an HTTP response as retryable", async () => {
const axiosError = {
isAxiosError: true,
code: "ERR_NETWORK",
message: "Network Error",
};
const thrown = await request(Promise.reject(axiosError)).catch((error) => error);
expect(thrown).toBeInstanceOf(ApiError);
expect(thrown).toMatchObject({ message: "Network Error", retryable: true });
expect(thrown.cause).toBe(axiosError);
});
test("http.get unwraps the same backend envelope", async () => {
const original = apiClient.request;
apiClient.request = (async () => ({