feat(media): image_edit — edit or upscale an existing image (v0.138.0)#233
Merged
Conversation
New governed MCP tool: takes a source image (Library id, working-folder path, or URL) + a prompt (image-to-image edit) or scale (upscale), and saves the result as a NEW Library image. Extends the Atlas image backend with editImage (shared generateImage submit+poll); route /api/agent/image/edit; classified image.edit (money-capped), audited image.edited. Verified live (edit + upscale return images). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New governed MCP tool
image_edit— agents can now transform an image they already have, not just draw from scratch:scaleof 2 or 4The source
imageaccepts the same three places a session's image can live (shared resolver): a Library artifact id, a working-folder file path (written or terminal-uploaded), or an http(s) URL. The result is saved as a new Library image — the source is never mutated — plus an inbox card.How
src/edge/image-gen.ts:ImageBackendgainseditImage().AtlasBackendimplements it and shares a newsubmitAndPoll()withgenerate()— edit and upscale ride the samegenerateImagesubmit+poll, only the body differs (images[]+promptfor edit,image+outscalefor upscale). OpenRouter throws (its image API is text-to-image only).src/terminal.ts:editImage()mirrorsgenerateImage— resolve ref → gateimage.edit(cost estimate → money-cap) →backend.editImage→ingestas a newimageartifact + inbox card → auditimage.edited.src/server.ts:POST /api/agent/image/edit(loopback, session-secret gated).src/memory/memory-mcp.ts:IMAGE_EDIT_TOOL+ handler + dispatch, exposed withimage_generate.google/nano-banana-2/edit, upscale →atlascloud/image-upscaler(override viamodel).Governance
Classified
image.editwith anamountUsdestimate — the wildcard money-capneverrule applies automatically (no policy change). Auditedimage.edited. Source ref resolution reusescontainedPathcontainment (no folder escapes).Verified
nano-banana-2/edit(2 MB PNG), upscale →image-upscaler(812 KB JPG). Both return stored image bytes.typecheck,build,test:governance(68/68) pass.Atlas-only. New route needs a server restart on the live box; the new MCP tool needs a session relaunch to appear.
🤖 Generated with Claude Code