Share RPC method constants

This commit is contained in:
weishu
2026-05-21 10:53:31 +08:00
parent 41f6b37d69
commit b79f50f815
29 changed files with 129 additions and 68 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import { bootstrapExistingSession, bootstrapSession } from '@/agent/sessionFacto
import { registerLocalHandoffHandler } from '@/agent/localHandoff';
import { createModeChangeHandler, createRunnerLifecycle, setControlledByUser } from '@/agent/runnerLifecycle';
import { isPermissionModeAllowedForFlavor } from '@hapi/protocol';
import { RPC_METHODS } from '@hapi/protocol/rpcMethods';
import { CodexCollaborationModeSchema, PermissionModeSchema } from '@hapi/protocol/schemas';
import { formatMessageWithAttachments } from '@/utils/attachmentFormatter';
import { getInvokedCwd } from '@/utils/invokedCwd';
@@ -293,7 +294,7 @@ export async function runCodex(opts: {
return trimmedValue;
};
session.rpcHandlerManager.registerHandler('set-session-config', async (payload: unknown) => {
session.rpcHandlerManager.registerHandler(RPC_METHODS.SetSessionConfig, async (payload: unknown) => {
if (!payload || typeof payload !== 'object') {
throw new Error('Invalid session config payload');
}