MCPcopy Create free account
hub / github.com/tiann/hapi / applyCurrentConfigToSession

Function applyCurrentConfigToSession

cli/src/codex/runCodex.ts:95–111  ·  view source on GitHub ↗
(options?: { syncModel?: boolean })

Source from the content-addressed store, hash-verified

93 registerLocalHandoffHandler(session.rpcHandlerManager, lifecycle);
94
95 const applyCurrentConfigToSession = (options?: { syncModel?: boolean }) => {
96 const sessionInstance = sessionWrapperRef.current;
97 if (!sessionInstance) {
98 return;
99 }
100 sessionInstance.setPermissionMode(currentPermissionMode);
101 if (options?.syncModel !== false) {
102 sessionInstance.setModel(currentModel ?? null);
103 }
104 sessionInstance.setModelReasoningEffort(currentModelReasoningEffort ?? null);
105 sessionInstance.setCollaborationMode(currentCollaborationMode);
106 logger.debug(
107 `[Codex] Synced session config for keepalive: ` +
108 `permissionMode=${currentPermissionMode}, model=${currentModel ?? 'auto'}, ` +
109 `modelReasoningEffort=${currentModelReasoningEffort ?? 'default'}, collaborationMode=${currentCollaborationMode}`
110 );
111 };
112
113 const applySlashUpdates = (updates: {
114 permissionMode?: PermissionMode;

Callers 2

applySlashUpdatesFunction · 0.85
runCodexFunction · 0.85

Calls 5

setPermissionModeMethod · 0.80
setCollaborationModeMethod · 0.80
debugMethod · 0.80
setModelMethod · 0.65

Tested by

no test coverage detected