feat(agent): enhance Codex initialization with MCP preheating and structured status updates

This commit is contained in:
HouYunFei
2026-08-03 10:54:15 +08:00
parent ea0414e88c
commit 8efd714221
11 changed files with 136 additions and 21 deletions
+12
View File
@@ -258,6 +258,18 @@ export class CodexAppClient {
}
return;
}
if (method === "mcpServer/startupStatus/updated") {
const value = params as unknown as CodexNotificationParams<"mcpServer/startupStatus/updated">;
this.emit("agent_bootstrap", {
type: "mcp.startup",
threadId: value.threadId || this.currentThreadId,
name: value.name,
status: value.status,
error: value.error,
failureReason: value.failureReason,
});
return;
}
const turnEvent = method.startsWith("turn/") || method.startsWith("item/") || method === "thread/tokenUsage/updated" || method === "error";
if (turnEvent) {
const threadId = String(field(params, "threadId") || this.currentThreadId);