Skip to content

Commit 2024ea2

Browse files
Fix types and tests after Codex update
1 parent 3dd236f commit 2024ea2

6 files changed

Lines changed: 26 additions & 3 deletions

File tree

src/CodexAcpServer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ export class CodexAcpServer implements acp.Agent {
389389
switch (item.type) {
390390
case "userMessage":
391391
return this.createUserMessageUpdates(item);
392+
case "hookPrompt":
393+
return [];
392394
case "agentMessage":
393395
return [{
394396
sessionUpdate: "agent_message_chunk",

src/CodexEventHandler.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export class CodexEventHandler {
8989
case "item/commandExecution/outputDelta":
9090
return this.createCommandOutputDeltaEvent(notification.params);
9191
case "command/exec/outputDelta":
92+
case "item/autoApprovalReview/started":
93+
case "item/autoApprovalReview/completed":
9294
case "hook/started":
9395
case "hook/completed":
9496
return null;
@@ -102,6 +104,8 @@ export class CodexEventHandler {
102104
case "item/mcpToolCall/progress":
103105
case "serverRequest/resolved":
104106
case "account/updated":
107+
case "fs/changed":
108+
case "mcpServer/startupStatus/updated":
105109
return null;
106110
case "account/rateLimits/updated":
107111
this.handleRateLimitsUpdated(notification.params);
@@ -123,6 +127,7 @@ export class CodexEventHandler {
123127
case "thread/closed":
124128
case "thread/realtime/started":
125129
case "thread/realtime/itemAdded":
130+
case "thread/realtime/transcriptUpdated":
126131
case "thread/realtime/outputAudio/delta":
127132
case "thread/realtime/error":
128133
case "thread/realtime/closed":
@@ -189,6 +194,7 @@ export class CodexEventHandler {
189194
return await createDynamicToolCallUpdate(event.item);
190195
case "collabAgentToolCall":
191196
case "userMessage":
197+
case "hookPrompt":
192198
case "agentMessage":
193199
case "reasoning":
194200
case "webSearch":
@@ -226,6 +232,7 @@ export class CodexEventHandler {
226232
}
227233
case "collabAgentToolCall":
228234
case "userMessage":
235+
case "hookPrompt":
229236
case "agentMessage":
230237
case "webSearch":
231238
case "imageView":

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('CodexEventHandler - command action events', () => {
3131
command: 'ls /test/project',
3232
cwd: '/test/project',
3333
processId: null,
34+
source: 'agent',
3435
status: 'inProgress',
3536
commandActions: [
3637
{
@@ -65,6 +66,7 @@ describe('CodexEventHandler - command action events', () => {
6566
command: 'ls',
6667
cwd: '/test/project',
6768
processId: null,
69+
source: 'agent',
6870
status: 'completed',
6971
commandActions: [
7072
{
@@ -99,6 +101,7 @@ describe('CodexEventHandler - command action events', () => {
99101
command: 'rg "Service" src',
100102
cwd: '/test/project',
101103
processId: null,
104+
source: 'agent',
102105
status: 'inProgress',
103106
commandActions: [
104107
{
@@ -134,6 +137,7 @@ describe('CodexEventHandler - command action events', () => {
134137
command: 'rg "Service"',
135138
cwd: '/test/project',
136139
processId: null,
140+
source: 'agent',
137141
status: 'inProgress',
138142
commandActions: [
139143
{
@@ -169,6 +173,7 @@ describe('CodexEventHandler - command action events', () => {
169173
command: 'rg --files -g "*service*"',
170174
cwd: '/test/project',
171175
processId: null,
176+
source: 'agent',
172177
status: 'inProgress',
173178
commandActions: [
174179
{
@@ -204,6 +209,7 @@ describe('CodexEventHandler - command action events', () => {
204209
command: 'rg',
205210
cwd: '/test/project',
206211
processId: null,
212+
source: 'agent',
207213
status: 'inProgress',
208214
commandActions: [
209215
{

src/__tests__/CodexACPAgent/fuzzy-file-search-events.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ describe("CodexEventHandler - fuzzy file search events", () => {
3131
sessionId: "search-1",
3232
query: "event handler",
3333
files: [
34-
{ root: "/repo", path: "src/CodexEventHandler.ts", file_name: "CodexEventHandler.ts", score: 0.98, indices: [0, 1] },
35-
{ root: "/repo", path: "src/CodexToolCallMapper.ts", file_name: "CodexToolCallMapper.ts", score: 0.85, indices: [2, 3] },
34+
{ root: "/repo", path: "src/CodexEventHandler.ts", match_type: "file", file_name: "CodexEventHandler.ts", score: 0.98, indices: [0, 1] },
35+
{ root: "/repo", path: "src/CodexToolCallMapper.ts", match_type: "file", file_name: "CodexToolCallMapper.ts", score: 0.85, indices: [2, 3] },
3636
],
3737
},
3838
};
@@ -42,7 +42,7 @@ describe("CodexEventHandler - fuzzy file search events", () => {
4242
sessionId: "search-1",
4343
query: "event handler",
4444
files: [
45-
{ root: "/repo", path: "src/CodexEventHandler.ts", file_name: "CodexEventHandler.ts", score: 0.99, indices: [0, 1] },
45+
{ root: "/repo", path: "src/CodexEventHandler.ts", match_type: "file", file_name: "CodexEventHandler.ts", score: 0.99, indices: [0, 1] },
4646
],
4747
},
4848
};

src/__tests__/CodexACPAgent/load-session.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ describe("CodexACPAgent - loadSession", () => {
7676
id: "item-agent-1",
7777
text: "Hello!",
7878
phase: null,
79+
memoryCitation: null,
7980
},
8081
{
8182
type: "reasoning",
@@ -89,6 +90,7 @@ describe("CodexACPAgent - loadSession", () => {
8990
command: "ls",
9091
cwd: "/test/project",
9192
processId: null,
93+
source: "agent",
9294
status: "completed",
9395
commandActions: [],
9496
aggregatedOutput: null,

src/__tests__/CodexACPAgent/terminal-output-events.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('CodexEventHandler - terminal output events', () => {
3131
command: 'ls -la',
3232
cwd: '/test/project',
3333
processId: null,
34+
source: 'agent',
3435
status: 'inProgress',
3536
commandActions: [],
3637
aggregatedOutput: null,
@@ -67,6 +68,7 @@ describe('CodexEventHandler - terminal output events', () => {
6768
command,
6869
cwd: '/test/project',
6970
processId: null,
71+
source: 'agent',
7072
status: 'inProgress',
7173
commandActions: [],
7274
aggregatedOutput: null,
@@ -114,6 +116,7 @@ describe('CodexEventHandler - terminal output events', () => {
114116
command: 'ls -la',
115117
cwd: '/test/project',
116118
processId: 'pid-456',
119+
source: 'agent',
117120
status: 'completed',
118121
commandActions: [],
119122
aggregatedOutput: 'file1.txt\nfile2.txt\nfile3.txt\n',
@@ -142,6 +145,7 @@ describe('CodexEventHandler - terminal output events', () => {
142145
command: 'cat nonexistent.txt',
143146
cwd: '/test/project',
144147
processId: 'pid-789',
148+
source: 'agent',
145149
status: 'failed',
146150
commandActions: [],
147151
aggregatedOutput: 'cat: nonexistent.txt: No such file or directory',
@@ -196,6 +200,7 @@ describe('CodexEventHandler - terminal output events', () => {
196200
command: 'echo hello',
197201
cwd: '/test/project',
198202
processId: null,
203+
source: 'agent',
199204
status: 'inProgress',
200205
commandActions: [],
201206
aggregatedOutput: null,
@@ -226,6 +231,7 @@ describe('CodexEventHandler - terminal output events', () => {
226231
command: 'echo hello',
227232
cwd: '/test/project',
228233
processId: 'pid-123',
234+
source: 'agent',
229235
status: 'completed',
230236
commandActions: [],
231237
aggregatedOutput: 'hello\n',

0 commit comments

Comments
 (0)