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

Function syncSessionMode

cli/src/opencode/runOpencode.ts:113–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111 registerLocalHandoffHandler(session.rpcHandlerManager, lifecycle);
112
113 const syncSessionMode = () => {
114 const sessionInstance = sessionWrapperRef.current;
115 if (!sessionInstance) {
116 return;
117 }
118 sessionInstance.setPermissionMode(currentPermissionMode);
119 sessionInstance.setModel(sessionModel);
120 sessionInstance.setModelReasoningEffort(sessionModelReasoningEffort);
121
122 // Notify hub immediately so the UI reflects the change without
123 // waiting for the next 2s keepalive tick.
124 sessionInstance.pushKeepAlive();
125
126 logger.debug(`[opencode] Synced session config for keepalive: permissionMode=${currentPermissionMode}, model=${sessionModel ?? '(default)'}, modelReasoningEffort=${sessionModelReasoningEffort ?? '(default)'}`);
127 };
128
129 // Slash-command resolution now runs inside an async chain on
130 // `session.onUserMessage`, so there is a window between the message

Callers 1

runOpencodeFunction · 0.70

Calls 4

setPermissionModeMethod · 0.80
debugMethod · 0.80
setModelMethod · 0.65

Tested by

no test coverage detected