MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / openThreadRuntime

Function openThreadRuntime

desktop/runtime/composer-service.ts:571–595  ·  view source on GitHub ↗
(request: ComposerStateRequest)

Source from the content-addressed store, hash-verified

569}
570
571export async function openThreadRuntime(request: ComposerStateRequest): Promise<ComposerState> {
572 const persistedSessionPath = getPersistedSessionPath(request.sessionPath)
573 if (!persistedSessionPath) {
574 const { composer } = await emitComposerUpdate({ ...request, sessionPath: null })
575 return composer
576 }
577
578 return await withRuntimeMutationLock(persistedSessionPath, async () => {
579 const runtime = await getOrCreateRuntimeForSessionPath(persistedSessionPath, {
580 suspendDisposal: true,
581 settingsCwd: request.composerSessionDir ?? null,
582 chatGroupId: request.chatGroupId ?? null,
583 })
584 if (!(runtime.session.isStreaming || isRuntimeExtensionCommandRunning(runtime))) {
585 await applyComposerModeSettings(runtime, request)
586 }
587 scheduleRuntimeDisposalForRuntime(runtime)
588 const composer = await buildComposerState(runtime)
589 publishComposerUpdate(composer, {
590 projectId: request.projectId ?? runtime.cwd,
591 sessionPath: persistedSessionPath,
592 })
593 return composer
594 })
595}

Callers 1

thread-actions.tsFile · 0.90

Calls 9

getPersistedSessionPathFunction · 0.90
withRuntimeMutationLockFunction · 0.90
buildComposerStateFunction · 0.90
publishComposerUpdateFunction · 0.90
emitComposerUpdateFunction · 0.70

Tested by

no test coverage detected