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 @@ -51,7 +51,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "^0.16.1",
"@openai/codex": "^0.120.0",
"@openai/codex": "^0.122.0",
"diff": "^8.0.3",
"open": "^11.0.0",
"vscode-jsonrpc": "^8.2.1"
Expand Down
19 changes: 17 additions & 2 deletions src/CodexEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import type {
ItemStartedNotification, ThreadItem,
ModelReroutedNotification,
ThreadTokenUsageUpdatedNotification,
TurnPlanUpdatedNotification
TurnPlanUpdatedNotification,
WarningNotification
} from "./app-server/v2";
import type { McpStartupCompleteEvent } from "./app-server";
import {toTokenCount} from "./TokenCount";
Expand Down Expand Up @@ -115,6 +116,8 @@ export class CodexEventHandler {
return null;
case "configWarning":
return await this.createConfigWarningEvent(notification.params);
case "warning":
return this.createWarningEvent(notification.params);
case "thread/compacted":
return {
sessionUpdate: "agent_message_chunk",
Expand All @@ -130,7 +133,8 @@ export class CodexEventHandler {
case "thread/closed":
case "thread/realtime/started":
case "thread/realtime/itemAdded":
case "thread/realtime/transcriptUpdated":
case "thread/realtime/transcript/delta":
case "thread/realtime/transcript/done":
case "thread/realtime/outputAudio/delta":
case "thread/realtime/sdp":
case "thread/realtime/error":
Expand All @@ -140,6 +144,7 @@ export class CodexEventHandler {
case "skills/changed":
case "deprecationNotice":
case "mcpServer/oauthLogin/completed":
case "externalAgentConfig/import/completed":
case "rawResponseItem/completed":
case "thread/started":
case "thread/name/updated":
Expand Down Expand Up @@ -176,6 +181,16 @@ export class CodexEventHandler {
}
}

private createWarningEvent(event: WarningNotification): UpdateSessionEvent {
return {
sessionUpdate: "agent_message_chunk",
content: {
type: "text",
text: `Warning: ${event.message}\n\n`
}
};
}

private createModelReroutedEvent(event: ModelReroutedNotification): UpdateSessionEvent {
return {
sessionUpdate: "agent_thought_chunk",
Expand Down
6 changes: 6 additions & 0 deletions src/__tests__/CodexACPAgent/CodexAcpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
});
rateLimits.set("limit-2", {
Expand All @@ -810,6 +811,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
});

Expand Down Expand Up @@ -862,6 +864,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
}
});
Expand All @@ -876,6 +879,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
}
});
Expand All @@ -892,6 +896,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
});
expect(sessionState.rateLimits!.get("fast-limit")).toEqual({
Expand All @@ -904,6 +909,7 @@ describe('ACP server test', { timeout: 40_000 }, () => {
secondary: null,
credits: null,
planType: null,
rateLimitReachedType: null,
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/app-server/AgentMessageItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { MessagePhase } from "./MessagePhase";
* should use it when present, but retain legacy completion semantics when it
* is `None`.
*/
export type AgentMessageItem = { id: string, content: Array<AgentMessageContent>,
export type AgentMessageItem = { id: string, content: Array<AgentMessageContent>,
/**
* Optional phase metadata carried through from `ResponseItem::Message`.
*
Expand Down
6 changes: 3 additions & 3 deletions src/app-server/ApplyPatchApprovalParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import type { FileChange } from "./FileChange";
import type { ThreadId } from "./ThreadId";

export type ApplyPatchApprovalParams = { conversationId: ThreadId,
export type ApplyPatchApprovalParams = { conversationId: ThreadId,
/**
* Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent]
* and [codex_protocol::protocol::PatchApplyEndEvent].
*/
callId: string, fileChanges: { [key in string]?: FileChange },
callId: string, fileChanges: { [key in string]?: FileChange },
/**
* Optional explanatory reason (e.g. request for extra write access).
*/
reason: string | null,
reason: string | null,
/**
* When set, the agent is asking the user to allow writes under this root
* for the remainder of the session (unclear if this is honored today).
Expand Down
8 changes: 4 additions & 4 deletions src/app-server/ApplyPatchApprovalRequestEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { FileChange } from "./FileChange";

export type ApplyPatchApprovalRequestEvent = {
export type ApplyPatchApprovalRequestEvent = {
/**
* Responses API call id for the associated patch apply call, if available.
*/
call_id: string,
call_id: string,
/**
* Turn ID that this patch belongs to.
* Uses `#[serde(default)]` for backwards compatibility with older senders.
*/
turn_id: string, changes: { [key in string]?: FileChange },
turn_id: string, changes: { [key in string]?: FileChange },
/**
* Optional explanatory reason (e.g. request for extra write access).
*/
reason: string | null,
reason: string | null,
/**
* When set, the agent is asking the user to allow writes under this root for the remainder of the session.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/app-server/ByteRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type ByteRange = {
export type ByteRange = {
/**
* Start byte offset (inclusive) within the UTF-8 text buffer.
*/
start: number,
start: number,
/**
* End byte offset (exclusive) within the UTF-8 text buffer.
*/
Expand Down
Loading
Loading