MCPcopy Create free account
hub / github.com/METR/vivaria / getTaskVersion

Function getTaskVersion

server/src/docker/util.ts:147–155  ·  view source on GitHub ↗
(taskInfo: TaskInfo, fetchedTask: FetchedTask)

Source from the content-addressed store, hash-verified

145// If the task is not on the main tree, the version is the version of the task plus the hash of the task source.
146// If it is on the main tree, then the version is just what is in the manifest
147export function getTaskVersion(taskInfo: TaskInfo, fetchedTask: FetchedTask): string | null {
148 // Prefer task-level versions, fall back on family-level version
149 let version = fetchedTask.manifest?.tasks[taskInfo.taskName]?.version ?? fetchedTask.manifest?.version ?? null
150 if (version !== null && (taskInfo.source.type === 'upload' || taskInfo.source.isMainAncestor !== true)) {
151 const taskHash = hashTaskOrAgentSource(taskInfo.source)
152 version = `${version}-${taskHash.slice(-7)}`
153 }
154 return version
155}
156
157export function getSandboxContainerName(config: Config, runId: RunId) {
158 const machineName = config.getMachineName()

Callers 3

enqueueRunMethod · 0.90
startRunMethod · 0.90
setupTaskContainerMethod · 0.90

Calls 1

hashTaskOrAgentSourceFunction · 0.85

Tested by

no test coverage detected