Skip to content

feat(jobs): add MaxWidth/MaxHeight and multi-format output to OptimizeJob #3

Description

@GustavoGutierrez

Context

A DevForge MCP audit (PRP 003, release v2.5.1) confirmed that the optimize_images handler reads several user-supplied input fields that are silently dropped because the corresponding OptimizeJob protocol struct does not have matching fields.

What's missing in dpf

OptimizeJob currently has inputs, quality, and a boolean also_webp. The following user-supplied fields are dropped:

  • max_width: int — clamp output width (pixels, 0 = no clamp)
  • max_height: int — clamp output height (pixels, 0 = no clamp)
  • A real multi-format output list — the current also_webp: bool only models a single extra format. Callers asking for avif, jpg, or png get silently ignored.

Suggested replacement:

  • Drop also_webp: bool
  • Add formats: []string — desired output formats (e.g. [''webp'', ''avif'', ''jpg''])

This is a small breaking change to the dpf protocol. Recommend bumping the protocol version so DevForge can detect compatibility.

What DevForge will do once this lands

In internal/tools/optimize_images.go, the handler reads input.MaxWidth, input.MaxHeight, and input.Formats (already a []string on the Go side) but only forwards also_webp today. After this lands, all three flow through to dpf, and the description for optimize_images in cmd/devforge-mcp/main.go gets the qualifier removed.

Impact

Today, callers requesting max_width=1920 get the original dimensions; callers requesting AVIF get WebP-or-nothing. After this lands, dpf honors the user's full optimization spec.

References

  • DevForge commits: 3d1884b, 5235038
  • DevForge release: v2.5.1
  • DevForge memory: prp/003-tools-efficiency-and-reuse/preexisting-bugs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions