refactor: introduce model-agnostic agent interfaces (#323)

This commit is contained in:
Junmo Kim
2026-03-20 08:45:32 +08:00
committed by GitHub
parent ea45797b6f
commit d76b1a6ac0
19 changed files with 52 additions and 42 deletions
+12 -12
View File
@@ -188,7 +188,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
const cwdValue = inputRecord.cwd;
const cwd = typeof cwdValue === 'string' && cwdValue.trim().length > 0 ? cwdValue : undefined;
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call',
name: 'CodexPermission',
callId: id,
@@ -202,7 +202,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
});
},
onComplete: ({ id, decision, reason, approved }) => {
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call-result',
callId: id,
output: {
@@ -215,10 +215,10 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
}
});
const reasoningProcessor = new ReasoningProcessor((message) => {
session.sendCodexMessage(message);
session.sendAgentMessage(message);
});
const diffProcessor = new DiffProcessor((message) => {
session.sendCodexMessage(message);
session.sendAgentMessage(message);
});
this.permissionHandler = permissionHandler;
this.reasoningProcessor = reasoningProcessor;
@@ -350,7 +350,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
if (msgType === 'agent_message') {
const message = asString(msg.message);
if (message) {
session.sendCodexMessage({
session.sendAgentMessage({
type: 'message',
message,
id: randomUUID()
@@ -365,7 +365,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
delete inputs.call_id;
delete inputs.callId;
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call',
name: 'CodexBash',
callId: callId,
@@ -382,7 +382,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
delete output.call_id;
delete output.callId;
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call-result',
callId: callId,
output,
@@ -391,7 +391,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
}
}
if (msgType === 'token_count') {
session.sendCodexMessage({
session.sendAgentMessage({
...msg,
id: randomUUID()
});
@@ -404,7 +404,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
const filesMsg = changeCount === 1 ? '1 file' : `${changeCount} files`;
messageBuffer.addMessage(`Modifying ${filesMsg}...`, 'tool');
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call',
name: 'CodexPatch',
callId: callId,
@@ -431,7 +431,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
messageBuffer.addMessage(`Error: ${errorMsg.substring(0, 200)}`, 'result');
}
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call-result',
callId: callId,
output: {
@@ -451,7 +451,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
invocation.tool ?? invocation.tool_name ?? msg.tool
);
if (callId && name) {
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call',
name,
callId,
@@ -476,7 +476,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
}
if (callId) {
session.sendCodexMessage({
session.sendAgentMessage({
type: 'tool-call-result',
callId,
output,