Skip to content

fix: forward image attachments for OpenAI-compatible providers#373

Merged
Sun-sunshine06 merged 1 commit into
mainfrom
fix/issue-201-image-attachments
May 31, 2026
Merged

fix: forward image attachments for OpenAI-compatible providers#373
Sun-sunshine06 merged 1 commit into
mainfrom
fix/issue-201-image-attachments

Conversation

@Sun-sunshine06
Copy link
Copy Markdown
Collaborator

Summary

  • Treat OpenAI-compatible chat, Anthropic, OpenAI Responses, and Codex wires as image-capable when synthesizing provider models.
  • Forward image attachments through the v0.2 agent path for OpenAI-compatible providers instead of relying on model-id heuristics.
  • Add focused core/providers tests and a changeset.

Fixes #201

Verification

  • pnpm --filter @open-codesign/core test -- src/agent.test.ts
  • pnpm --filter @open-codesign/providers test -- src/index.test.ts
  • pnpm --filter @open-codesign/core typecheck
  • pnpm --filter @open-codesign/providers typecheck

@github-actions github-actions Bot added docs Documentation area:core packages/core (generation orchestration) area:providers packages/providers (pi-ai adapter, model calls) labels May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review mode: initial

Findings

No blockers, no major issues. This PR correctly adds image attachment support for OpenAI-compatible chat, OpenAI Responses, and Anthropic wires in both the core agent and provider synthesis paths. The existing tests are extended with focused coverage for the new openai-chat wire case, and a changeset is included.

Minor (optional, not blocking): The supportsImageInput function in packages/core/src/agent.ts:242-248 uses three separate if statements for the wire checks. These could be flattened into a single condition with a Set or includes for readability, but consistency with the existing code style is acceptable.

Summary

  • PR title/body correctly state the fix and reference #201 (image attachments not forwarded for non-Codex OpenAI-compatible wires). The diff directly addresses the issue by adding openai-chat to the agent-side wire check in agent.ts and extending the provider-side synthesized model image capability to include anthropic, openai-chat, and openai-responses in providers/src/index.ts.
  • No regressions detected. All changed code paths are covered by new tests (one in core/agent.test.ts, one in providers/index.test.ts).
  • No new dependencies, no silent fallbacks, no hardcoded UI values, no license concerns.
  • The changeset is correctly scoped as patch for both @open-codesign/core and @open-codesign/providers.

Testing

  • pnpm --filter @open-codesign/core test (includes the new agent test)
  • pnpm --filter @open-codesign/providers test (includes the new provider test)
  • pnpm --filter @open-codesign/core typecheck
  • pnpm --filter @open-codesign/providers typecheck

Open-CoDesign Bot

@Sun-sunshine06 Sun-sunshine06 force-pushed the fix/issue-201-image-attachments branch from 4369ded to d5fa7b0 Compare May 31, 2026 14:43
@github-actions github-actions Bot added area:desktop apps/desktop (Electron shell, renderer) area:build Turbo/Vite/Biome/tsconfig toolchain labels May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review mode: follow-up after new commits

Findings

  • [Minor] The PR claims to close #201, but the linked issue body cannot be verified from the public checkout. Based on the diff and PR description, the change implements the stated fix (forward image attachments for OpenAI-compatible, Anthropic, and OpenAI Responses wires in both agent.ts and providers/index.ts), and includes adequate test coverage for the openai-chat path. If the issue has broader acceptance criteria beyond this (e.g., adding image support for additional wires or runtime paths), the PR description should use Refs #201 instead. As-is, the content matches the described fix, so the claim appears consistent with available evidence.

Summary

  • Previous review was initial; this is the first follow-up since the contributor pushed new commits (diffs include: biome.json schema bump from 2.4.14 to 2.4.15, a minor code simplification in AddCustomProviderModal.tsx (ternary to !!), and the addition of a changeset file).
  • The core behavioral fix (image attachment forwarding for openai-chat in agent and provider paths) is unchanged from the previously reviewed diff. The new changes are all cosmetic/admin: Biome schema update, a boolean simplification, and a changeset. No new behavioral concerns.
  • No blockers, no regressions, no license issues, no silent fallbacks.

Testing

  • Confirmed tests added for both core agent (packages/core/src/agent.test.ts) and providers (packages/providers/src/index.test.ts) paths. Prior review noted these as adequate.

Open-CoDesign Bot

@Sun-sunshine06 Sun-sunshine06 merged commit b2d020d into main May 31, 2026
6 checks passed
@Sun-sunshine06 Sun-sunshine06 deleted the fix/issue-201-image-attachments branch May 31, 2026 14:49
J35u5128 added a commit to J35u5128/open-codesign that referenced this pull request Jun 2, 2026
fix: forward image attachments for OpenAI-compatible providers (OpenCoworkAI#373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Turbo/Vite/Biome/tsconfig toolchain area:core packages/core (generation orchestration) area:desktop apps/desktop (Electron shell, renderer) area:providers packages/providers (pi-ai adapter, model calls) docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: expand image attachment support beyond ChatGPT Codex to all providers

1 participant