deepseek-ai/deepseek-harness · error · Error
cannot read "${target.displayPath}": at least one image side
Error message
cannot read "${target.displayPath}": at least one image side exceeds the ${attachments.imageLimits.maxImageDimension}px limit; downscale the image and read the smaller copy What it means
Error "cannot read "${target.displayPath}": at least one image side exceeds the ${attachments.imageLimits.maxImageDimension}px limit; downscale the image and read the smaller copy" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/fs/tool-fs/src/read-image.ts:227
const { target, info } = await resolveRegularReadTarget(ctx, exec, args.file_path)
// The tool result is one message carrying one image, so the per-message
// aggregate bound applies beside the per-image bound.
const byteCap = Math.min(attachments.imageLimits.maxImageBytes, attachments.imageLimits.maxMessageImageBytes)
const data = await ctx.fs.readBytes(target, exec.signal, byteCap)
// Persist before returning: the image block must reference a durably
// committed object by the time the tool/result event is appended.
let ref: ImageAttachmentRef
try {
ref = await attachments.saveImage({ data, mediaType, name: basename(target.displayPath) })
} catch (error: unknown) {
if (!(error instanceof AttachmentError)) throw error
// Dimension refusals stay recoverable tool errors: an oversized image
// must never enter durable history, where it would ride every later
// model request past provider-side dimension rejections.
if (error.code === 'IMAGE_DIMENSION_TOO_LARGE') {
throw new Error(
`cannot read "${target.displayPath}": at least one image side exceeds the ${attachments.imageLimits.maxImageDimension}px limit; downscale the image and read the smaller copy`,
{ cause: error },
)
}
if (error.code === 'IMAGE_TOO_MANY_PIXELS') {
throw new Error(
`cannot read "${target.displayPath}": the image exceeds the ${attachments.imageLimits.maxImagePixels}-pixel decoded-size limit; downscale the image and read the smaller copy`,
{ cause: error },
)
}
if (error.code === 'IMAGE_TOO_LARGE') {
throw new Error(
`cannot read "${target.displayPath}": the image cannot be stored within the deployment's byte limits; downscale the image and read the smaller copy`,
{ cause: error },
)
}
if (error.code === 'ATTACHMENT_WRITE_FAILED' && /16-bit PNG/iu.test(error.message)) {
throw new Error(View on GitHub (pinned to b150a551b8)
When it happens
Trigger: Thrown at packages/fs/tool-fs/src/read-image.ts:227 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/fd41548a40ef350f.
Report an issue: GitHub.