Skip to content

Commit b93225f

Browse files
Update codex to 0.142.0 (#217)
* Update codex to 0.142.0 * Fix types and tests after Codex update --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b099aba commit b93225f

51 files changed

Lines changed: 258 additions & 66 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"dependencies": {
6464
"@agentclientprotocol/sdk": "^0.28.1",
65-
"@openai/codex": "^0.141.0",
65+
"@openai/codex": "^0.142.0",
6666
"diff": "^8.0.3",
6767
"open": "^11.0.0",
6868
"vscode-jsonrpc": "^8.2.1",

src/CodexAcpClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class CodexAcpClient {
162162
case "chatgpt":
163163
return {
164164
type: "chat-gpt",
165-
email: account.email,
165+
email: account.email ?? "",
166166
};
167167
case "amazonBedrock":
168168
return {
@@ -178,7 +178,7 @@ export class CodexAcpClient {
178178
return sessionModelProvider;
179179
}
180180
const settingsModelProvider = await this.codexClient.configRead({includeLayers: false});
181-
return settingsModelProvider.config.model_provider;
181+
return settingsModelProvider.config.model_provider ?? null;
182182
}
183183

184184
async logout(): Promise<void> {

src/CodexElicitationHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class CodexElicitationHandler implements ElicitationHandler {
144144
? buildToolApprovalOptions(parsePersistOptions(meta))
145145
: ELICITATION_OPTIONS;
146146

147-
if (params.mode === "form") {
147+
if (params.mode === "form" || params.mode === "openai/form") {
148148
const correlatedCallId = isToolApproval
149149
? this.popPendingApproval(params.threadId, params.serverName)
150150
: undefined;

src/CodexEventHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export class CodexEventHandler {
186186
case "mcpServer/startupStatus/updated":
187187
case "serverRequest/resolved":
188188
case "model/verification":
189+
case "model/safetyBuffering/updated":
189190
case "windows/worldWritableWarning":
190191
case "thread/realtime/started":
191192
case "thread/realtime/itemAdded":
@@ -207,6 +208,7 @@ export class CodexEventHandler {
207208
case "remoteControl/status/changed":
208209
case "app/list/updated":
209210
case "thread/settings/updated":
211+
case "externalAgentConfig/import/progress":
210212
case "process/outputDelta":
211213
case "process/exited":
212214
return null;

src/__tests__/CodexACPAgent/approval-events.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ describe('Approval Events', () => {
7373
itemId: `item-${optionId}`,
7474
reason: 'Test command',
7575
startedAtMs: 0,
76+
environmentId: null,
7677
proposedExecpolicyAmendment: null,
7778
};
7879

@@ -98,6 +99,7 @@ describe('Approval Events', () => {
9899
threadId: sessionId,
99100
turnId: 'turn-1',
100101
startedAtMs: 0,
102+
environmentId: null,
101103
itemId: 'item-cancelled',
102104
reason: null,
103105
proposedExecpolicyAmendment: null,
@@ -126,6 +128,7 @@ describe('Approval Events', () => {
126128
turnId: 'turn-1',
127129
itemId: 'item-execpolicy-amendment',
128130
startedAtMs: 0,
131+
environmentId: null,
129132
reason: 'Installing dependencies',
130133
command: 'npm install',
131134
cwd: '/home/user/project',
@@ -172,6 +175,7 @@ describe('Approval Events', () => {
172175
turnId: 'turn-1',
173176
itemId: 'item-network-policy-amendment',
174177
startedAtMs: 0,
178+
environmentId: null,
175179
reason: 'Needs network access',
176180
networkApprovalContext: { host: 'registry.npmjs.org', protocol: 'https' },
177181
proposedNetworkPolicyAmendments: [networkPolicyAmendment],
@@ -209,6 +213,7 @@ describe('Approval Events', () => {
209213
threadId: 'non-existent-session',
210214
turnId: 'turn-1',
211215
startedAtMs: 0,
216+
environmentId: null,
212217
itemId: 'item-no-handler',
213218
reason: null,
214219
proposedExecpolicyAmendment: null,
@@ -232,6 +237,7 @@ describe('Approval Events', () => {
232237
threadId: sessionId,
233238
turnId: 'turn-1',
234239
startedAtMs: 0,
240+
environmentId: null,
235241
itemId: 'item-snapshot',
236242
reason: 'Running npm install',
237243
proposedExecpolicyAmendment: null,
@@ -260,6 +266,7 @@ describe('Approval Events', () => {
260266
threadId: sessionId,
261267
turnId: 'turn-1',
262268
startedAtMs: 0,
269+
environmentId: null,
263270
itemId: 'item-with-command',
264271
reason: 'Installing dependencies',
265272
command: 'npm install',
@@ -298,6 +305,7 @@ describe('Approval Events', () => {
298305
threadId: sessionId,
299306
turnId: 'turn-1',
300307
startedAtMs: 0,
308+
environmentId: null,
301309
itemId: 'item-shell-prefix',
302310
reason: 'Installing dependencies',
303311
command,

src/__tests__/CodexACPAgent/command-action-events.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ describe('CodexEventHandler - command action events', () => {
290290
tool: "tool-name",
291291
status: "inProgress",
292292
arguments: { argument: "example"},
293+
appContext: null,
293294
pluginId: null,
294295
result: null,
295296
error: null,
@@ -320,6 +321,7 @@ describe('CodexEventHandler - command action events', () => {
320321
tool: "read_file",
321322
status: "inProgress",
322323
arguments: { file_path: ".ai/local.md", mode: "slice", start_line: 1, max_lines: 200 },
324+
appContext: null,
323325
pluginId: null,
324326
result: null,
325327
error: null,
@@ -349,6 +351,7 @@ describe('CodexEventHandler - command action events', () => {
349351
tool: "read_file",
350352
status: "failed",
351353
arguments: { file_path: ".ai/local.md", mode: "slice", start_line: 1, max_lines: 200 },
354+
appContext: null,
352355
pluginId: null,
353356
result: null,
354357
error: {
@@ -383,6 +386,7 @@ describe('CodexEventHandler - command action events', () => {
383386
tool: "tool-name",
384387
status: "inProgress",
385388
arguments: { argument: "example" },
389+
appContext: null,
386390
pluginId: null,
387391
result: null,
388392
error: null,
@@ -421,6 +425,7 @@ describe('CodexEventHandler - command action events', () => {
421425
tool: "tool-name",
422426
status: "failed",
423427
arguments: { argument: "example" },
428+
appContext: null,
424429
pluginId: null,
425430
result: null,
426431
error: {

src/__tests__/CodexACPAgent/data/approval-command-allow-once.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"threadId": "test-session-id",
4848
"turnId": "turn-1",
4949
"startedAtMs": 0,
50+
"environmentId": null,
5051
"itemId": "item-snapshot",
5152
"reason": "Running npm install",
5253
"proposedExecpolicyAmendment": null

src/__tests__/CodexACPAgent/data/approval-command-with-rawInput.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"threadId": "test-session-id",
5151
"turnId": "turn-1",
5252
"startedAtMs": 0,
53+
"environmentId": null,
5354
"itemId": "item-with-command",
5455
"reason": "Installing dependencies",
5556
"command": "npm install",

src/__tests__/CodexACPAgent/elicitation-events.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ describe('Elicitation Events', () => {
262262
tool: "tool-name",
263263
status: "inProgress",
264264
arguments: { argument: "example" },
265+
appContext: null,
265266
pluginId: null,
266267
result: null,
267268
error: null,
@@ -282,6 +283,7 @@ describe('Elicitation Events', () => {
282283
tool: "tool-name",
283284
status: "completed",
284285
arguments: { argument: "example" },
286+
appContext: null,
285287
pluginId: null,
286288
result: { content: [], structuredContent: null, _meta: null },
287289
error: null,
@@ -330,6 +332,7 @@ describe('Elicitation Events', () => {
330332
tool: "tool-name",
331333
status: "inProgress",
332334
arguments: { argument: "example" },
335+
appContext: null,
333336
pluginId: null,
334337
result: null,
335338
error: null,

0 commit comments

Comments
 (0)