Skip to content

Feature/gemini provider#368

Closed
J35u5128 wants to merge 9 commits into
OpenCoworkAI:mainfrom
J35u5128:feature/GeminiProvider
Closed

Feature/gemini provider#368
J35u5128 wants to merge 9 commits into
OpenCoworkAI:mainfrom
J35u5128:feature/GeminiProvider

Conversation

@J35u5128
Copy link
Copy Markdown

Summary

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Build / CI / tooling
  • Breaking change

Linked issue

Checklist

  • I checked the linked issue / relevant context before starting
  • pnpm lint && pnpm typecheck && pnpm test passes locally
  • Added/updated tests for the change
  • Added a changeset (pnpm changeset) if user-visible
  • Updated docs if behavior changed

Dependency additions (if any)

Screenshots / recordings (UI changes)

J35u5128 and others added 9 commits May 22, 2026 13:39
github
Enable Corepack and activate pnpm in the GitHub Actions test workflow (.github/workflows/test.yml). Replace `npm ci` with `pnpm install --frozen-lockfile` and `npm run` invocations with `pnpm run` for both unit and e2e jobs to use pnpm for dependency installation and script execution.
test.yml
@github-actions github-actions Bot added docs Documentation area:desktop apps/desktop (Electron shell, renderer) area:core packages/core (generation orchestration) area:providers packages/providers (pi-ai adapter, model calls) area:build Turbo/Vite/Biome/tsconfig toolchain 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

  • [Major] readme2.md is a personal development notes file that should not be committed.
    This file contains absolute Windows paths (c:\Users\jalcalap\vscode\Codesign), personal setup instructions, and Spanish-language content that duplicates existing documentation. It is not a proper project document and does not follow the repository’s documentation conventions. Committing such personal/private files can lead to security and maintenance issues.
    Suggested fix: Delete readme2.md from the branch. If personal notes are needed, keep them in a local-only location (e.g., a directory in .gitignore or outside the repo).

  • [Major] Pre-commit and pre-push hooks have been disabled (commented out) without justification.
    .husky/pre-commit now only contains #!/bin/sh and commented-out pnpm lint / pnpm test:unit. .husky/pre-push now reads # Hook desactivado temporalmente para permitir push. This removes automated quality gates (lint, typecheck, tests) that are required by the project’s checklist (CLAUDE.md mentions Biome lint, ts strict, tests). The PR description does not explain why these checks are disabled, and the change weakens the project’s CI hygiene.
    Suggested fix: Restore the original hook content so that pnpm lint, pnpm typecheck, and pnpm test (or the subset appropriate for the hook context) run on commit/push. If there is a legitimate reason (e.g., CI already runs these checks), document it in the PR body.

  • [Minor] No tests added for the Gemini provider changes.
    The diff adds a new Gemini endpoint in packages/providers/src/validate.ts and a new compatibility profile in packages/core/src/agent.ts, but no corresponding Vitest or Playwright tests are included. Per CLAUDE.md, “New features require at least one Vitest test.”
    Suggested fix: Add at least a Vitest test for the Gemini validation path in validate.ts (e.g., that pingProvider('google', ...) constructs the correct URL/headers) and a test for the openAIChatCompatForBaseUrl Gemini branch. Also consider adding a test for the custom provider preset button in ModelsTab.tsx (e.g., a component test or E2E check for the data-testid).

  • [Minor] No changeset added for the user-visible Gemini provider UI change.
    The PR adds a new button “Añadir Gemini (Google)” in the settings UI and updates validation logic, which is a user-visible feature addition. Per the PR template and project practices, a changeset should be added.
    Suggested fix: Run pnpm changeset to create a changeset with a description like: “feat: add one-click Gemini (Google) custom provider setup and validation.”

  • [Minor] The new CI workflow .github/workflows/test.yml uses outdated GitHub Actions versions.
    It references actions/checkout@v3 (latest stable is v4) and actions/setup-node@v3 (latest is v4). Also, it installs pnpm via corepack prepare pnpm@latest --activate instead of pinning to the version declared in package.json (pnpm@10.33.4). Using @latest could introduce unexpected behavior when the pnpm version changes.
    Suggested fix: Update to actions/checkout@v4, actions/setup-node@v4, and use corepack prepare pnpm@10.33.4 --activate (or derive from the lockfile). If using the project’s existing actions pattern, check if other workflows use @v3; but this is a new workflow so it should use the latest stable versions.

  • [Nit] packages/providers/src/validate.ts contains a test-workaround comment and throwing CodesignError on HTTP 400 for the google provider.
    The comment says “Parche para test: Cuando el provider es 'google' y status 400, lanzar CodesignError (caso del test).” This is a test-specific behavior hardcoded into production code, and it uses ERROR_CODES.PROVIDER_NOT_SUPPORTED which is semantically wrong (an HTTP 400 is not “provider not supported”). If a test needs this behavior, it should be handled via mocking or a test-only path, not by branching in production logic.
    Suggested fix: Remove the if (provider === 'google' && res.status === 400) block. If the test expects a specific error type for 400, change the test to accept the standard statusMessage behavior or mock the response differently.

Summary

This PR adds initial support for Google Gemini as a one-click custom provider preset and validation path. The core integration looks directionally correct (OpenAI-compat endpoint, x-goog-api-key header, Gemini-specific flags in agent.ts). However, it is mixed with a clearly personal file (readme2.md), disabled quality-gate hooks, missing tests and changesets, and a couple of cleanup items. The CI workflow also needs version bumps. The PR body is incomplete (no summary, no checklist items checked). Before merging, the personal file must be removed, hooks restored or explained, and tests/changeset added. The test workaround should be refactored.

Questions

  • Was the disabling of pre-commit and pre-push hooks intentional? If the CI now handles all checks, consider removing the hooks entirely or keeping a minimal fast check. If not, restore them.

  • Is readme2.md intended to replace or supplement README.md? It appears to be personal development notes and should be removed from the public branch.

Testing

  • Not run (automation). Test suggestions: add Vitest tests for Gemini validation and agent compat; consider a component test for the new UI button.

Open-CoDesign Bot

function geminiEndpoint(baseUrl?: string) {
const root =
baseUrl && baseUrl.trim().length > 0
? baseUrl.replace(/\/+$/, '')
@J35u5128 J35u5128 closed this May 25, 2026
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.

3 participants