Skip to content

Add native image generation harness tools - #20

Merged
SSHdotCodes merged 1 commit into
mainfrom
codex/image-generation-tools
Aug 3, 2026
Merged

Add native image generation harness tools#20
SSHdotCodes merged 1 commit into
mainfrom
codex/image-generation-tools

Conversation

@SSHdotCodes

Copy link
Copy Markdown
Owner

What changed

  • add second-opinion image-tools for machine-readable image capability and generator discovery
  • add second-opinion image for native-harness image creation and editing with references, model controls, background task management, and verified raster artifacts
  • auto-detect Codex imagegen while supporting explicit or declared image tools on other coding harnesses
  • teach installed skills and docs the image concept to Opus implementation handoff
  • extend the cross-platform CI smoke surface and unit/integration coverage

Why

User feedback called out that visual redesigns were being passed directly to an implementation LLM and looked overly generated. This adds a first-class visual concept step: an orchestrator can use an available native image model/tool to create a real reference artifact, inspect it, and then hand that artifact to the best implementation worker.

Safety and performance

Second Opinion does not call image APIs, install generators, or handle image credentials. Output stays inside the selected workspace, existing artifacts require --force, and success requires a created or updated raster file with a valid signature. Validation reads only a fixed 16-byte header.

Verification

  • python3 -m py_compile bin/second-opinion
  • python3 -m unittest discover -s tests -v (40 tests)
  • exact GitHub Actions smoke commands, including image-tools and image --dry-run
  • ruff check bin/second-opinion tests/test_cli.py
  • git diff --check

@SSHdotCodes
SSHdotCodes marked this pull request as ready for review August 3, 2026 20:17
@SSHdotCodes
SSHdotCodes merged commit 483a846 into main Aug 3, 2026
6 of 7 checks passed
@SSHdotCodes
SSHdotCodes deleted the codex/image-generation-tools branch August 3, 2026 20:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a3c4b6dac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/second-opinion
Comment on lines +616 to +618
tool = declared_tool or ("imagegen / image_gen" if evidence else None)
models = model_declarations.get(key, ["provider-default"] if tool else [])
available = bool(command_path and tool)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify tool availability before auto-routing

When a harness CLI and a matching skill file are installed but the provider does not expose the underlying image tool for the current account or execution surface, this marks the harness as available anyway. The bundled image-generation skill itself accounts for the built-in tool being unavailable, so skill presence is not capability proof; image auto can consequently select this false positive ahead of a genuinely capable harness and fail without producing an artifact. Probe the actual tool capability, or treat skill-only evidence as unknown and exclude it from automatic routing.

Useful? React with 👍 / 👎.

Comment thread bin/second-opinion
Comment on lines +1098 to +1102
".png": header.startswith(b"\x89PNG\r\n\x1a\n"),
".jpg": header.startswith(b"\xff\xd8\xff"),
".jpeg": header.startswith(b"\xff\xd8\xff"),
".webp": header.startswith(b"RIFF") and header[8:12] == b"WEBP",
".gif": header.startswith((b"GIF87a", b"GIF89a")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject truncated images instead of checking only magic bytes

When a generator leaves a truncated or corrupt file whose first bytes still contain the expected signature, validate_image_artifact returns success and the job is reported as finished. For example, a PNG header followed by arbitrary bytes passes this table even though no image decoder can open it, allowing the supposedly verified raster artifact to be handed to the implementation worker. Validate the complete container structure or decode the image before reporting success.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants