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

Function getSourceForTaskError

server/src/docker/util.ts:222–225  ·  view source on GitHub ↗
(error: Error | string)

Source from the content-addressed store, hash-verified

220// TODO(thomas): This function may return serverOrTask for some errors that are clearly caused by the server.
221// Add more strings to DOCKER_EXEC_SERVER_ERROR_STRINGS to reduce these false negatives.
222export function getSourceForTaskError(error: Error | string): 'server' | 'serverOrTask' {
223 const lowercaseErrorMessage = (error instanceof Error ? errorToString(error) : error).toLowerCase()
224 return DOCKER_EXEC_SERVER_ERROR_STRINGS.some(str => lowercaseErrorMessage.includes(str)) ? 'server' : 'serverOrTask'
225}
226
227export function getApiOnlyNetworkName(config: Config) {
228 return `api-only-2-net-${config.getMachineName()}`

Callers 4

hooks_routes.tsFile · 0.90
startTaskEnvWithAuxVmMethod · 0.90
util.test.tsFile · 0.90

Calls 1

errorToStringFunction · 0.90

Tested by

no test coverage detected