feat(image-gen): add image edit tool - #19261
Conversation
|
Related to #17034 — this PR adds and properly exposes the image_edit tool that was previously registered but not wired into toolsets. |
1 similar comment
|
Related to #17034 — this PR adds and properly exposes the image_edit tool that was previously registered but not wired into toolsets. |
|
Thanks for linking #17034. I think this PR covers the main gap described there: adding a first-class One intentional boundary: |
5aadfdf to
d2e6030
Compare
d2e6030 to
147cb3b
Compare
|
CI note: The remaining failing For this PR head (
The full
The failures are concentrated in unrelated areas such as Bedrock headers, cron script prompts, gateway/update restart tests, browser Chromium checks, delegate provider resolution / heartbeat, Dockerfile TUI deps, credential env fallback, and sandbox cwd wrappers. I kept this PR focused on image-edit support and only included the minimal docs diagram cleanup needed for the current |
|
I opened #21765 as a smaller replacement for the core image-edit capability from this PR. This older branch had drifted behind current
Closing this PR in favor of the clean replacement. Thanks! |
Summary
Adds a first-class
image_edittool for prompt-guided image-to-image editing through configured image-generation backends, with OpenAI Codex / GPT Image 2 as the initial backend implementation.What changed
ImageGenProvider.supports_edit()and defaultedit()fallback for backwards-compatible provider capability detection.tools/image_edit_tool.pyand expose it through theimage_gen, CLI, messaging, and API-server toolsets.image_generationtool withaction: editand aninput_imagecontent part.safetoolset intentionally excludesimage_editbecause it can read/upload local reference images.Testing
python -m py_compile tools/image_edit_tool.py agent/image_gen_provider.py plugins/image_gen/openai-codex/__init__.py acp_adapter/tools.py toolsets.py tests/plugins/image_gen/test_openai_codex_provider.py tests/gateway/test_api_server_toolset.pypython -m pytest tests/plugins/image_gen tests/tools/test_image_generation.py tests/tools/test_image_generation_plugin_dispatch.py tests/tools/test_image_edit_tool.py tests/tools/test_registry.py tests/gateway/test_api_server_toolset.py -q -o 'addopts='cd website && npm run lint:diagramsruff check agent/image_gen_provider.py tools/image_edit_tool.py plugins/image_gen/openai/__init__.py plugins/image_gen/openai-codex/__init__.py tests/plugins/image_gen/test_openai_provider.pyCI compatibility notes
docs-site-checkspasses on currentmain.ascii-guardjob rejects; it is not part of the image-edit feature and can be split or dropped if maintainers prefer a separate docs PR.Notes
This PR keeps scope narrow: it adds the edit capability abstraction, one tool, and one backend implementation. Other image providers keep working through the default unsupported-edit fallback until they opt in.