



















@@ -1,6 +1,5 @@
11import { afterEach, describe, expect, it, vi } from "vitest";
22import {
3-CodexComputerUseSetupError,
43ensureCodexComputerUse,
54installCodexComputerUse,
65readCodexComputerUseStatus,
@@ -19,6 +18,7 @@ describe("Codex Computer Use setup", () => {
1918expect.objectContaining({
2019enabled: false,
2120ready: false,
21+reason: "disabled",
2222message: "Computer Use is disabled.",
2323}),
2424);
@@ -36,6 +36,7 @@ describe("Codex Computer Use setup", () => {
3636expect.objectContaining({
3737enabled: true,
3838ready: true,
39+reason: "ready",
3940installed: true,
4041pluginEnabled: true,
4142mcpServerAvailable: true,
@@ -63,6 +64,7 @@ describe("Codex Computer Use setup", () => {
6364).resolves.toEqual(
6465expect.objectContaining({
6566ready: false,
67+reason: "plugin_disabled",
6668installed: true,
6769pluginEnabled: false,
6870mcpServerAvailable: false,
@@ -89,6 +91,7 @@ describe("Codex Computer Use setup", () => {
8991).resolves.toEqual(
9092expect.objectContaining({
9193ready: true,
94+reason: "ready",
9295message: "Computer Use is ready.",
9396}),
9497);
@@ -110,6 +113,7 @@ describe("Codex Computer Use setup", () => {
110113).resolves.toEqual(
111114expect.objectContaining({
112115ready: false,
116+reason: "marketplace_missing",
113117message:
114118"Multiple Codex marketplaces contain computer-use. Configure computerUse.marketplaceName or computerUse.marketplacePath to choose one.",
115119}),
@@ -132,6 +136,7 @@ describe("Codex Computer Use setup", () => {
132136).resolves.toEqual(
133137expect.objectContaining({
134138ready: true,
139+reason: "ready",
135140installed: true,
136141pluginEnabled: true,
137142tools: ["list_apps"],
@@ -161,6 +166,7 @@ describe("Codex Computer Use setup", () => {
161166).resolves.toEqual(
162167expect.objectContaining({
163168ready: true,
169+reason: "ready",
164170installed: true,
165171pluginEnabled: true,
166172message: "Computer Use is ready.",
@@ -180,7 +186,11 @@ describe("Codex Computer Use setup", () => {
180186pluginConfig: { computerUse: { enabled: true, marketplaceName: "desktop-tools" } },
181187 request,
182188}),
183-).rejects.toThrow(CodexComputerUseSetupError);
189+).rejects.toMatchObject({
190+status: expect.objectContaining({
191+reason: "plugin_not_installed",
192+}),
193+});
184194expect(request).not.toHaveBeenCalledWith("plugin/install", expect.anything());
185195});
186196@@ -201,6 +211,7 @@ describe("Codex Computer Use setup", () => {
201211).resolves.toEqual(
202212expect.objectContaining({
203213ready: true,
214+reason: "ready",
204215message: "Computer Use is ready.",
205216}),
206217);
@@ -228,6 +239,7 @@ describe("Codex Computer Use setup", () => {
228239).resolves.toEqual(
229240expect.objectContaining({
230241ready: true,
242+reason: "ready",
231243message: "Computer Use is ready.",
232244}),
233245);
@@ -255,7 +267,11 @@ describe("Codex Computer Use setup", () => {
255267},
256268 request,
257269}),
258-).rejects.toThrow(CodexComputerUseSetupError);
270+).rejects.toMatchObject({
271+status: expect.objectContaining({
272+reason: "auto_install_blocked",
273+}),
274+});
259275expect(request).not.toHaveBeenCalledWith("marketplace/add", expect.anything());
260276expect(request).not.toHaveBeenCalledWith("plugin/install", expect.anything());
261277});
@@ -276,6 +292,7 @@ describe("Codex Computer Use setup", () => {
276292).resolves.toEqual(
277293expect.objectContaining({
278294ready: false,
295+reason: "marketplace_missing",
279296message:
280297"Configured Codex marketplace missing-marketplace was not found or does not contain computer-use. Run /codex computer-use install with a source or path to install from a new marketplace.",
281298}),
@@ -294,6 +311,7 @@ describe("Codex Computer Use setup", () => {
294311).rejects.toMatchObject({
295312status: expect.objectContaining({
296313ready: false,
314+reason: "remote_install_unsupported",
297315installed: false,
298316pluginEnabled: false,
299317marketplaceName: "openai-curated",
@@ -320,6 +338,7 @@ describe("Codex Computer Use setup", () => {
320338await expect(installed).resolves.toEqual(
321339expect.objectContaining({
322340ready: true,
341+reason: "ready",
323342message: "Computer Use is ready.",
324343}),
325344);
@@ -343,6 +362,7 @@ describe("Codex Computer Use setup", () => {
343362).resolves.toEqual(
344363expect.objectContaining({
345364ready: true,
365+reason: "ready",
346366marketplaceName: "openai-curated",
347367}),
348368);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。