Skip to content

Commit 9a21885

Browse files
test: remove marketplace extMethod, simplify test
1 parent 8d6b760 commit 9a21885

4 files changed

Lines changed: 0 additions & 63 deletions

File tree

src/AcpExtensions.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
export type ExtMethodRequest =
22
| AuthenticationStatusRequest
33
| AuthenticationLogoutRequest
4-
| MarketplaceListRequest
5-
| MarketplaceRemoveRequest
64

75
export function isExtMethodRequest(request: { method: string, params: Record<string, unknown> }): request is ExtMethodRequest {
86
return request.method === "authentication/status"
97
|| request.method === "authentication/logout"
10-
|| request.method === "marketplace/list"
11-
|| request.method === "marketplace/remove";
128
}
139

1410
export type AuthenticationStatusRequest = { method: "authentication/status", params: {} }
1511
export type AuthenticationStatusResponse = { type: "api-key" } | { type: "chat-gpt", email: string } | { type: "gateway", name: string } | { type: "unauthenticated" }
1612

1713
export type AuthenticationLogoutRequest = { method: "authentication/logout", params: {} }
1814
export type AuthenticationLogoutResponse = {}
19-
20-
export type MarketplaceListRequest = { method: "marketplace/list", params: { cwd?: string } }
21-
export type MarketplaceListResponse = { marketplaces: Array<{ name: string }> }
22-
23-
export type MarketplaceRemoveRequest = { method: "marketplace/remove", params: { marketplaceName: string } }
24-
export type MarketplaceRemoveResponse = {}

src/CodexAcpServer.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,6 @@ export class CodexAcpServer implements acp.Agent {
147147
await this.unstable_logout({});
148148
return {};
149149
}
150-
case "marketplace/list": {
151-
const cwd = typeof methodRequest.params.cwd === "string" ? methodRequest.params.cwd : "";
152-
const marketplaces = await this.runWithProcessCheck(() =>
153-
this.codexAcpClient.listMarketplaces(cwd)
154-
);
155-
return {
156-
marketplaces: marketplaces.map((name) => ({name})),
157-
};
158-
}
159-
case "marketplace/remove": {
160-
await this.runWithProcessCheck(() => this.codexAcpClient.removeMarketplace(methodRequest.params.marketplaceName));
161-
return {};
162-
}
163150
}
164151
}
165152

src/__tests__/CodexACPAgent/e2e/acp-e2e.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from "./acp-e2e-test-utils";
1313

1414
const HELLO_WORLD_ADDITIONAL_ROOT_NAME = "hello-world";
15-
const HELLO_WORLD_MARKETPLACE_NAME = "additional-roots-hello-world";
1615
const HELLO_WORLD_SKILL = {
1716
name: "hello",
1817
description: "Use when the user asks for a hello world skill.",
@@ -137,20 +136,6 @@ describeE2E("E2E tests", () => {
137136
});
138137
});
139138

140-
it("removes an additional root marketplace", async () => {
141-
fixture = await createAuthenticatedFixture();
142-
const additionalRoot = await prepareHelloWorldAdditionalRoot(fixture);
143-
await fixture.createSession({
144-
additionalDirectories: [additionalRoot],
145-
});
146-
147-
expect(await fixture.hasMarketplace(HELLO_WORLD_MARKETPLACE_NAME)).toBe(true);
148-
149-
await fixture.removeMarketplace(HELLO_WORLD_MARKETPLACE_NAME);
150-
151-
expect(await fixture.hasMarketplace(HELLO_WORLD_MARKETPLACE_NAME)).toBe(false);
152-
});
153-
154139
it("lists a skill from additionalDirectories", async () => {
155140
fixture = await createAuthenticatedFixture();
156141
const additionalRoot = await prepareHelloWorldAdditionalRoot(fixture);
@@ -177,7 +162,6 @@ describeE2E("E2E tests", () => {
177162
async function prepareHelloWorldAdditionalRoot(fixture: SpawnedAgentFixture): Promise<string> {
178163
const additionalRoot = path.join(fixture.workspaceDir, "..", "additional-roots", HELLO_WORLD_ADDITIONAL_ROOT_NAME);
179164
fixture.writeSkill(HELLO_WORLD_SKILL, path.join(additionalRoot, ".agents", "skills"));
180-
await fixture.removeMarketplace(HELLO_WORLD_MARKETPLACE_NAME);
181165
return additionalRoot;
182166
}
183167

src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export interface SpawnedAgentFixture {
2828
readonly connection: acp.ClientSideConnection;
2929
readonly workspaceDir: string;
3030
createSession(options?: CreateSessionOptions): Promise<acp.NewSessionResponse>;
31-
hasMarketplace(marketplaceName: string): Promise<boolean>;
32-
removeMarketplace(marketplaceName: string): Promise<void>;
3331
restart(): Promise<SpawnedAgentFixture>;
3432
writeSkill(skill: TestSkill, rootDir?: string): void;
3533
setPermissionResponder(responder: PermissionResponder): void;
@@ -185,24 +183,6 @@ class SpawnedAgentFixtureImpl implements SpawnedAgentFixture {
185183
});
186184
}
187185

188-
async hasMarketplace(marketplaceName: string): Promise<boolean> {
189-
const response = await this.connection.extMethod("marketplace/list", {
190-
cwd: this.workspaceDir,
191-
marketplaceKinds: ["local", "workspace-directory"],
192-
});
193-
const marketplaces = response["marketplaces"];
194-
if (!Array.isArray(marketplaces)) {
195-
return false;
196-
}
197-
return marketplaces.some((marketplace) =>
198-
isRecord(marketplace) && marketplace["name"] === marketplaceName
199-
);
200-
}
201-
202-
async removeMarketplace(marketplaceName: string): Promise<void> {
203-
await this.connection.extMethod("marketplace/remove", {marketplaceName});
204-
}
205-
206186
async restart(): Promise<SpawnedAgentFixture> {
207187
await this.stopProcess(false);
208188
return await createSpawnedAgentFixture(this.initializeConnection, this.extraEnv, this.mcpServers, this.paths, this.client);
@@ -315,10 +295,6 @@ function redactLogSecrets(content: string): string {
315295
.replace(/(Incorrect API key provided: )[^.,\s]+/g, "$1[REDACTED]");
316296
}
317297

318-
function isRecord(value: unknown): value is Record<string, unknown> {
319-
return typeof value === "object" && value !== null && !Array.isArray(value);
320-
}
321-
322298
async function waitForProcessExit(proc: ChildProcessWithoutNullStreams, timeoutMs: number): Promise<boolean> {
323299
if (proc.exitCode !== null || proc.signalCode !== null) {
324300
return true;

0 commit comments

Comments
 (0)