Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "^0.22.1",
"@openai/codex": "^0.128.0",
"@openai/codex": "^0.137.0",
"diff": "^8.0.3",
"open": "^11.0.0",
"vscode-jsonrpc": "^8.2.1"
Expand Down
16 changes: 8 additions & 8 deletions src/CodexAcpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class CodexAcpClient {
sessionId: request.sessionId,
currentModelId: currentModelId,
models: codexModels,
currentServiceTier: response.serviceTier ?? null,
currentServiceTier: response.serviceTier as ServiceTier ?? null,
}
}

Expand All @@ -235,7 +235,7 @@ export class CodexAcpClient {
sessionId: request.sessionId,
currentModelId: currentModelId,
models: codexModels,
currentServiceTier: response.serviceTier ?? null,
currentServiceTier: response.serviceTier as ServiceTier ?? null,
thread: response.thread,
};
}
Expand All @@ -258,7 +258,7 @@ export class CodexAcpClient {
sessionId: response.thread.id,
currentModelId: currentModelId,
models: codexModels,
currentServiceTier: response.serviceTier ?? null,
currentServiceTier: response.serviceTier as ServiceTier ?? null,
};
}

Expand Down Expand Up @@ -332,14 +332,14 @@ export class CodexAcpClient {
if (!cwd) {
return;
}
const additionalRoots = readAdditionalRoots(meta);

const additionalRoots = readAdditionalRoots(meta).map(root => path.join(root, ".agents", "skills"));
if (additionalRoots.length > 0) {
await this.codexClient.skillsExtraRootsSet({ extraRoots: additionalRoots });
}
await this.codexClient.listSkills({
cwds: [cwd],
forceReload: true,
perCwdExtraUserRoots: [{
cwd: cwd,
extraUserRoots: additionalRoots
}]
});
}

Expand Down
6 changes: 6 additions & 0 deletions src/CodexAppServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
McpServerStatusUpdatedNotification,
ModelListParams,
ModelListResponse,
SkillsExtraRootsSetParams,
SkillsListParams,
SkillsListResponse,
ThreadLoadedListParams,
Expand Down Expand Up @@ -302,6 +303,7 @@ export class CodexAppServerClient {
turn: {
id: turnId,
items: [],
itemsView: "notLoaded",
status: "interrupted",
error: null,
startedAt: null,
Expand All @@ -315,6 +317,10 @@ export class CodexAppServerClient {
return await this.sendRequest({ method: "model/list", params });
}

async skillsExtraRootsSet(params: SkillsExtraRootsSetParams): Promise<void> {
return await this.sendRequest({ method: "skills/extraRoots/set", params });
}

async listSkills(params: SkillsListParams): Promise<SkillsListResponse> {
return await this.sendRequest({ method: "skills/list", params });
}
Expand Down
3 changes: 3 additions & 0 deletions src/CodexEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export class CodexEventHandler {
case "thread/goal/cleared":
case "remoteControl/status/changed":
case "app/list/updated":
case "thread/settings/updated":
case "process/outputDelta":
case "process/exited":
return null;
}
}
Expand Down
28 changes: 19 additions & 9 deletions src/__tests__/CodexACPAgent/CodexAcpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ describe('ACP server test', { timeout: 40_000 }, () => {
inputModalities: ["text"],
supportsPersonality: false,
additionalSpeedTiers: [],
serviceTiers: [],
defaultServiceTier: null,
isDefault: true
}],
nextCursor: null
Expand All @@ -262,10 +264,6 @@ describe('ACP server test', { timeout: 40_000 }, () => {
expect(listSkillsSpy).toHaveBeenCalledWith({
cwds: ["/workspace"],
forceReload: true,
perCwdExtraUserRoots: [{
cwd: "/workspace",
extraUserRoots: ["/skills/one", "/skills/two"]
}]
});
expect(listSkillsSpy.mock.invocationCallOrder[0]!).toBeLessThan(threadStartSpy.mock.invocationCallOrder[0]!);
});
Expand Down Expand Up @@ -450,10 +448,6 @@ describe('ACP server test', { timeout: 40_000 }, () => {
expect(listSkillsSpy).toHaveBeenCalledWith({
cwds: ["/workspace"],
forceReload: true,
perCwdExtraUserRoots: [{
cwd: "/workspace",
extraUserRoots: ["/skills/one", "/skills/two"]
}]
});
expect(listSkillsSpy.mock.invocationCallOrder[0]!).toBeLessThan(turnStartSpy.mock.invocationCallOrder[0]!);
});
Expand All @@ -477,6 +471,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
return {
id,
items: [],
itemsView: "notLoaded" as const,
status,
error: null,
startedAt: null,
Expand Down Expand Up @@ -718,6 +713,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
turn: {
id: "turn-id",
items: [],
itemsView: "notLoaded",
status: "completed",
error: null,
startedAt: null,
Expand Down Expand Up @@ -750,7 +746,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {

await expect(
fixture.getCodexAcpAgent().resumeSession({cwd: "", sessionId: sessionId})
).rejects.toThrow("invalid thread id");
).rejects.toThrow("invalid session id");
});

it('should return available builtin commands', async () => {
Expand Down Expand Up @@ -867,13 +863,15 @@ describe('ACP server test', { timeout: 40_000 }, () => {
data: [
{
name: "fs",
serverInfo: null,
tools: {listFiles: {name: "listFiles", inputSchema: {type: "object"}}},
resources: [{name: "workspace", uri: "file:///workspace"}],
resourceTemplates: [],
authStatus: "bearerToken"
},
{
name: "browser",
serverInfo: null,
tools: {},
resources: [],
resourceTemplates: [],
Expand Down Expand Up @@ -931,6 +929,8 @@ describe('ACP server test', { timeout: 40_000 }, () => {
defaultReasoningEffort: 'medium',
supportsPersonality: false,
additionalSpeedTiers: [],
serviceTiers: [],
defaultServiceTier: null,
isDefault: false,
inputModalities: []
},
Expand All @@ -949,6 +949,8 @@ describe('ACP server test', { timeout: 40_000 }, () => {
defaultReasoningEffort: 'low',
supportsPersonality: false,
additionalSpeedTiers: [],
serviceTiers: [],
defaultServiceTier: null,
isDefault: true,
inputModalities: []
}
Expand All @@ -975,6 +977,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
turn: {
id: "turn-id",
items: [],
itemsView: "notLoaded",
status: "inProgress",
error: null,
startedAt: null,
Expand All @@ -987,6 +990,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
turn: {
id: "turn-id",
items: [],
itemsView: "notLoaded",
status: "completed",
error: null,
startedAt: null,
Expand Down Expand Up @@ -1086,6 +1090,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 25, resetsAt: null, windowDurationMins: 60 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand All @@ -1099,6 +1104,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 80, resetsAt: null, windowDurationMins: 1440 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand Down Expand Up @@ -1152,6 +1158,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 30, resetsAt: null, windowDurationMins: 60 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand All @@ -1167,6 +1174,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 50, resetsAt: null, windowDurationMins: 1440 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand All @@ -1185,6 +1193,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 30, resetsAt: null, windowDurationMins: 60 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand All @@ -1198,6 +1207,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
primary: { usedPercent: 50, resetsAt: null, windowDurationMins: 1440 },
secondary: null,
credits: null,
individualLimit: null,
planType: null,
rateLimitReachedType: null,
}
Expand Down
Loading
Loading