Skip to content

feat(desktop): test-connection button for image providers + DX improvements#369

Open
tiegebentley wants to merge 5 commits into
OpenCoworkAI:mainfrom
tiegebentley:feat/test-connection-image-provider
Open

feat(desktop): test-connection button for image providers + DX improvements#369
tiegebentley wants to merge 5 commits into
OpenCoworkAI:mainfrom
tiegebentley:feat/test-connection-image-provider

Conversation

@tiegebentley
Copy link
Copy Markdown
Contributor

Summary

  • Test connection button for image generation providers in Settings → Image API tab. Resolves credentials across all three paths (inherited from chat provider, custom encrypted, ChatGPT OAuth) and probes GET /models on the configured image baseUrl. Loading/success/error toasts, 5 unit tests, i18n for en/es/zh-CN.
  • Browser-mode IPC shim — in-memory implementation of window.codesign so the renderer runs standalone via vite.browser.config.ts without Electron. Design CRUD, chat, snapshots, and comments all functional; generation returns a placeholder HTML card. Useful for UI development and testing on headless servers.
  • Remote debugging port — when REMOTE_DEBUGGING_PORT env var is set, passes --remote-debugging-port and --remote-allow-origins=* to Electron so Chrome DevTools can attach from a remote machine.
  • GPT-4o maxTokens fix — caps output tokens to 16384 (the actual model limit) instead of the generic 32000 fallback that caused silent truncation on long generations.

Test plan

  • All 1341 existing tests pass (pnpm test)
  • Typecheck clean across all 11 workspaces
  • Biome lint clean (528 files, 0 errors)
  • New image-generation-settings.test.ts covers all credential resolution paths
  • Manual: browser-only dev server renders hub, settings, examples gallery

🤖 Generated with Claude Code

tiegebentley and others added 5 commits May 25, 2026 23:00
Enables running just the renderer at :5175 without Electron, useful
for headless Linux dev (no $DISPLAY). Defines __APP_VERSION__ so
TopBar renders without the electron-vite pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves credentials for all three paths (inherited, custom encrypted,
ChatGPT OAuth) and probes GET /models on the image baseUrl. Includes
UI button with loading/success/error toasts, 5 unit tests, and i18n
strings for en/es/zh-CN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
In-memory implementation of window.codesign so the renderer runs standalone
via vite.browser.config.ts with design CRUD, chat, snapshots, and comments
all functional. Generation returns a placeholder HTML card.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When REMOTE_DEBUGGING_PORT is set, pass --remote-debugging-port and
--remote-allow-origins=* to Electron so Chrome DevTools can attach
from a remote machine. Also fix a pre-existing biome lint warning
(useless ternary in AddCustomProviderModal).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GPT-4o models have a 16384 output token limit, not 32000. The generic
fallback caused silent truncation on long generations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added area:desktop apps/desktop (Electron shell, renderer) area:core packages/core (generation orchestration) labels May 25, 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

  • [Minor] Missing changeset — the PR adds user-visible features (test connection button, GPT-4o maxTokens fix, i18n keys) that should trigger a changeset for changelog generation. See CONTRIBUTING.md or run pnpm changeset.
    Suggested fix: run pnpm changeset and commit the generated file.

  • [Nit] Browser shim imported unconditionally — installBrowserShim() is called at the top of main.tsx (apps/desktop/src/renderer/src/main.tsx:12). In Electron mode it returns early, but the entire 702‑line module is still parsed and included in the production renderer bundle. This adds no runtime behavior change but wastes a few KB. Consider a dynamic import or a conditional check around the import statement so the module is only loaded when needed.
    Suggested fix: wrap the import in a condition like if (!('electronAPI' in window)) import('./browser-shim').then(...) or restructure the build config to exclude it for Electron builds.

  • [Nit] Remote debugging port security — apps/desktop/scripts/dev.cjs:24 sets --remote-allow-origins=*, which opens the debugging port to any origin. This is gated behind an env variable and only runs in dev, but the code comment could mention it must not be used in production or CI runners that expose ports.
    No change required, but consider a cautionary comment.

Summary

The PR adds four features: (1) a test‑connection button for image generation providers with full credential resolution (inherited, custom, ChatGPT OAuth), (2) a browser‑mode IPC shim for UI development without Electron, (3) a remote debugging port option via REMOTE_DEBUGGING_PORT, and (4) a GPT-4o maxTokens cap fix. All changes are well‑structured, follow the project stack (Tailwind tokens, i18n, Zustand), and include unit tests for the new resolveImageGenerationTestCredentials function. No security or data‑loss issues introduced. The only material gap is the missing changeset — user‑visible features require one per repo conventions. The browser shim import and remote debugging port are minor polish suggestions.

Testing

  • New unit tests cover all credential resolution paths (image-generation-settings.test.ts).
  • 1341 existing tests pass, typecheck clean, Biome lint clean.
  • No Playwright E2E tests added; the feature is UI‑only and adequately covered by the unit tests.

Open-CoDesign Bot

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

Labels

area:core packages/core (generation orchestration) area:desktop apps/desktop (Electron shell, renderer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant