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

Method canFreshSpawnNeverStartedSession

hub/src/sync/syncEngine.ts:1052–1061  ·  view source on GitHub ↗

Inactive session with directory path but no agent thread and no prior user turn.

(session: Session, sessionId: string, namespace: string)

Source from the content-addressed store, hash-verified

1050
1051 /** Inactive session with directory path but no agent thread and no prior user turn. */
1052 private canFreshSpawnNeverStartedSession(session: Session, sessionId: string, namespace: string): boolean {
1053 const metadata = session.metadata
1054 if (!metadata || typeof metadata.path !== 'string' || metadata.path.length === 0) {
1055 return false
1056 }
1057 if (this.resolveAgentResumeId(session, namespace)) {
1058 return false
1059 }
1060 return this.store.messages.getFirstMessages(sessionId, 1).length === 0
1061 }
1062
1063 async resumeSession(sessionId: string, namespace: string, opts?: { permissionMode?: PermissionMode }): Promise<ResumeSessionResult> {
1064 const access = this.sessionCache.resolveSessionAccess(sessionId, namespace)

Callers 1

resumeSessionMethod · 0.95

Calls 2

resolveAgentResumeIdMethod · 0.95
getFirstMessagesMethod · 0.80

Tested by

no test coverage detected